Serial output transmit real HEX ? not Ascii-HEX
Ltech
Posts: 380
in Propeller 1
Need some boost !
I use Full_duplex_serial to sent hex codes.
The code is a variable integer, example "88866344"
I need to sent this in Hex code
So has to be "05 4B FE 28" looking on Realterm program hex 8 bit mode
I use Fullduplexseria, command "text.hex(88866344,8)" sound easy....
=> bad output it is Hex translated in ascii " 30 35 34 42 46 45 32 38 " , not HEX code
It is frustrating, I can't find the way to get it
Thanks :crazy:
I use Full_duplex_serial to sent hex codes.
The code is a variable integer, example "88866344"
I need to sent this in Hex code
So has to be "05 4B FE 28" looking on Realterm program hex 8 bit mode
I use Fullduplexseria, command "text.hex(88866344,8)" sound easy....
=> bad output it is Hex translated in ascii " 30 35 34 42 46 45 32 38 " , not HEX code
It is frustrating, I can't find the way to get it
Thanks :crazy:
Comments
Most people would refer to this as sending it in binary, rather than hex, since one bit is sent at a time, not four.
Thanks for respons
I do not have acces to the lab now, so I can't test til tomorrow.
I try already text.tx (variable) .
But do you think text.tx (variable.byte[0])..... would make it a Hex value ?
Is this code not sending a 4 as HEX ..... then the next 4 as Hex ...
The text.hex result is correct, but in ascii translation (= 2 bytes / char)
Electrodude's example, and my looped version, are correct. If you have the ability to view bytes in HEX, it is your application that is doing the conversion for display -- it has nothing to do with the transmission or storage of the values.
@JonnyMac NICE ! 100% clear, Just what I need.
@Electrodude to point to .byte
Both of you are are really great peoples .
I have to wait tomorrow to test it. Lab is locked off
If this work we would be very happy
I missed the "x.byte[idx]" trick, never used myself.
thank again
This is basically identical to what Electrodude code is doing in Spin, and you'd reverse the order the same way as Jon showed.