SPI on A5..A7 not accepted... - ERROR: Pin A5 is not capable of SPI SCK... #628
Replies: 9 comments
-
Posted at 2014-11-10 by DrAzzy A5-7 is SPI1, not SPI2. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @allObjects There must be more to how the x in SPIx of code maps the n in SPIn of the board description at http://www.espruino.com/ReferenceESPRUINOBOARD, because SPI1 is mentioned twice... Intuitively from the code and the reference I mistakingly(?) concluded that the SPIx, x=1..3, are just three instances of code SPI, and the setup assigns the actual pins. For sure that is not correct... and for sure the error message wrong or at least fuzzy, but it seems not to be the only thing behind the mapping and the reference of SPI1 twice and SPI3 sharing pins with SP1 for some cases. A better error message would say something like:
because setup knows obviously for what x it is... Btw, above message hints that B3 uses a different pin setup than A5... that may be the issue that I'm having in communication with F RAM in post http://forum.espruino.com/conversations/257994 A bit confusing... (not only here but there as well... most likely I did not yet come across the doc that explains the details 'here' as well as 'there'). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @gfwilliams There are 3 SPI peripherals (physical bits of hardware) and you can choose which pins these map to - but you don't get much choice. Most peripherals have very simple choices:
Sadly you don't just get to choose exactly what you want where... Unless you use 'software' SPI |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @allObjects @gordon was thinking along your lines... Software SPI? ...but not supported (yet) in Espruino's firmware, correct? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @gfwilliams Yes, it is supported... Just use it like this:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @allObjects Ic... first I though software SPI is on ANY pin - but it meant to say: an SPI object on any of the SPI supported pin sets. Instead of using the existing SPIx (instances), I crate a new one (from the SPI 'class' definition). That is the part I missed. Then I can call it what ever I want... like:
This are all my SPIs I have to work with. And since the onboard SD card sits fixed on one of the SPI pin sets, I already have to use the chip select. As long as the baud rate is compatible (I don't know if baud rate can switch after setup/connect), sharing the the pin sets should not be too much a challenge (I have another SD card in the game: the sd card on the display break out board, and it does not have separate pin outs... if I want to use it, it looks that I have to do some hardware setup - open/close solder-'jumpers'. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-11 by DrAzzy My understanding is that software SPI (ie, created with new SPI() ) can use any pins, not just any set of SPI pins. It doesn't let you set the baud, like the hardware SPI's do - it goes as fast as it can, and that works for a lot of hardware. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-11 by @allObjects The F RAM is able to handle up to 40 MHz. With a 72 MHz clocked machine that takes care of bits with software, the free running clock / baud could be a high single digit to low two digit fraction. @drazzy, with a free running clock / baud rate, is the clock regular enough? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-11 by @gfwilliams The clock on software SPI won't be that regular - it'll be fast, with pauses between bytes. If you need solid timing, just use hardware SPI. edit: I'm still not convinced the device will care that much about timing - especially as it can take such a wide range of input speeds. After all, that's what the clock is for... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-10 by @allObjects
Wanted to use A5..A7 for SPI CLK, MISO, and MOSI as Espruino 1v3 board specification lists
but get the following console output:
Do I miss something here?
Beta Was this translation helpful? Give feedback.
All reactions