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.

Serial input & encoding times

Status
Not open for further replies.

jakkeyboy

New Member
I am new to the world of electronics as I am in my 2nd year of my apprenticeship.
For my project I am modifying an RC car and need some help with programming. First I want to read the signal output of my encoder signal and hopefully communicate with my micro controller most likely atmega16 to switch LEDs on and off or typically I could do this on my reciever end. The encoder signal has a start code of 500Hz 75% duty cycle then followed by 1kHz 50% duty cycle.

Code format.jpg

The second part of the signal has the number of function codes (n) W1
4 - End code
10 - Forward (pulse)
16 - Forward (high lvl)
22 - Turbo
28 - Forward (high lvl) & Left
ect ect.

What would be the best way to read and transpose into my program?

Thanks in advance.
 
If you use the +ve edge to trigger an interrupt or timer you can count the time between edges to get your 500Hz. You then need to count the edges or the start period. Once that is completed a 500us clock will allow you to sample the data.
 
Status
Not open for further replies.

Latest threads

Back
Top