Its the internal eeprom of the pic16f84a
uhh...der...it sure is...dumb question on my part...
Break it down, get it simple, get rid of all of that other stuff in your program, make something seriously simple, and build it back up. There is a bit of a logic error in your program that'll probably cause your symptoms.
Thank you for your quick help on this
Ok I did as you suggested
I made a new file, and slowly added until I had a problem. I'm not sure if this is the problem with my "write" but I wouldn't doubt it, due to some sort of overflow.
here I am trying to get a percentage of a word sized integer
percent=35
example: A=65535 * .35 or A=(65535*100) /35
'-----------
A = TOTAL * 100 'A is temporary storage of computation
A = DIV32 PERCENT 'using DIV32... B can be any integer up to 65534
'-----------
if total=100 wouldn't A=35 ???
I'm not familiar with DIV32 at all, I read up on it and understand somewhat how it works, becuase PBP can't deal with numbers larger than a "word" it uses this as a temperary variable so that people like me can do this type of math, right ?
Hi, Jason
Did you had a look to THAT Thread ???
http://www.picbasic.co.uk/forum/showthread.php?t=1078
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
WOW
I think that is my problem here. However I only understood a little bit of it.
Why is this so complicated just to store a word ?
OK, so I thought storing total.byte0 in location 0 and then storing total.byte1 in location 1 would handle the whole word right ?
'----------------------------------------------------------------------
total=33024 or total.byte0=10000000 and total.byte1=11111111
write 0,total.byte0
write 1,total.byte1
If so then in location 0 would be 10000000 and in location 1 would be 11111111
or is this wrong ?
if it is right then I can't get that data back the same way ?
read 0,total.byte0
read 1,total.byte1
total=33024
if not then what ???? I'm more confused then before, but I think your on the right track
total=33024
Binary(33024) = %1000000100000000
total.BYTE1 = %10000001
total.BYTE0 = %00000000
Originally Posted by PBP Manual
Last edited by rhino; - 8th June 2007 at 20:38.
Wisdom is knowing what path to take next... Integrity is taking it.
Ryan Miller
And there be the logic error I thought I saw earlier...
Now build you program up and see what happens...then we can work on optimizing that program a bit. I looks a bit of a mess...not too bad, but could be better...
thank you for setting me straight, however that didnt answer my question. am i reading the data back to "total" correctly ?
Bookmarks