Memory map
tronsnavy
Posts: 70
Greetings from VA Beach,
In the manual "What's a Microcontroller?", I just fininshed Activity #3 in chapter 7.· I used the "write" command to store values from the photoresister (to address's 00-58 DEC, 00-3A HEX).· I then used the "read" command to display those same values in the debug terminal.· However, afterwords I opened the "Memory Map" to look for these values.· At the very bottom is the HEX code from the last program that I just ran.· It does not display the "stored values" from the photoresistor.· I know that I am probably missing something.· Can someone explain where these values are in the "Memory Map" window?· Thanks and have a good one.
Bob
In the manual "What's a Microcontroller?", I just fininshed Activity #3 in chapter 7.· I used the "write" command to store values from the photoresister (to address's 00-58 DEC, 00-3A HEX).· I then used the "read" command to display those same values in the debug terminal.· However, afterwords I opened the "Memory Map" to look for these values.· At the very bottom is the HEX code from the last program that I just ran.· It does not display the "stored values" from the photoresistor.· I know that I am probably missing something.· Can someone explain where these values are in the "Memory Map" window?· Thanks and have a good one.
Bob
Comments
The DATA statement is used to initialize areas to be used by READ / WRITE statements, either to supply an initial value or to provide values for tables read with a READ statement.
·
Know a lot more about trons than programming. Persistance pays off.
Have a good one.
Bob
Now I know why.
Thanks Mr. Green and thank you Bob for asking the question.
Regards,
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Instead of:
"Those who can, do.· Those who can't, teach." (Shaw)
I prefer:
"Those who know, do.· Those who understand, teach." (Aristotle)
·
Just finished activity #3 in chapter 8 (What's a Microcontroller?).· I was thinking about skipping this chapter (not big into music, except playing my own guitar... ROCK ON).· I decided that·the chapter·might teach me something about programming.· Sure enough, it did.· All data elements that were declared using the DATA statement showed up in the memory map window (although I had to convert the base 10 elements to HEX... DEC > BIN > HEX).· Thanks Mike.· Rock on and have a good one.
Bob
·
So in order to convert base-10 to HEX, one must go from decimal to binary to hex in PBasic? Can't go straight from decimal to hex? I admit I haven't read up on base conversions yet, although I think I might be required to do a conversion in a current project.
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Instead of:
"Those who can, do.· Those who can't, teach." (Shaw)
I prefer:
"Those who know, do.· Those who understand, teach." (Aristotle)
·
http://forums.parallax.com/forums/default.aspx?f=5&m=370460
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Instead of:
"Those who can, do.· Those who can't, teach." (Shaw)
I prefer:
"Those who know, do.· Those who understand, teach." (Aristotle)
·
If you understand binary, you can convert DEC to BIN (then converting to HEX is easy)...... If you take a·BYTE (1111, 1111), each digit represents a·DEC number (MSD 1= 256, next is 128, then 64, then 32, then 16,...·the·next·sequence is·8,4,2 and finally 1 (LSD)).· Notice each corrisponding DEC digit is a mutliple of 2.· Thus, a number such as 56 (DEC)·= (0001, 1100) BIN..... i.e.·32·+ 16 + 8 = 56(DEC).··Once you have DEC converted to·BIN, you have (0001, 1100) BIN =·1C HEX.· 1C· (HEX) is·the same as 56 (DEC).· DEC = 0,1,2,3,4,5,6,7,8,9.· and HEX = 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.··Hope this makes sense.· It's what I use if I need to convert using pencil/paper.· ROCK·ON and have a·good one.
Bob
56(DEC) = 21(HEX). BIN = MSD =128 (not 256), then 64, then 32, then 16.... then 8, 4, 2, 1. So, ***** 56 DEC = 21 HEX. Once again, sorry.
Rock On.
Bob
I've been tinkering with the BS2 for a year now and never had a need to delve into the byte/word/lowbyte/highbyte aspect. But I'll need it for a project and it's time to learn.
Thanks much,
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Instead of:
"Those who can, do.· Those who can't, teach." (Shaw)
I prefer:
"Those who know, do.· Those who understand, teach." (Aristotle)
·