pass spi object
slcott
Posts: 27
I'm still learning how to use the propeller. The propeller on my board is trying to communicate over SPI to multiple chips. I'd like to use an SPI object in each of the spin files that I have associated with each of the IC's that the microprocessor communicates with.
It seems that only one of my objects can allocate the SPI object at a time. Can I pass this object around or should I just implement the SPI interface within each of the different objects that I am working with.
- Some of my objects
DAC : "digital analog converter"
ADC : "analog digital converter"
FPU : "floating point unit"
SPI : "spi asm"
It seems that only one of my objects can allocate the SPI object at a time. Can I pass this object around or should I just implement the SPI interface within each of the different objects that I am working with.
Comments
Of course the different SPI objects should all work on different PINs if they run in different COGs. Otherwise, if you run the different SPI instances in different COGs AND you want to use the same SPI bus, you have to add code to synchronize the access.