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.
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.
Yes, but still runs pretty well identical machine code to many current ones - and presumably it's chosen because that's what's used on the course he's doing? - it seems an obvious homework question?.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.