Hostside of C2000 SCI Communication is not in real time!
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm using a TI C2000 F28027 Microcontroller with the TI HVMTR Board. At the moment, I'm only using the DC/DC Converter and I'm sending a Duty Cycle through SCI to set the PWM Duty Cycle and am receiving ADC Values to measure the High Side Voltage.
My problem is, that the host model does not run in real time! The host model at the moment consists of a constant that is feeding the SCI Transmit Block. The SCI Receive feeds the ADC Value to a Convert Block and then to a fcn() block where the High Side Voltage is calculated from the ADC Value. The SCI Setup is:
- Communication Mode: Raw Data
- Baud rate: 115200
- Number of stop bits: 1
- Parity mode: none
- Timeout: 1.0
On the Hardware, the Model consists of a SCI Receive which feeds the Duty Cylce to the ePWM Block. There are 8 ADC Blocks so I can calculate the average value of 8 ADC conversions for more accurate measurements, so the Values are added and then divided by 8. This value is then feed through a Rate Transition Block to a SCI Transmit. The SCI Parameters are:
- Suspension mode: Free_run
- Number of stop bits: 1
- Parity mode: none
- Character length bits: 8
- Desired baud rate in bits/sec: 117188
- Baud rate prescaler (BRR = (SCIHBAUD << 8) | SCILBAUD)): 15
- Closest achievable baud rate (LSPCLK/(BRR+1)/8) in bits/sec: 117188
- Communication mode: Raw_data
- Data byte order: Little_Endian
- Data swap width: 8_bits
- Pin assignment(Tx): GPIO29
- Pin assignment(Rx): GPIO28
I'm using Matlab 2013b and CCS v6.1. For Code Generation I'm using idelink_ert.tlc and the ccsv5 Toolchain pointing to the ccsv6.1 files. Code Generation is working fine and the Program is working on the Hardware as intended. But I don't recieve the measuremnts in real time. In about one second real time, the model time is only increasing by around 0.1 seconds.
I have tried several approches to solve the issue as I have tried using Protocoll instead of Raw_data, only unsing one ADC to shorten conversion time, load the Program into flash instead of RAM, loading into flash but running from RAM,... but nothing solved the Problem.
Here some more Informations to the models:
- Sample time ADC: 0.001
- Sample time SCI on Hardware: 0.1
- Sample time SCI on Host: 0.01
- Rate Transition on hardware: 0.005
I also looked at some Matlab examples, especially the Motor Control with TI Launchpad as it uses the same Processor, to compare the Setup, but I didn't find a difference. Can somebody help me to find a way to get the data in real time? If you need more Informations please tell me which you need.
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!