|
Forum Index : Microcontroller and PC projects : Additional SPI devices with backpack
| Author | Message | ||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8296 |
I'm considering using the nFM24L01+ with a 28-pin backpack. I realise I can use software SPI, but could I use the hardware? The thing is, does MMBasic open and close the SPI as it's needed or is it held open? What mode is it in if it is held open? If it's opened and closed then it looks like I can do anything I like, providing that I also close it after use. It looks like the nFM24L01 could use software SPI in mode 0 with a top speed of 1MHz at 40MHz CPU clock. That's not necessarily a problem, but in using software SPI I would also lose 3 pins to MISO, MOSI & CLK - which is quite a percentage considering that I also need pins for CE and CSN. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1047 |
from Appendix D in the Manual Using the SPI with the Colour LCD and Touch Features The standard 28 and 44-pin Micromites have only one SPI channel so this must be shared between the display and touch controllers (if these features are used) and the BASIC program. The Micromite Plus has two SPI channels so this issue does not occur with this version. To share the SPI port with a LCD display on the standard Micromite it must be opened in BASIC and closed again without any intervening commands that might cause MMBasic to send/receive data to the display or touch controllers. This includes commands such as CLS, LINE, etc and the TOUCH() function. The following provides an example. The SPI port is opened and closed within the one function with no intervening graphic or touch commands: F4 H7FotSF4xGT |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
MMBasic will open and close the SPI when it is needed to draw on the LCD or check for touch. It does NOT hold the SPI port open. Geoff Geoff Graham - http://geoffg.net |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8296 |
Thanks, everyone. I must have had brain fog not to see that in the manual. It's obvious enough :( Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |