View previous topic :: View next topic |
Author |
Message |
Requan
Joined: 11 May 2008 Posts: 74
|
PIC 18F67j60 and PWM |
Posted: Tue Jul 03, 2012 6:57 am |
|
|
Hi,
I tried to make PWM on Pin E4 (PIC 18F67j60 , 25MHz):
Code: |
set_tris_e(0x00);
setup_ccp3(CCP_PWM);
setup_timer_2(T2_DIV_BY_16, 194, 1); //2kHz
set_pwm3_duty(80);
|
I think i made everything but it doesn't work.
Do you have any hints for me? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Tue Jul 03, 2012 7:23 am |
|
|
CCP3, in compatiblity mode, on a 67J60, comes out on D1.
Best Wishes |
|
|
Requan
Joined: 11 May 2008 Posts: 74
|
|
Posted: Wed Jul 04, 2012 9:33 am |
|
|
Thanks for help again.
Could You also explain me why when i use hardware pin for I2C it worked but when i use pins: E2 and E3 it doesn't work.
Should I turn off something? |
|
|
Requan
Joined: 11 May 2008 Posts: 74
|
|
Posted: Thu Jul 12, 2012 2:18 am |
|
|
I solved this problem:
On the beginning i put SDA and SCL in High state. |
|
|
|