rolfi@tisco.no
Member
Hello,
I am measureing an analogue voltage, and displaying the value in a 4 digit 7-seg LED display. My H/SW is a 20x2 vs. c.0, and PE vs. 5.3.0.
A fairly straightforward task, but on my way, I have encountered a couple of 'strangeties' :
1. bintoascii on a wordvar using bptr (scratchpad, right?) does affect b0.
In essence, this is, what I did:
..
sertxd ("b0 before bintoascii: ",#b0,13,10)
bintoascii w5,@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr
sertxd ("b0 after bintoascii: ",#b0,13,10)
..
I do not know if more regs are affected, just realized (after an hr's struggle..) that my flags got corrupted.. (Simulation , however, preserved b0..)
2. Unlike the chip, using the scratchpad mem with the simulator does not seem to work. I ran the following in the simulator and on the chip. No data could be found in the 'Memory'-window when simulating:
....
w5=12345
bintoascii w5,@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr
bptr=3
@bptr="%"
bptr=0
sertxd (@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr,13,10)
....
(The sertxd here is just for checking, and not used in the actual program, which is displaying w5 in a 4 digit 7-seg LED display)
Isn't there something odd here, or have I misunderstood the use of the scratchpad or anything else?
Where are the "variables" ptr, bptr, and timer3 located?
Thanks ..
I am measureing an analogue voltage, and displaying the value in a 4 digit 7-seg LED display. My H/SW is a 20x2 vs. c.0, and PE vs. 5.3.0.
A fairly straightforward task, but on my way, I have encountered a couple of 'strangeties' :
1. bintoascii on a wordvar using bptr (scratchpad, right?) does affect b0.
In essence, this is, what I did:
..
sertxd ("b0 before bintoascii: ",#b0,13,10)
bintoascii w5,@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr
sertxd ("b0 after bintoascii: ",#b0,13,10)
..
I do not know if more regs are affected, just realized (after an hr's struggle..) that my flags got corrupted.. (Simulation , however, preserved b0..)
2. Unlike the chip, using the scratchpad mem with the simulator does not seem to work. I ran the following in the simulator and on the chip. No data could be found in the 'Memory'-window when simulating:
....
w5=12345
bintoascii w5,@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr
bptr=3
@bptr="%"
bptr=0
sertxd (@bptrinc, @bptrinc,@bptrinc, @bptrinc,@bptr,13,10)
....
(The sertxd here is just for checking, and not used in the actual program, which is displaying w5 in a 4 digit 7-seg LED display)
Isn't there something odd here, or have I misunderstood the use of the scratchpad or anything else?
Where are the "variables" ptr, bptr, and timer3 located?
Thanks ..