I cannot read data from sci-tx port(Serial communication)
Show older comments
I have a simulink model for a power electronics project and i want to see detailed data using SCI-TX port in simulink. For this, i have created 2 codes, one is for code generation and the other one is for watching the data. Both of the codes work without a problem in LAUNCHXL-F280025C. The default pins are GPIO28 and GPIO29 for TX and RX, and when i want to change these pins, using the hardware switch at the launchpad also creates no problem and i am able to also use GPIO16 and GPIO17 pins. Hovewer, using the TMS320F280025CPNSR (this processor is used in my project card), i cannot get the data interface to work in any ways. The pins are selected as GPIO16 and GPIO17 in project card. In summary, with the launchpad, i am able to see the data on sci pins, but the same codes do not work for the control card (i change the build configurations to TI F28002x.) I have tried lots of methods, i tried GPIO2 and GPIO3 pins instead, didnt work. I even tried to change the value for OUTPUTXBAR7 to SCI-TX(6) but this didnt work either. Even this simple code where i read adc values and send it to serial pin does not send any data to my SCI-TX pin.(The codes themselves work but i do not see any data in model.) The only difference is that the FTDI we use is XDS100, but i have seen this card being used without any problem in other projects ( for example 49c.) The pins do not have a physical connection problem, as we tested them with a multimeter. I ran the sample sci code and my normal code on controlcard. The signals without noise came from controlcard, and i was able to see these signals using the TX pin on hardware.(GPIO16) Hovewer, it seems that the data is not being sent to pc, as i was not able to see any data in my interface model and putty application. The signal with noise comes from launchpad, but i am able to correctly read the data from my interface model. I dont have any ideas left, any suggestions?
1 Comment
Bhanu Prakash
on 12 Jul 2024
Hi Hasret,
Found a similar issue in an MATLAB Answer which could probably give you more insights on the issue:
Answers (1)
Mukul Choudhury
2 minutes ago
0 votes
Hi Hasret,
Your description points at a routing problem on the controlCARD, not a code problem — the SCI peripheral is clearly working since you see traffic on GPIO16 with a scope. Here are the most likely culprits, in order:
1. controlCARD FTDI is wired to GPIO28/29, not GPIO16/17 (most likely)
The LAUNCHXL-F280025C has a physical switch that swaps the XDS100 UART bridge between GPIO28/29 and GPIO16/17. The TMDSCNCD280025C controlCARD does not have that swap — its onboard XDS100 UART lines are hard-wired to the SCI-A default pins (GPIO28/29 on the F280025C pinout brought out to the DIMM edge). So when you move the Simulink SCI to GPIO16/17, the signal comes out on that pin (which is why your multimeter/scope sees it), but it never reaches the FTDI, and nothing arrives at PuTTY.
Fix: In your Simulink Hardware Board settings, set the SCI-A pins back to GPIO28 (TX) / GPIO29 (RX) for the controlCARD build. If your project card breaks GPIO28/29 out to a header, that's the path to use; if it doesn't, you'll need to physically wire from the DIMM's GPIO16/17 to the controlCARD's XDS100 UART pins on the docking station.
2. controlCARD isolation / UART enable switch
The TMDSCNCD280025C docking station has switches/jumpers to enable the isolated UART path to the XDS100. Check the docking station user guide (SPRUIV6 or similar) — one of the DIP switches typically enables the UART-to-USB bridge. If it's off, GPIO28/29 traffic is generated but blocked before the FTDI.
S1:A Position 1: JTAG ENable- this should be on which connects the XDS100v2 emulation logic and the MCU
S1:A Position 2: ISO UART communication enable - this should be on - The C2000 MCU’s GPIO-28 (and pin 76 of the 180-pin controlCARD connector) will be coupled to the FTDI’s USB-to-Serial adapter
3. Clock source mismatch → wrong baud rate
Check for the clock source. If internal clock source does not work, try with the external clock.
Check: In Configuration parameters -> Hardware Implementation → Target hardware resources -> Clocking, confirm the oscillator selection matches the controlCARD (external XTAL). Also verify the bit-time on your scope against 1/baud.
Diagnostic order
1. Move SCI back to GPIO28/29, rebuild, and try PuTTY on the controlCARD — this alone likely solves it.
2. If still silent, scope GPIO28 during a transmit — is the signal there?
3. If yes, check the dock's UART-enable switch.
4. If baud looks wrong, fix clock config.
Hope this helps.
Thanks,
Mukul
Categories
Find more on C2000 Microcontroller Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!