ps2 function not working

General discussion on mikroC.
Post Reply
Author
Message
Aoday
Posts: 86
Joined: 07 Mar 2005 13:45

ps2 function not working

#1 Post by Aoday » 17 May 2005 07:06

I tried to execute the example for the ps2 and there is no response any one tried that

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

Re: ps2 function not working

#2 Post by pizon » 17 May 2005 13:13

The example works here. Be sure to:
  • - Have the right crystal, or recompile for the one you have. The example for PIC18's is built for the 20 MHz crystal, and for PIC16's for 16MHz. The crystal must be 6 MHz or higher.
    - Have the right pinout (as written in Help).
    - Pull-up PORTD (this should have been written in example comment, but I have somehow ommitted it - will correct it for the next version :oops:)
pizon

Aoday
Posts: 86
Joined: 07 Mar 2005 13:45

#3 Post by Aoday » 17 May 2005 13:47

the pinout as u explaine it in the example and I used 16.5 Mhz on PORTA with pull up port a on PIC 16f872, 16f877 and I used PORTD also

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

#4 Post by pizon » 18 May 2005 11:02

Just tried the PS/2 on 16F628, 10MHz, works OK. I used PORTA (F1, F0) for PS/2 and PORTB for UART. I just couldn't get USART working on 9600 (I guess I was too lazy to consult the datasheet :roll:), so I used 2400 baud and it works.
pizon

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

#5 Post by pizon » 19 May 2005 09:33

One more thing: Since PS/2 uses only 2 pins, it's a good candidate for "crippled" ports, such as PORTE on P16F877A and P18F452. If you do this, be sure to initialize the port properly, as digital I/O. In the abovementioned case, it means

Code: Select all

ADCON = 7;
pizon

Post Reply

Return to “mikroC General”