Jump to content
43oh

Send hex values via UART?


Recommended Posts

I've just started to toy around with Digi's XBee S2 ZigBee modules and my Tiva C-Series Launchpad.

 

The XBees receive all their commands from any attached microcontroller via UART.  I'm reading through the TivaWare UART API documentation, and it looks like the only function available to send data takes an ASCII character as an input rather than a hex value.  Am I overlooking some other function that would take a hex value as an input, or do I have to convert my string of hex "characters" into ASCII first, then use the UARTCharPut() function?

 

 

Link to post
Share on other sites

UARTCharPut simply takes a char, a 8bit value. Remember all ASCII chars are just bits, bits can be represented in hexadecimal values.

You can use a variable with a heximal value. Remember that if you want a variable "Value" to have the letter "A" in ASCII you have to do this:
 

 

char Value = 'A';

 

or

 

uint8_t Value = 'A';

But if you check the variable with have the value 65 or 0x41 and if you declare it or give it a value like this:

 

Value = 0x41;

 

It will actually have the letter "A" in ASCII, correct?

 I hope you understood.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...