Hi, I was trying to configure the CEX3 of Atmel TSC80251G2D( 80C251). Here follows my initialization code. I dont see a PWM output. Any one has any comments? If so please help. void pca_configure() { CMOD = 0x0; /* Internal Clock */ CCAPM3 = 0x42; /* PWM ON */ CCAP3H = 128; /* Duty cycle value for 50% */ CCAP3L = 128; /* Duty cycle value for 50% */ IPL0 = 0x40; /* Make PCA interrupt the highest priority */ IPH0 = 0x40; /* Make PCA interrupt the highest priority */ CR = 1; /* Start running */ EC = 1; /* PCA interrupt enable */ EA = 1; /* /* Global interrupt enable */ } Thanks and Regards Arun
Arun, While I've never tried this myself, I know that you're generally not supposed to modify the register CCAP3L manually when you're using the PWM mode. Basically, you load the value you want into CCAP3H and then when the CL portion of the PCA counter rolls over, the hardware loads the value from CCAP3H into CCAP3L for you. What it would do if you were constantly reloading it, I'm not sure. Did you try setting the PWM to other values? Try replacing the 128 reload with 5 or 250, for example and then see how the signal changes or if anything is different.
Hi Jay, Thanks for the help. It is working now. I stopped enabling the PCA interrupt and the reloading. Thanks again Arun