16f877a pwm code ported to 18f452 wont work pls help

Status
Not open for further replies.

babatundeawe

Full Member level 5
Joined
Apr 12, 2007
Messages
244
Helped
16
Reputation
32
Reaction score
12
Trophy points
1,298
Location
Nigeria
Visit site
Activity points
2,738
i thought i ve got hang on it until i was disapointed. i ported a pwm code from 16f877a to 18f452 and it wudnt work.

i hve tried to cahnge so many settings gone through the datasheet over and over but cant find wats wrong with the code.

someone please help.

attached is my code and circuit diagram
 

Attachments

  • hpwm.rar
    13 KB · Views: 97

What PWM duty and frequency do you want. I will write a code in mikroC. Mention your Crystal frequency.
 

oh thanks rajik but i use protonbasic. but for learning sake, just use any frequency and crystal let me see if i can port it to basic maybe i can solve my problem there.
 

oh thanks rajik but i use protonbasic. but for learning sake, just use any frequency and crystal let me see if i can port it to basic maybe i can solve my problem there.


Hi,

Some of my working 18F4520 assembly code that may help.

Also check your Config code for the correct output pin for CCP2

; CCP2 Mux bit:
; CCP2MUX = OFF CCP2 input/output is multiplexed with RB3
; CCP2MUX = ON CCP2 input/output is multiplexed with RC1

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…