Hello, Can anybody tell me how could i modify the duty cycle of CC60 while my aplication is running? I tried modifing Shadow Register (CCU6_CC60SR) but it doesn't work well. Thanks.
I have also tried stopping and starting T12, but it doesn't work either :(
CCU6_TCTR4 = 0x0001; // Stop timer CCU6_CC60SR = 0x040C; // Update Duty Cycle CCU6_TCTR4 = 0x0002; // Start timer
It's not necessary to stop the timer, but you have to invoke a shadow register transfer with
CCU6_TCTR4 |= 0x0040;
Hello Arne, I have tried with
CC6_vInit();/*Initialize CC6 with 50% duty cycle*/ CCU6_TCTR4 |= 0x0040; CCU6_CC60SR = 0x040C; /*25% duty cycle*/
but nothing :(. It doesn't change to 25% dc.
Of course you have to invoke the shadow register transfer *after* writing the new value to the shadow register i.e.
CCU60_CC60SR = 0x040C; /*25% duty cycle*/ CCU60_TCTR4 |= 0x0040;
Ok Arne. In this way it works. In the other hand, I would like to prove diferents duty cycles, specifically 100. For so, I am using uLink2 simulator as you can see in this image: img233.imagevenue.com/img.php Nevertheless, when i simulate it, doesn't obey me. Could be a simulate error? Thanks
Hello John,
Sorry, but I cannot see where the problem in you simulator is. I'm not used to the simulator, but it seems all correct to me. As fas as I can see, the setting of CC60SR has been correctly transferred to CC60R. That STE12 is not set any more is OK, since STE12 is automatically reset after a successful shadow register transfer.