Originally Posted by don_mathew
Once you store initial values into your eeprom then
you can also do this:
READ 0, PORTB
----------------
Originally Posted by don_mathew
Once you store initial values into your eeprom then
you can also do this:
READ 0, PORTB
----------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
reading from eprom is working but when i try to read 15address location and save them one by one in array its not working...this example is not working can enybody tell me what is wrong in this code...on PIC simulator IDE v6.34 on
var led[15] led board gives me sign on PORTB $0F instead $FF
define OSC 8
TRISB = $00
PORTB = $00
i var byte
led var byte [15]
led[0] = %00000001
led[1] = %00000010
led[2] = %00000100
led[3] = %00001000
led[4] = %00010000
led[5] = %00100000
led[6] = %01000000
led[7] = %10000000
led[8] = %10000001
led[9] = %10000010
led[10] = %10000100
led[11] = %10001000
led[12] = %10010000
led[13] = %10100000
led[14] = %11000000
led[15] = %11111111
loop:
for i = 0 to 15
PORTB = led[i]
Next i
goto loop
PIC16F84A
i found the problem...
i'm c++ programmer and when u define array like this
int var[15]
that means var from 0 to 15 and thats 16 memory addresses
and in pic basic
led var byte [15] means from 0 to 14...i hope that this post will help someone...
That's your problem, you defined a 15 byte array and are trying to address the 16th element.Originally Posted by don_mathew
led var byte [15] ' defines a 15 byte array addressed 0 to 14
Change the 15 to a 16 and all should work.
If you define a 16 byte variable, is it the same thing as defining a word variable?
NOPE
16 BITS will be a WORD.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks