Go Down

Topic: Full brightness multiplexing. (Read 6 times) previous topic - next topic

Boffin1

  DC42 suggested 
Quote
Why not use thirteen TPIC6B95s as the column drivers and eight P-channel mosfets as the row drivers?


Sounds a good idea , and  I have built a test panel, but only 7 x 5 LEDs.   (  I only have enough LEDs for the project in this format !  I am going to leave a physical gap between each character display - later on I might move to 8x8 and do scrolling )

I want to get this one panel going to test in the sun.

I have 5 rows driven by mosfets, and 7 columns with 7 resistors to DRAIN1 to DRAIN7  of the TPIC6B595. ( DRAIN0 not used )

One problem is that I have migrated to the RFM22B wireless modules ( and RF22 library )  that uses SPI and the pin 2 interrupt.

I have been using  Shiftout to run my 7 seg displays ( latching ),  but I now have have 24 characters that I wish to update , and it sounds like SPI is the way to go speed wise to multiplex each row sequencially ?  Crossroads uses SPI for everything ( sorry this is new ground for me )

I have used SPI and each driven chip needs a chip select input ?  So if I need 24 chip selects I could do that with 3 CD4017s and one clock pin of the arduino ?   

My old Shiftout version just pumps out the data to the first data in pin.

If the receiver detects an interrupt ( I am hoping it is only when a message arrives )  it will presumably disrupt the display refresh?

I could possibly blank the display with the notG while it is dealing with the incoming data..

I am also trying to get my head round the array to store the data in.     It used to be a binary byte for the 7 seg , which I just called up for  shifting out the data for each digit.

Now  I must send out the right byte pattern for the top row of the number for each digit, latch it in,  then load the  second row, and so on ?

I have searched for a library to do this, but they seem to be devoted to particular chips  ( which are expensive here )

I am going to write a sketch to run this one display to show a couple of letters, using shiftout for now, if anyone has some pointers I will appreciate it .
With my mobile phone I can call people and talk to them -  how smart can you get ?

dc42


I have used SPI and each driven chip needs a chip select input ?  So if I need 24 chip selects I could do that with 3 CD4017s and one clock pin of the arduino ? 


You don't need 24 chip selects, you can daisy=chain the TPICs from the SPI pins just like you do with ShiftOut. So one CS pin for all the TPICs.  


If the receiver detects an interrupt ( I am hoping it is only when a message arrives )  it will presumably disrupt the display refresh?


If the ISR uses SPI to communicate with the radio, then possibly, but not necessarily. It depends on how the ISR is written, and on whether you can use the same SPI clock fate for both devices. Or, if you can afford to wait a few microseconds before servicing the interrupt (which depends on whether the receiver can buffer incoming data), then you can disable interrupts while you send data to the TPICs.



I am also trying to get my head round the array to store the data in.     It used to be a binary byte for the 7 seg , which I just called up for  shifting out the data for each digit.

Now  I must send out the right byte pattern for the top row of the number for each digit, latch it in,  then load the  second row, and so on ?


Use an array with 8 bytes per 8x8 display, one byte for each row. Shift out the bytes for the rows you want to update.


I am going to write a sketch to run this one display to show a couple of letters, using shiftout for now, if anyone has some pointers I will appreciate it .


The standard ShiftOut is extremely slow. It is not difficult to write a much faster version. See the code starting at line 446 of https://github.com/dc42/arduino/blob/master/Libraries/Lcd7920/lcd7920.cpp. It could be made even faster by calculating and storing the port address and but mask just once during initialization instead of once per byte sent.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Boffin1

Thanks thats pretty encouraging.

Quote
You don't need 24 chip selects, you can daisy=chain the TPICs from the SPI pins just like you do with ShiftOut. So one CS pin for all the TPICs. 


OK so I will use MOSI for the data, clock for clock, and CS for latch .

The RF22 presumably sets the polarity, speed,  etc for the SPI, so I will just fit in with that with a different CS pin?

Quote

Or, if you can afford to wait a few microseconds before servicing the interrupt (which depends on whether the receiver can buffer incoming data), then you can disable interrupts while you send data to the TPICs.


I usually send the transmission several times anyway to be sure ( its just updates of scores now and again ) so I can disable interupts while refreshing each rows data.  ( if the SPI is fast enough there should be time before the next refresh using GMikes timing check  )

I also have a countdown clock that I use "blink without delay" routine for, using millis(), will this be OK ?
Quote

Use an array with 8 bytes per 8x8 display, one byte for each row. Shift out the bytes for the rows you want to update.


Thats basically what I am putting together now for the test which I was going to try with shiftout, but I will try SPI instead.
Can I send out 24 bytes in one go while the CS is low, and then raise it to latch the data?

I'm afraid the example with the LCD display is confusing for me at the moment, I will try my baby steps method to get it running with one panel, and see what happens with 35 LEDs up against the African sun in the morning.

With my mobile phone I can call people and talk to them -  how smart can you get ?

dc42


Can I send out 24 bytes in one go while the CS is low, and then raise it to latch the data?


Yes, you can.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Boffin1

Great,  thanks ,  long night ahead ...
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up