Skip to main content
Topic: Web Platform Schematics, SPI in particular (Read 3461 times) previous topic - next topic

Web Platform Schematics, SPI in particular

Hi people!
I am new in this forum, so please excuse me my ignorance.
I was looking for some prototype for Ethernet connectivity and came across Web Platform, it has all my favorite chips! So i started to look into details.
Is there a particular reason why 3 SPI devices SD_card, 25LC1024 eeprom and ENC28J60 connected to different PIC pins? 33FJ128GP204 has only 2 SPI modules, so at least one of them must be switched between peripherals all the time. Can somebody explain why?
In my experience a lot of SPI devices could be all connected to one SPI bus. Just each device needs separate select line. Much easier to handle.
I also noticed somebody suggesting connection on FT232RL DSR(?) pin to PIC MCLR. Microchip excellent bootloader for PIC18 based on AN1310 has RTS pin connected to PIC MCLR through diode and 470 ohm resistor. Very convenient.
And if there is not enough of PIC pins, MCP23S17 is a good extension device.
dts

Re: Web Platform Schematics, SPI in particular

Reply #1
Hi dts,

Welcome to the forum, and thanks for your questions.

Quote
Is there a particular reason why 3 SPI devices SD_card, 25LC1024 eeprom and ENC28J60 connected to different PIC pins? 33FJ128GP204 has only 2 SPI modules, so at least one of them must be switched between peripherals all the time. Can somebody explain why?
In my experience a lot of SPI devices could be all connected to one SPI bus. Just each device needs separate select line. Much easier to handle.

In general, only 2 of the SPI devices (EEPROM or SD card, and Ethernet) are used at one time so there isn't too much switching in practice. The Ethernet and SD card/EEPROM are on different SPI modules so the storage can be read and moved to the ethernet buffer without swapping between devices each time. Also, the dsPIC33 SPI can run quite fast, and I wanted to avoid making any start configurations with the traces.
Got a question? Please ask in the forum for the fastest answers.

Re: Web Platform Schematics, SPI in particular

Reply #2
Is there any example of connecting another SPI device? I'm looking to connect an RFM12B radio module. I will have to share a SPI interface and i should handle interrupt request that stops normal execution to get data from it as there isn't much of a buffer for receiving.

Any advice?

Re: Web Platform Schematics, SPI in particular

Reply #3
I'm sorry, I don't know of any examples of that. You'll need to prevent the interrupt from swapping the SPI away from the EEPROM or SD card when the radio receives data. Do you plan to use the SD or EEPROM? I guess you could test the Chip Select pin before servicing the EEPROM /SD or radio, and run a cleanup operation if one is already active. It will take some fancy work to avoid collisions.
Got a question? Please ask in the forum for the fastest answers.

Re: Web Platform Schematics, SPI in particular

Reply #4
(sorry, somehow forgot to check the topic).
You are right, it would take some complicated code, that's why i will add another micro to handle all the radio part and communicate with the web platform on the other USART interface. It should be faster and i'm interested in getting things done the easiest way.