Hello,
Is there an example available, or can anyone tell me how I need to configure and use 2 SPI ports of the PIC microcntroller? Each example I find is always for 1 SPI port.
Sending and receiving data through 2 SPI ports
hi
Code: Select all
spi1_init(param...)
spi2_init(param...)
happy coding 8)
hi,
Like JPC say.... which pic do you use ? at the begining i was thinking you want to use one of those pic with 2 spi ... like the 18f8722... this chip have 2 usart, 2 MSSP so one i2c and one spi OR 2 spi OR 2 i2c ...
The best place to chk if your pic have the hardware you want to use is in the thing call a datasheet
happy coding
Like JPC say.... which pic do you use ? at the begining i was thinking you want to use one of those pic with 2 spi ... like the 18f8722... this chip have 2 usart, 2 MSSP so one i2c and one spi OR 2 spi OR 2 i2c ...
The best place to chk if your pic have the hardware you want to use is in the thing call a datasheet
happy coding
Hi,
The only reason I can think of to justify having more than one SPI port is when you have devices that have wildly different SPI configurations
that will not function with the same SPI_Init paramaters (or compromised with hardware), and you cannot afford lost time in re-initialising
the SPI port between device selects.
Even if you have two devices on two SPI ports, you can still only read one at a time, and lets face it - if you are concerned with real-time data-aquisition
of more than one input with no phase delays (and PIC18F/10MHz SPI data speed is not fast enough) then you'd be better off with multiple PIC's or dsPIC...
The only reason I can think of to justify having more than one SPI port is when you have devices that have wildly different SPI configurations
that will not function with the same SPI_Init paramaters (or compromised with hardware), and you cannot afford lost time in re-initialising
the SPI port between device selects.
Even if you have two devices on two SPI ports, you can still only read one at a time, and lets face it - if you are concerned with real-time data-aquisition
of more than one input with no phase delays (and PIC18F/10MHz SPI data speed is not fast enough) then you'd be better off with multiple PIC's or dsPIC...
Quite. Which is why I hope they fix the bug on multiple SPI ports with the new release for dsPIC. Last time I tried it, it used SPI 1 regardless of which SPI port was addressed.FRM wrote:if you are concerned with real-time data-aquisition
of more than one input with no phase delays (and PIC18F/10MHz SPI data speed is not fast enough) then you'd be better off with multiple PIC's or dsPIC...
Since pretty much all dsPICs and PIC24s have 2 SPI ports, it will become a matter of convenience to use them both. Particularly if you're using SD/MMC or SPI ethernet, you're going to want to dedicate a port to those.
If you know what you're doing, you're not learning anything.
Re: Sending and receiving data through 2 SPI ports
hi. i have also had the problem SPI1_Init() was not declared... i look datasheet and i think that pic24xxx series have 2 SPI modüles... not Pic 18Fxxx... then i want to use pic18... what must be the solution... i will be happy if you can reply... sorry for my bad english...
Re: Sending and receiving data through 2 SPI ports
a simple parametric search at http://www.microchip.com/ParamChartSear ... &pageId=74 will return 82 different p18 chips with 2 SPI modules.
Last post in this thread was allmost 5 years ago, a few things have changed since ...
Last post in this thread was allmost 5 years ago, a few things have changed since ...
Au royaume des aveugles, les borgnes sont rois.