PIC working as a switch of sorts?

Discussion in 'Embedded Systems and Microcontrollers' started by Buick455, Nov 30, 2008.

  1. Buick455

    Thread Starter New Member

    Nov 30, 2008
    3
    0
    Ok, I'm a total beginner here and I have been reading tutorials and PDF's and started learning how to program these addicting little things with GCBasic.. All and all it’s going good. I have blinked leds, turned them on and off with pushbuttons & built a Knight Rider light bar. Now I'm starting my newest project.

    What I am trying to do is add a turbo button to the arcade control panel (that connects to my PC) I built a few years back. In the beginning I used a 555 timer and extra buttons for turbo mode (button was duct taped to the panel, lol).

    Right now the way the uber trackball (like an upside-down mouse with a 3 inch ball) works is when the push button (normally open) is pressed it just completes a circuit.

    I would like to do the following:
    Add a mode button & led to another momentary arcade push button (normally open) that will blink 3times and stay on depending on the mode it’s in.

    When the turbo button is off I want the stock push button to tell the chip to complete the circuit like it does stock until released.

    When the turbo button is on I want the stock push button to tell the chip to repeatedly connect/disconnect the circuit.

    On my bread board I have built the circuit and used LEDs to see what’s going on and from what I can tell the program works fine with LEDs and pins going high and low, but for some reason it doesn’t want to work the way I had hoped when connected to my trackball.. any ideas?


    ADDED:
    ok this makes no sence to me but maybe it will make sence to one of you... i got it to work but not the right way at all... steps that made it work, lol
    1. unplug the trackball from the computer
    2. disconnect PIN_7 from the trackball
    3. plug the trackball back into the PC
    4. reconnect PIN_7 to the trackball
    BAM, it starts working!! why? I'm very confused
     
    Last edited: Dec 1, 2008
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Maybe there was a bad connection or soldering and by the vibration of the devices movement it now conducts. On the schematic you posted, Vdd is connected to ground and Vss to 5V. This should be the other way round, Vdd to 5V and Vss to ground.
     
  3. Buick455

    Thread Starter New Member

    Nov 30, 2008
    3
    0
    :eek: doh! I labeled my chip backwards, fixed it now though, thanks

    No the problem isn’t solder, its really strange though... I'll try and explain it again

    With the circuit all wired up including the output from PIN 7 and I plug in the trackball it causes the trackball buttons to not work at all.

    If I disconnect the trackball from the pc, and PIN 7 output from the chip, then plug the trackball back into the pc, then reconnect the PIN 7 it works like a champ...

    I'm beginning to think the output from PIN 7 is tossing the trackball into state of limbo on power up :confused: The circuit for the trackball isn’t any different then I guess the inside of a USB PC mouse.. The stock push button would basically be mouse button 1, that when pressed grounds the pin on its chip.
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    If you power the PIC first, plug it in the trackball and then plug the trackball in the PC (where it receives power) this may create latch up problems and thats why the circuit does not work. If this is the way you do it, dont do it again because you may destroy the trackball circuit.
     
  5. Buick455

    Thread Starter New Member

    Nov 30, 2008
    3
    0
    Ok just to make even less sense for giggles I added a 10 s delay to the beginning of my code and it works. I guess the trackball has some sort of initializing startup that was getting lost in the process of seeing a button press at startup... I don’t know I'm about to hang up my hat, lol

    Also I just wired it up stock the way it has always been and plugged in the USB while holding the button down and it stopped working, so this has got to be my only solution I guess... I will whittle down the delay till its just right I guess... Thanks though mik3, its nice to see what other ppls thoughts are before going completely nuts changing this and that :D
     
  6. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Just for general knowledge remember that is not good to apply signals to circuits which are not power by the power supply. This is because small input currents which are measured with the power on can be relatively large with the power off and destroy the device. This sounds a bit strange but sometimes it is true. Also, another problem is that if you apply signals greater than the power supply voltage in some circuits (with transistors and ICs) it can cause latch up problems (search for it in google). Thus if the power to the circuit is off and an input signal is applied then it exceeds the supply voltage and may the problem arise.
     
Loading...