This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
hi i have a problem sending an uint16 with uart: if i read and sent the number in an array like this[1,2,3,4,5] my result is 12345 on the serial monitor but if i try to change my array with this[123, 2,3,4,5] my result is 1<2345 why?
Hi Leonardo,
I can't explain that specific outcome.
Is the serial monitor showing the exact number received, or the ascii decoding of what was received? i.e. if you send '49', '50', '51' do you get '1','2','3' out?
Can you scope the serial bus to determine exactly what the device is sending? (to determine if the issue is what the SCI sends or what the serial monitor interprets)
No only 4* 5* 5* . I think it read only first character if i send 123 he read 1-/
Hi Leonardo,
Not sure what is exactly happening here. You might use a breakpoint to stop the code so you can examine exactly what is being written into the SCI TX register and how many writes occur. If the larger numbers only result in one write to the TX register, it seems like the interpretation issue is probably on the serial monitor side (which really means you aren't sending it what it is expecting).
What is the physical interface to the serial monitor? CMOS levels straight from the device pin, a virtual COM port via FTDI chip, or are you using a transceiver of some type (e.g. RS-232 transceiver)?
I have use as base the echoback example with the code composer serial monitor (9600 )...
In my code i have senn for write on the serial minitor 123
I have to use serial_xmit(1) serial_xmit(2) serial_xmit(3)
I think that it possible to sent directly a uint8 as 123...
Thanks for the help
Hi Leonardo,
It looks like the serial_xmit sends a single 'char' in the echo back example. Maybe try sending '1', '2', '3' instead of 1,2,3? You won't be able to send '123' as a single message in this case. You may also need to send the null terminator: '\0'
Alternately, is there a configuration for the serial monitor to display the raw received character (as numeric or hex) instead of as ascii? Since the monitor is displaying a '<' it seems like it is somehow setup to display at least some ascii characters?
ok i thought that scia sends a single byte and in my idea i hope to sent a unit8. there are some code line like scia_trasmit to sent a uint8?thanks for the help
Hi Leonardo,
Yes, the SCI just sends 8 bits of data, this could certainly be a 8-bit integer. It is up to the receiver to interpret this as appropriate.
If you send the data to another MCU or processor, you can format the data however you want. However, when you send the data to a serial terminal you may need to format it in such a way that the serial terminal can correctly interpret the data.
You might try looping the data back to another SCI module on the device or to an SCI on another EVM or to an oscilloscope to determine what raw data is being sent.
if i sent it to the serial monitor, i read it, for example if i sent 1,2 ,3 i read 1,2,3 but if i sent 12, 3,4 i read 1<,3,4. if i can use uint8 i can sent 12 in 8 bit..why he dont read it?
Hi Leonardo,
If you look at the serial port options (where, for example, the baud rate is configured) the default encoding is IEC-8859-1.
If you refer to the Wikipedia article above, characters 0 to 31 are undefined in this standard. If you want to use that terminal, you'll need to send it characters encoded as expected.
Ok if i have understood also if i see in the serial monitir many character like 1, 2 ,3 i cant read 12 13 ecc and i need change the encoding to read these?
Ok, i try to change the encoding of the serial monitor and i try to trasmit a number like a 12 or a13. I hope to read 12 and 13 :)
Which encoding option i have to set?
Hi Leonardo,
I'm not sure if you'll be able to change the encoding that way; I'll send this to the CCS guys to see if it is possible to setup the serial monitor to show the raw received data.
i have try with code composer to trasmit the number 1, 12, 3, 4,5. i read on serial monitor 1E345. this is the same with all the defaul encoding options:iso-8859,utf-8,cp-152...
i dont know which is used by arduino but i think that if the pins sent somethings i have to see somethings like in the serial monitor of composer using 42-43...
it s true?
Leonardo,
Have you tried using other serial terminal programs like Hyperterminal or putty? Would you be able to give them a try? That will help isolate if the issue is in the terminal plugin in CCS or in the interpretation of the SCI transmit data.
Yes i have try and i have the same result.. is it possible that its wrong my scia configuration? Is it possible to send directly uint8 and not caracter?
Thanks for the help
I have the same problem sending characters i have 2 arduino that comunicate very well, but when i try to change an arduino with a ti i have many problems.
Do you have trasmitted at least charaters from ti and arduino?
I have looking everywhere for example code to transmit character using 2 pins different from 42 43 but nothing...
If you find something please post the code because there are no example on web that work...
Thanks
Hi Leonardo,
You can definitely send a uint8 directly with SCI, but the CCS terminal (and likely all other terminal programs) will interpret the result as a character with some specific character encoding.
If you send a message to some other MCU like an Arduino, it will likely be possible to interpret the received message directly by treating it as an integer and not a character.
We don't have any specific examples of communication between a TI EVM using GPIO42 and GPIO43 and an Arduino.
Ok if i have understood ,i can continue to send uint, the problem is of the code compose monitor?when i succed to transmitted these to arduino i will read these as uint?
But how can i transmit those uint with others pin from 42 43 ? I need not an example to transmitt with 42 43 but an example to transmit using two different pin from 42 43:)
Thanks for the help :)