Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:45 18 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Additional SPI devices with backpack

Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8296
Posted: 12:12pm 22 Apr 2021
Copy link to clipboard 
Print this post

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: Australia
Posts: 1047
Posted: 12:22pm 22 Apr 2021
Copy link to clipboard 
Print this post

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: Australia
Posts: 3308
Posted: 01:00pm 22 Apr 2021
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8296
Posted: 03:26pm 22 Apr 2021
Copy link to clipboard 
Print this post

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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025