I follow the example of the next video and I got the TX work.
But I cant make the RX work.
Someone know why?
Thanks
Sincerely
Alvaro Macias
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.
I follow the example of the next video and I got the TX work.
But I cant make the RX work.
Someone know why?
Thanks
Sincerely
Alvaro Macias
Alvaro,
Here is a basic SCI code to receive and send data via the XDS110 serial port.
What you have to do is connect your RM46 launchpad via the USB cable to your PC.
Start a windows serial terminal on the port number corresponding to "XDS110 Class Application/User UART (COMxx)"
You may have to open the control panel/system/Device Manager to figure out the port number (COMxx)
Create a CCS project and use the code provide.
This code will read from the serial port a character (polling mode) and send it back to the serial port creating an echo on the Serial Terminal.
Please have a try and let me know.
Note, the Halcogen project is also part of this zip file.
At first time it works well, but I tried to use LINTX and LINRX pin, and it didn't work. Now the transmit using the USB cable of XDS110 doesn't work, but the reception is working fine.
Alvaro,
The code I've send you is working on the RM46 Launchpad.
Without seeing your code, there is not a lot I can do.
Can you zip your project and share it so I can have a look?
Alvaro,
I've tried your code and it is working fine.
I see the message out to the windows terminal, and the device receives and sends back all key pressed on the windows terminal.
If you try to debug your code by using step function, you have to be careful.
If you stop on the following instruction:
sci->TD = (uint32)(txdata);
and then step it, you will not see the data going out to the terminal. When you step, the CPU only executes the instruction corresponding the the statement.
After that, the CPU is in "Suspend Mode" and all peripheral receive this suspend signal, forcing their clock to be stopped as well.
Because SCI communication are slow and asynchronous, very certainly only few bits from the data to be send will be processed, forcing the receiver (windows terminal in this case) to fail reception.
There is a way to specify the SCI module to finish a transmission or a reception when the CPU enters Suspend Mode. This is what we name, "Continue on Suspend)
To do so, you will have to patch the sciInit routine as following:
/** - global control 1 */
scilinREG->GCR1 = (uint32)((uint32)1U << 25U) /* enable transmit */
| (uint32)((uint32)1U << 24U) /* enable receive */
| (uint32)((uint32)1U << 17U) /* CONT */
| (uint32)((uint32)1U << 5U) /* internal clock (device has no clock pin) */
| (uint32)((uint32)(1U-1U) << 4U) /* number of stop bits */
| (uint32)((uint32)0U << 3U) /* even parity, otherwise odd */
| (uint32)((uint32)0U << 2U) /* enable parity */
| (uint32)((uint32)1U << 1U); /* asynchronous timing mode */
Add the green statement.
NOTE: If you regenerate the code with Halcogen, this new statement will be removed.
Please have a try and let me know.
I tried the code in run mode without break points. It recive well; I can check the variable that receive and the LED for SCIRX blink, but it does not transmit anything and the LED for SCITX is off. I read the signal of LINRX with a oscilloscope and I can see the serial frame, but when I read the LINTX it is always in high. I made other prove I put a jumper between LINRX and LINTX and I can see the eco in the terminal and the two LED blink. I dont know what is happen, if there is an electrical error or is the code. Do you know if there is some test that I can do to check if the board is electrically fine?
Thanks
Alvaro,
Here is the schematic around the LIN connection.
All 4 resistors R122, R123, R124, R125 are on your board.
Can you check with a scope on connector J11 pin 5 (LIN_RX) and pin6 (LIN_TX) if a signal is visible when you press a key or when the prompt is sent to the terminal.
Here is the corresponding schematic:
Let me know the result.
Alvaro,
Could you program the attached out file in your device and run it.
Let me know the result.
Alvaro,
At this stage, I think the board has been damage.
Can you tell me where and when did you ordered it?
On last test:
Connect to the device, and reset the part from the menu Run->Reset->System reset.
This will put all peripheral in reset condition.
In the Register view, expand SYS and search for ClkCntl Register.
The value should be 0x0101_0000
Change it to 0x0101_0100
This will release the peripheral reset.
Now search for LIN1 and expand the registers.
The first one GlbCtrl0 should read 0x0000_0000. Change to 0x0000_0001
Search for register Dir. It should read 0x0000_0000. Change to 0x0000_0004 (TX DIR as output)
Now probe pin 6 on J11 (LIN1_TX) it should be "0". Now change register DOut from 0x0000_0000 to 0x0000_0004 (Output 1 to LIN1_TX)
The signal should be "1" now.
If this is not the case, the buffer has been damaged.
Please let me know the result of this test.