Author Topic: Arduino Mega PS2, don't work after power on off  (Read 856 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Arduino Mega PS2, don't work after power on off
« on: November 09, 2018, 10:44:08 am »
1.  I am using arduino mega 2560. A PS2 keyboard is connected to read keys & display on segment. Library used is PS2Keyboard.cpp - PS2Keyboard library Written by Christian Weichel <info@32leaves.net>

2. Issue faced is, when power in turned off & applied again on entire system(MCU+PS2 converter+usb keyboard), keyboard don't get initialized again automatically, that is I am not able to read any keys unless I remove the keyboard from socket & connect again, then I can read again.

3. There is small USb to PS2 converter used. Keyboard is usb.

4. what could be issue.

5. below is keyboard code:

const int DataPin = 19;
const int IRQpin =  18;
PS2Keyboard keyboard;


    keyboard.begin(DataPin, IRQpin); 
    keyboard.clear();
            c = keyboard.read();
            Serial.println(c);   
 

Offline brybot

  • Contributor
  • Posts: 20
  • Country: us
Re: Arduino Mega PS2, don't work after power on off
« Reply #1 on: November 09, 2018, 06:40:43 pm »
Are you able to get a scope trace on your data lines?

There is a #define option for INPUT_PULLUP, and the documentation mentions that PS2 keybaords contain pullup resistors. I wonder what your adapter is doing, and whether the pullups or lackthereof could be messing up the initialization. Especially if the pullup is latching up the processor through the GPIO.

https://www.pjrc.com/teensy/td_libs_PS2Keyboard.html

 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Arduino Mega PS2, don't work after power on off
« Reply #2 on: November 10, 2018, 05:24:28 am »
Hi,

rest of code works fine no issues in that.
Only ps2 keboard dont work.

I have tried both methods, pull up enable or diable in code, but both didnt worked.

Also why keyboard worked when i remove it & connect it again from usb porint., while converter remians connected, i dont understand this
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf