Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN
Hello,
I am working on TMS 570 LS1227 and want to generate 2 duty cycles in alternate fashion but it's not working
I have updated new duty cycle through 'C' code for my basic HET program.
; PWM with synchronous duty cycle update at compare match event L00 CNT { reg=A, irq=OFF, max= 100 } L01 ECMP { next=L02,en_pin_action=ON,pin=2,action=PULSELO,reg=A,data=10,hr_data=0}; L02 BR { next=L00,cond_addr=L03,event=ZERO}; after completing 1 complete PWM cycle, it will go to next instruction L03 MOV32 { next=L00,remote=L01,type=IMTOREG&REM,reg=NONE,data=80,hr_data=0};write new duty cycle 1
----------------------------------------------------------------------------------------------------------------------------------------------------------
int main(void) { /* USER CODE BEGIN (3) */ int i ,j; hetInit(); while(1) { i=20; hetRAM1->Instruction[L03].Data = i << 7; // Change the duty cycle to 20% for (j=0;j<10000;j++); //delay till - writing new duty cycle and generation 1 complete cycle i=i+40; hetRAM1->Instruction[L03].Data = i << 7; // Change the duty cycle to 60% } /* USER CODE END */ return 0; }
-----------------------------------------------------------------------------------------------------------------------------------------------------
O/P on oscilloscope -
Is it the delay causing the error ?
Regards,
Suyog