While working on my timer project I found my self looking towards the bptr command. when I read the manual I thought that is was another way to access the variable, I found myself very confused @ 4am. the project will need to display it output ontp a parallel connected OLED. I could have gone serial but I had most of a 20x2 left spare. after trimming back the code for the firm ware and starting to add the timer code for a display test I found that I kept getting garbage displayed on the OLED, confused I started playing around with things and found that the pbtr does not correlate to the variable (pbtr 20 is not b20).
this is still a bit of a mess but was actually the only way I could get the ascii stored on the variable to the pbtr.
I cant help either feeling a bit dumb or that I have missed something that is staring me right in the face.
Code:
[color=Black]main:
[/color][color=Blue]let [/color][color=Purple]w2 [/color][color=DarkCyan]= [/color][color=Navy]12345
[/color][color=Blue]bintoascii [/color][color=Purple]w2[/color][color=Black], [/color][color=Purple]n5[/color][color=Black],[/color][color=Purple]n4[/color][color=Black],[/color][color=Purple]n3[/color][color=Black],[/color][color=Purple]n2[/color][color=Black],[/color][color=Purple]n1
[/color][color=Blue]gosub [/color][color=Black]msg
[/color][color=Blue]end[/color]
[color=Black]msg:
[/color][color=Green];let b29 = b28 & %00001111 * line_length
; EEPROM start address is 0 to 15 multiplied by 16
;let b30 = b29 + line_length - 1 ; end address is start address + (line_length - 1)
;let n5 = "1"
[/color][color=Purple]bptr [/color][color=DarkCyan]= [/color][color=Navy]20
[/color][color=Blue]poke [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]n5
[/color][color=Green];let n4 = "2"
[/color][color=Blue]poke [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]n4
[/color][color=Green];let n3 = "3"
[/color][color=Blue]poke [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]n3
[/color][color=Green];let n2 = "4"
[/color][color=Blue]poke [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]n2
[/color][color=Green];let n1 = "5"
[/color][color=Blue]poke [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]n1
b30 [/color][color=DarkCyan]= [/color][color=Navy]4
[/color][color=Purple]bptr [/color][color=DarkCyan]= [/color][color=Navy]20
[/color][color=Blue]for [/color][color=Purple]b31 [/color][color=DarkCyan]= [/color][color=Purple]b29 [/color][color=Blue]to [/color][color=Purple]b30
[/color][color=Blue]peek [/color][color=Purple]@bptrinc[/color][color=Black], [/color][color=Purple]b28
[/color][color=Green];let b28 = b0
;read b31,b28 ; read next character from EEPROM data memory into b1
[/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Purple]b28 [/color][color=Green]; output the data
[/color][color=Blue]debug
pulsout enable[/color][color=Black],[/color][color=Navy]1 [/color][color=Green]; pulse the enable pin to send data.
[/color][color=Blue]next [/color][color=Purple]b31 [/color][color=Green]; next loop
[/color][color=Purple]b29 [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]return[/color]
I cant help either feeling a bit dumb or that I have missed something that is staring me right in the face.