Connect with us

Which IC will do this?

Discussion in 'Microcontrollers, Programming and IoT' started by BenR, Dec 12, 2012.

Scroll to continue with content
  1. BenR

    BenR

    3
    0
    Dec 12, 2012
    I need an IC which takes 3 bytes from one input but ignores the second byte and replaces it with a byte from another input. I'm pretty new to circuit design so I'm not sure if there's an IC which can do this. Basically, I have an optic mouse sensor which is constantly outputting three bytes (the first a set of booleans, the second showing the movement on the x-axis and the third showing the movement on the y-axis). I want to replace the x-axis value with a value from an accelerometer which I'm going to attach to the mouse.
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,610
    2,370
    Nov 17, 2011
    Use a small microcontroller to do this. have one port read the input data. A second port read the accelerometer data. A third port to output the remixed data stream.
     
  3. BenR

    BenR

    3
    0
    Dec 12, 2012
    Great. Thanks. But how do I make that work? Do I have to program the microcontroller? Sorry. I'm really new to making circuits.
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,610
    2,370
    Nov 17, 2011
    I'm pretty sure there is no ready-made chip or controller for your idea. Someone else might prove me wrong, though.
    You would need a small microcontroller with some additional hardware (interfaces for receiving and sending data, possibly a clock generator, power supply).
    You will have to write code for your purpose and program this code into the microcontroller.

    You will also have to take care of the correct data format for the accelerometer values so they can be interpreted by the receiving end (PC?).
    Are you aware that a mouse doesn't send absolute coordinates but relative data (delta-x, delta-y)? If you move a mouse with (more or less) constant velocity across a surface, it will send (equally more or less) constant delta-x and delta-y values.
    If you move an accelerometer with constant velocity, it will send no value at all, since constant velocity means no acceleration. You will get an output from the accelerometer only if the velocity changes (acceleration or deceleration).

    Harald
     
  5. BenR

    BenR

    3
    0
    Dec 12, 2012
    I thought an accelerometer showed how much it was leaning? I'm going to have this attached to a smartphone once I've got an OTG adapter for it. I didn't think about the mouse sending absolute coordinates. I'll have to take that into consideration too.I'm going to have to do quite a bit of research to get this working. The most complicated circuit I've ever made is a bulb connected to a battery so I'm jumping right into the deep end here.
     
  6. sirch

    sirch

    109
    1
    Dec 6, 2012
    You are correct that you can use an accelerometer to detect tilt because gravity is a form of acceleration. So if the axis of the accelerometer is vertical you will get a constant reading. As it tilts away from vertical the output will change, the value read will be proportional to the tilt.

    Assuming the output from the mouse is serial, I also wonder if you couldn't use a shift register (or 3) to do this? As a first thought I guess you could feed the mouse into 3 serial-to-parallel shift registers and then take the the parallel out from reg 1 and 3 to 2 parallel-to-serial registers and feed the accelerometer into a third. This of course doesn't take care of scaling the accelerometer to a value appropriate for whatever you are connecting the mouse to.

    That said, assuming you use 1 byte registers, that's 6 shift registers, timing circuit, scaling for the accelerometer, etc, etc. so as others have suggested using a micro-controller is probably simpler.
     
    Last edited: Dec 21, 2012
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-