Hey,
I´ve got some trouble with the PWM12 Channel and probably need some help...
I have to to use 6 independent PWM Channels with the same compare values. The other 5 PWM(PWM2, 4, 6, 8, 10) work well but the PWM12 fools around. The Pin is steady on high level and I just get a PWM-Signal on widly differential compare values.
I´ve attached some images of the PWMs. Oben means the upper plot and unten the lower ;-) PWM6(EV-A) should be the equivalent to PWM12 on EV-B!?
I´ve already changed the device with the same result. I use the eZdsp TMS320F2812 board from Spectrum digital with a XD510LC debug interface and CCS. The Pins aren´t connected to anything else except the scope.
[URL=http://www.pic-upload.de/view-25396669/scope_1.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/f6e5rr8qvj2p.png[/IMG][/URL]
[URL=http://www.pic-upload.de/view-25396667/scope_2.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/dnosckcaqf9o.png[/IMG][/URL]
[URL=http://www.pic-upload.de/view-25396668/scope_3.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/857fy4zvpu66.png[/IMG][/URL]
[URL=http://www.pic-upload.de/view-25396671/scope_4.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/34blrolsvr9x.png[/IMG][/URL]
[URL=http://www.pic-upload.de/view-25396670/scope_5.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/t2xr46krnvwi.png[/IMG][/URL]
[URL=http://www.pic-upload.de/view-25396672/scope_6.png.html][IMG]http://www11.pic-upload.de/thumb/28.11.14/nv7tkeky9ful.png[/IMG][/URL]
Actually I tried to use the ev_pwm Code example with some edits to synchronize EV-A and EV-B.
Thank you in advance!
GpioMuxRegs.GPAMUX.all = 0x01FF; // EVA PWM 1-6 pins GpioMuxRegs.GPBMUX.all = 0x00FF; void init_eva() { // EVA Configure T1PWM, T2PWM, PWM1-PWM6 // Initalize the timers // Initalize EVA Timer1 EvaRegs.T1PR = 0xFFFF; // Timer1 period EvaRegs.T1CMPR = 0x3C00; // Timer1 compare EvaRegs.T1CNT = 0x0000; // Timer1 counter // TMODE = continuous up/down // Timer enable // Timer compare enable EvaRegs.T1CON.all = 0x1042; // Initalize EVA Timer2 EvaRegs.T2PR = 0x0FFF; // Timer2 period EvaRegs.T2CMPR = 0x3C00; // Timer2 compare EvaRegs.T2CNT = 0x0000; // Timer2 counter // TMODE = continuous up/down // Timer enable // Timer compare enable EvaRegs.T2CON.all = 0x1042; // Setup T1PWM and T2PWM // Drive T1/T2 PWM by compare logic EvaRegs.GPTCONA.bit.TCMPOE = 1; // Polarity of GP Timer 1 Compare = Active low EvaRegs.GPTCONA.bit.T1PIN = 1; // Polarity of GP Timer 2 Compare = Active high EvaRegs.GPTCONA.bit.T2PIN = 2; // Enable compare for PWM1-PWM6 EvaRegs.CMPR1 = 0x3C00; EvaRegs.CMPR2 = 0x3C00; EvaRegs.CMPR3 = 0x3C00; // Compare action control. Action that takes place // on a cmpare event // output pin 1 CMPR1 - active high // output pin 2 CMPR1 - active low // output pin 3 CMPR2 - active high // output pin 4 CMPR2 - active low // output pin 5 CMPR3 - active high // output pin 6 CMPR3 - active low EvaRegs.ACTRA.all = 0x0666; EvaRegs.DBTCONA.all = 0x0000; // Disable deadband EvaRegs.COMCONA.all = 0xA600; } void init_evb() { // EVB Configure T3PWM, T4PWM and PWM7-PWM12 // Step 1 - Initialize the Timers // Initialize EVB Timer3 // Timer3 controls T3PWM and PWM7-12 EvbRegs.T3PR = 0xFFFF; // Timer3 period EvbRegs.T3CMPR = 0x3C00; // Timer3 compare EvbRegs.T3CNT = 0x0000; // Timer3 counter // TMODE = continuous up/down // Timer enable // Timer compare enable EvbRegs.T3CON.all = 0x1042; // Initialize EVB Timer4 // Timer4 controls T4PWM EvbRegs.T4PR = 0x0FFF; // Timer4 period EvbRegs.T4CMPR = 0x3C00; // Timer4 compare EvbRegs.T4CNT = 0x0000; // Timer4 counter // TMODE = continuous up/down // Timer enable // Timer compare enable EvbRegs.T4CON.all = 0x1042; // Setup T3PWM and T4PWM // EvbRegs.COMCONB.bit.FCMP6OE = 0; // Drive T3/T4 PWM by compare logic EvbRegs.GPTCONB.bit.TCMPOE = 1; // Polarity of GP Timer 3 Compare = Active low EvbRegs.GPTCONB.bit.T3PIN = 1; // Polarity of GP Timer 4 Compare = Active high EvbRegs.GPTCONB.bit.T4PIN = 2; // Enable compare for PWM7-PWM12 EvbRegs.CMPR4 = 0x3C00; EvbRegs.CMPR5 = 0x3C00; EvbRegs.CMPR6 = 0x3C00; // Compare action control. Action that takes place // on a cmpare event // output pin 1 CMPR4 - active high // output pin 2 CMPR4 - active low // output pin 3 CMPR5 - active high // output pin 4 CMPR5 - active low // output pin 5 CMPR6 - active high // output pin 6 CMPR6 - active low EvbRegs.ACTRB.all = 0x0666; EvbRegs.DBTCONB.all = 0x0000; // Disable deadband EvbRegs.COMCONB.all = 0xA600; }