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

Status
Not open for further replies.

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: 242
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:
A rather dated micro, BTW.
 
Yes. After all the 741 is still used for students labs today.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top