Hi,
I am using the TMS570 Microcontroller Development Stick, with a TMS570LS20216 MCU (ASPGEQQ1).
I have downloaded the example program from "NHET-AppNote_spraba0b.pdf" URL: http://www-s.ti.com/sc/techlit/spraba0.zip. This appears to be working fine, except that the frequency is slightly wrong.
The example uses the following NHET code:
L00: CNT{next = L01, reg = A, max = 624}
L01: MCMP{next = L00, reg = A, en_pin_action = ON, hr_lr=HIGH, pin = CC10, action
PULSEHI, order = REG_GE_DATA, data = 0x1D4, hr_data = 0x60}
(I am using HET pin 10, rather than 0 in the example, because this pin is available on the development stick)
The NHET clock VCLK2 is 50MHz. HR is 1, so HRP should be 20ns and LR is 8 so LRP should be 160ns.
According to the literature the number of high-resolution clock cycles in one PWM period is:
HRC_pwm = (CNT_max + 1) × lr = (624 + 1) × 8 = 5000
As the period HRP is 20ns, this should give a period of 100microseconds and the frequency should be 10,000Hz.
I am getting 10.66kHz on my scope, rather than 10kHz
If I change the max value in the program to 500, the equation above would suggest that the frequency should be 12.5kHz, but the scope shows 13.3kHz.
Any ideas what might be wrong?
Regards,
Dave