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.

help with a project in pic16f877

Sara6451

New Member
You need to get a number and according to the received number output a square wave with a different timer
 

Attachments

  • מיקרופרוססורים - pic16f87x - datasheet - 342230 (3).pdf
    3.7 MB · Views: 55

danadak

Active Member
Break the problem into parts.

1) First get the number into a variable, thru GPIO port or UART or I2C or.....
2) Setup a timer to run and toggle a gpio pin to create a square wave, confirm the timer
is running and toggling the GPIO pin. Pick the clock for the timer and set that.
Timer mode setting, triggered or continuous.....
3) Scale the number you received, its range of value, to the timer period range
4) Update timer period with 3)

So you need a variable to hold number received and one for the scaled/translated number
for the timer.

Read the timer portion of manual. How it operates, what registers you need to set
to get it to run. Read that portion at least twice. Do same for GPIO pin & port control.

Decide how you will use timer to signal changing the GPIO pin, using polling or an
interrupt.

Just a few of the steps.....


Regards, Dana.
 
Last edited:

atferrari

Well-Known Member
Most Helpful Member
A rather dated micro, BTW.
 

atferrari

Well-Known Member
Most Helpful Member
Yes. After all the 741 is still used for students labs today.
 

Latest threads

New Articles From Microcontroller Tips

Top