Table lookup and BCD output

alhoop

Member
Hello
I am using the following to index a table using a Picaxe 20M2.
works fine - will the table values remain when power is turned off
and only change with a new download?
Code:
#picaxe 20M2

table 0,(218,109,73,55,44,36,31,27,24,22,20,18,17,16,15,14,13,12,11,11,10)
for b0 = 0 to 20
readtable b0,b1
Sertxd("the value of b1 is ",#b1,10,13)
pause 1000
next b0
Going to try to use PortB on the 20M2 to drive two TIL311's (BCD units and tens).
without intervening chip(s). Is that possible?
PS
Evidently not - guess I'll use the Picaxe 20X2. I don't understand why the unary command
BINTOBCD is not listed under Basic Commands.

PPS
Here is how I load 2 bcd characters from Picaxe 20x2 to two TI TIL311's using above code to load data.
If anyone is interested. BTW the TIL 311's are LED displays and therefore are current hogs.
Code:
let outpinsB  = bintobcd b1 
dirsb = $ff
pause 1000
low c.4	    ;unblank TIL311's
low c.5	    ;latch strobe load BCD data into 311's
high c.5	    ;finished loading
pause 10000  ; wait until everyone had read display
high c.4         ;blank  display
goto start
end
Feel free to critique and offer suggestions - maybe on how to make more elegant -not interested
in saving memory - I'm using 91 bytes out of 4096 available.
Thanks
Al Hooper
 
Last edited:

westaust55

Moderator
Table memory is a part of the main program memory thus the values are set as part of and at the time of program download.

As hippy has advised, the values are retained during a power Off.
 
Top