disputedip.com

Micromouse - Quadrature Decoders

by Martyn on Apr.26, 2008, under Microcontrollers, Micromouse, Robots


I have started to develop the quadrature decoders for my mouse, a simple circuit and is mainly programming so its something I can do to break up exam revision.

Here is a picture of the setup:

The main board is an Explorer 16 with a 32 bit PIC microcontroller in there. I have the prototype board connected to the expansion socket and I am then connecting this to the breadboard. On here is a 16F88 and some i2c eeprom. In the back you can see the icd2 programmer.

I have written the software for the 16F88 to act as a i2c slave, and the pic32 talks to it fine and displays the response on the LCD (although took a while to get it all working). The code to decode the quadrature signals from the motors is in there but there is a small bug in the 16F88’s code which triggers a read at the wrong time. The idea is the main microcontroller sets a pin high to make a copy of the current reading and reset the counter, this helps with working out the age of the reading. If I work out what going wrong then it should not be too long before I can plug a motor in and see how it performs…

I also have my LiPo batteries, and gears and wheels for the drive. I am waiting on a pillar drill stand then I can finish making a prototype of the gearbox, and finally see if the motors I have are up to the job!


:, , , ,

2 Comments for this entry

  • Terry Bolinger

    I am working on a project with the PIC32 and want to use I2C EEPROMS. I’m struggling to get this working so did a search on the web trying to find someone who has done this. Your description of the Micromouse and Quadrature Decoders indicates that you are using the PIC32 with I2C EEPROM. Would you be willing to share a code snippet with me showing how you got the I2C EEPROM working with the PIC32? I would greatly appreciate it.

    Thanks.

    Terry Bolinger

  • Martyn

    I am afraid I no longer have that code! But luck would have it I was playing with i2c yesterday, although that code is fairly hacked and not presentable.

    I would suggest you look at

    http://www.microchip.com/forums/tm.aspx?m=66491&mpage=1&key=i2c%2cperipheral%2clibrary𐱭

    Two things to note - first is that this is for a dspic (or pic24) but should port over to the pic32 without too much trouble (function names will change, but look at the peripheral lib documentation for clues).

    Secondly this does not use interrupts, there is an app note from microchip (CE119) about using i2c with eeprom - it uses interrupts, but not directly.

    Hope that helps.

Leave a Reply

CAPTCHA image

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...