noxus
Joined: 16 Nov 2009 Posts: 6
|
Problem generating PWM signals with PIC18F46J11 |
Posted: Wed Nov 18, 2009 9:02 am |
|
|
Hello All,
I'm currently trying to generate PWM signals from my PIC18F46J11 processor. I had to install the latest version of the compiler (4.099) since previous versions didn't support this processor type.
I'm using the following code sequence to generate the PWM signals:
Code: |
#include <18F46J11.h>
#FUSES NOWDT
#FUSES HS
#use delay(clock=8000000)
void main()
{
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_16,249,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
setup_timer_4(T4_DISABLED,0,1);
setup_ccp1(CCP_PWM);
set_pwm1_duty(972);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
while(1);
}
|
The code compiles fine but I do not see the signals on my scope!
Also, it is not clear to me on which pins I should see the signals. I've never worked before with a microcontroller with Peripheral Pin Select possibilities. I couldn't find a function inside the CCS compiler help file that shows me how to control the Peripheral Pin Select.
Any ideas/suggestions maybe?
Thanks... |
|