Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 4 months ago.
Help with basic C code for SPI to LED Drivers
I am trying to get my custom board programmed and I am once again over my head - which doesn't take much at all.
I have a Nordic nRF51822 mbed board successfully connected to a custom board with four STP16CPC26 LED drivers mounted. Everything is physically working now because a friend of mine wrote a shift register routine (in hex!) and I see all of the LEDs are working as they should.
I'm trying to change this to use SPI and the mbed book has sample code showing how to code to MOSI, MISO, and SCLK. However the ST datasheet lists out LE and OE (active low). The same friend explained the concept of output and latch enable, but I don't know how to convert the code in the book to what I need.
This is surely an embarrassingly bad question to be asking, but is there anyone out there who can help with this?
Thank you.
1 Answer
Assigned to
10 years, 4 months ago.This means that the question has been accepted and is being worked on.
And also, the STP16CPC26 does not have a chip select (CS) pin.
posted by Thaddeus Fortenberry 22 Jul 2014FYI you already set the question as accepted so people cant make new answers, only comments.
You use SPI for MOSI, MISO and SCLK (I guess you won't be using MISO). LE and OE you drive with DigitalOut, the datasheet should tell how they need to be controlled (could very well be that you can just tie OE to ground).
posted by Erik - 22 Jul 2014