Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16f628 PWM pin, winpicprog, and simulator

Status
Not open for further replies.

max_imum2000

New Member
hello
i am trying to output pwm signal from 16f628 pic.
i tried many already made program from the net to do so
and i am using oshonsoft IDE simulator.
i am just seeing changes on TMR2 only
i cant seem to see any pin that has any activity
why is that ?
can anyone just send me a simple hex file (along with asm or basic program please) to output PWM to portA or portB ??
just as an example

i tried the progam in winpicprog but my assemble cant convert it to hex file and giving me many errors.

please help
i will appricate more in depth tutorial on the subject if possible

thank you
 
Are you looking at the correct pin? On the '628A the PWM output is on RB3/CCP1 (pin 9)...

Good luck... Regards, Mike
 
actually i am looking at all the pins at the same time
i even compiled the program in winpicprog tutorial using mplab
same thing , all the activity is on tmr2

what am i missing,
i know i should see any activity on rb3 but there arent any
 
Ok, I've got a small example assembly program for a '628A with a 20-MHz xtal oscillator...

Which PIC are you running, the '628 or '628A? What oscillator are you running? Are you only simulating this (no actual hardware to test)?

Regards, Mike
 
Then I wonder if the Simulator simply isn't showing the PWM output on the RB3/CCP1 pin? Or, perhaps you're not setting up a Project correctly with the ASM code examples? Lots of variables there...

Anyway, here's a rude-n-crude circuit and code example... The RC Integrator / Filter allows you to measure a voltage at the R3/C3 junction that corresponds to the PWM setting... Adjust the PWM setting up or down using the '>' and '<' keys in Hyperterminal...

Good luck... Have fun... Kind regards, Mike
 

Attachments

  • pwm_16f628a_test_circuit.jpg
    pwm_16f628a_test_circuit.jpg
    51.5 KB · Views: 1,124
  • 16f628a_pwm_01.txt
    6.2 KB · Views: 350
well i think you r correct, maybe the simulator just not showing the pwm
output
i have to physically test the circuit i guess

thankt for your help
 
Status
Not open for further replies.

Latest threads

Back
Top