Reading ascii from a 1-wire chip - Help?....
JohnGuy
Posts: 13
Hi all,
I've managed to get my BS2p40 to read 1-wire serial number chips (Dallas DS2401) in hex format, using the example code in "Commands, Features, and Projects".
But what I really need for it to do is to read text I have written in ascii format on another type of 1-wire chip (Dallas DS2506).
How can I get it to read ascii? -or if it won't read in ascii, can I read in hex or dec and somehow convert to ascii? If I read it in hex or dec, will I be able to decipher the original ascii characters?
Thanks for your help!,
JohnGuy
I've managed to get my BS2p40 to read 1-wire serial number chips (Dallas DS2401) in hex format, using the example code in "Commands, Features, and Projects".
But what I really need for it to do is to read text I have written in ascii format on another type of 1-wire chip (Dallas DS2506).
How can I get it to read ascii? -or if it won't read in ascii, can I read in hex or dec and somehow convert to ascii? If I read it in hex or dec, will I be able to decipher the original ascii characters?
Thanks for your help!,
JohnGuy
Comments
Say one ov the variables you are reading in HEX is cat.· If you write:
debug cat, cr
it will display cat in ASCII.· If you write:
debug dec ? cat, cr
it will display cat in decimal notation.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Okay, I've got this code running:
....
AUXIO
OWOUT OWpin_1, OW_FERst, [noparse][[/noparse]ReadROM]
OWIN OWpin_1, OW_BERst, [noparse][[/noparse]STR ROMData\8]
FOR idx = 0 TO 7 '
DEBUG DEC ROMData(idx)', " "'
NEXT '
....
I get back from one of the chips:
1513017311000141
[noparse][[/noparse]For some reason I only get back "-" from the other chip].
Can I somehow convert this to the original ascii text?
Thanks!
JohnGuy
DEBUG DEC ROMData(idx)', " "'
to
DEBUG ROMData(idx)
and tell us what you get.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
The debug screen prints out a square box. I tried to copy the character and paste it here, but it just ended up as whitespace.
Thanks,
JohnGuy
DEBUG DEC ROMData(idx)', " "'
to
DEBUG DEC ROMData(idx), "· "
and tell me if you get 8 pairs of digits.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
I have 2 1-wire chips hooked up. They have slightly different ascii letters in them. I get:
15 130 173 11 0 0 0 141
15 153 175 11 0 0 0 173
Thanks,
John
DEBUG DEC ROMData(idx), "· "
to
DEBUG·HEX ROMData(idx), "· "
and tell me what you get.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
F 82 AD B 0 0 0 8D
F 99 AF B 0 0 0 AD
Thanks,
JohnGuy
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
The first chip is programmed:
Part No: 4000019-11 Rev A
ser: 00034
[noparse][[/noparse]etc.]....
....
The second chip is programmed:
Part No: 4000006-11 Rev A
ser: 00033
[noparse][[/noparse]etc.]....
....
The Maxim program allows me to look at it in ascii or binary, but not in decimal or hex.
JohnGuy
50 61 72 74 20 4E 6F 3A | Part.No:
When I look at an ascii-to-hex conversion table, the hex on the left of that line maps onto the ascii on the right of that line.
But why aren't the correct codes read by the Parallax chip?
Thanks,
JohnGuy
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
DEBUG DEC ROMData(idx), "· "
to
DEBUG·ASC ?·ROMData(idx), "· "
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·