Tachyon - How Do I Define SPI Pins?
JonnyMac
Posts: 9,104
I'm using one of my old Propeller Platform boards with a custom shield that has a 74x165 shift register and a couple of quadrature encoders (was in my October 2010 column). Since the EEPROM is a 24LC512 instead of a 24FC512 I cannot load EXTEND.FTH into it (it hangs). I have an FC part on the way but still want to work with this board.
There are words for SPI in the dictionary, but I cannot figure out how to tell them which pins I'm using for SCLK and MISO.
There are words for SPI in the dictionary, but I cannot figure out how to tell them which pins I'm using for SCLK and MISO.
Comments
You could use pure hex notation $17191A18 SPIPINS but that is hard to figure out and read. The decimal points in the & style number aren't optional as they are responsible for delineating each decimal byte.
In the V4v7 folder there are several files that access SPI but a nice easy one is FLASH.FTH for serial Flash chips. Some other files are EASYNET and SNIFFER which uses an nRF24L01+ chip for sniffing 2.4GHz. In fact there is a really simple one called BARLEDS.FTH which shows different ways of clocking 64-bits of data to 74HC164 shift registers that only have clock and data:
There is no chip enable but MOSI is specified as a dummy chip enable.
and this is the general bit of code that sends out data: although you can send 16 or 32-bits in one hit. It takes 8us to send all 32-bits.