counter to picaxe

golfnut

Member
Hi, I am looking at getting the counter value from a three byte wide counter into a 20x2 .

So I need to get the info off 12 lines - I want to keep it simple but should I be adding a mux device to each byte in sucession??

gn

ps ive used i2c one time and of course getting register values was easy then..
 

hippy

Ex-Staff (retired)
It's up to you really; you can read it byte-wide and read in three bytes, or you can multiplex all bits down to one line and reconstruct the 24-bits once received. Or you could go anywhere in between. It's obviously a trade-off between number of I/O lines used and time taken.

One thing to bear in mind with any multiplex read is that the data being read may change during reading giving corrupt data. It is often best to latch the data then read that. You should likely be able to find hardware which latches and multiplexes. This can cut down hardware required but will influence how the data can best be read.

One solution is three 74HC373 style latches. These can simulataneously sample the 24-bit data and by controlling each /OE can selectively put their 8-bits held on a byte-wide bus.
 

westaust55

Moderator
Another alternative, although maybe primative compared to some methods is three (3) 74HC165's cascaded. (the converse of the ubquitous 74HC595)

Snap shot of the data by one Latch command and then clock the data into the PICAXE serially into three separate bytes.

See example "bit-bang" code under SHIFTIN in PICAXE manual 2.
 
Top