Porting a little Arduino code....


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11980
Posted: 11:57pm 21 Jan 2015      

The 74HC595 documentation is stupidly confusing but the chip is very easy to use.

We can assume that there are 4 chips to drive the 4 displays. These will be daisy-chained together.

This is the header from my use of the 74HC595 to drive a parallel display:

dim integer LT_latch=7 'b3 connect to pin 12 on all 74HC595
DIM integer Master_reset=15 ' connect to reset on all 74HC595 (pin 10)
' SPI Clock - connect to pin 11 on both 74HC595
' SPI Out - connect to pin 14 on first 74HC595
' connect pin 14 on second 74HC595 to pin 9 on first, etc.
' connect pin 13 (output enable) on both 74HC595 to GND
pin(LT_latch)=0
setpin LT_latch,dout

If it is 4 chips use SPI OPEN 1000000,3,32 to send all the data in one go

then:
i=spi(&HFFFFFFFF)
pulse LT_latch,0.01

should light all the display elements