Push button C program required

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Push button C program required

2,590 Views
spursrn01
Contributor I
It is required to connect 4 push buttons to a 89c668 microcontroller.

When a key is pressed an interrupt is generated to read the key pressed.

The program should include

1. a 'debounce function' for mechanical bounce of the switches.

2. An interrupt service routine for the function

'void EX0_readKeyP(void)interrupt 0 {...}'

3. A 'main function' to set up the interrupt and place the key read into port 2 of the microcontroller.

Please help.

Many Thanks.
Labels (1)
0 Kudos
Reply
2 Replies

855 Views
rocco
Senior Contributor II
Hi, Spursrn01:

I don't think that you will find any 8051-compatible code on the Freescale forums, even if it is C code, since none of their microcontrollers are 8051-compatible. Button routines and interrupt service routines are going to be awfully hardware-specific.

You might try here:

http://www.8052.com/forum/
0 Kudos
Reply

855 Views
peg
Senior Contributor IV

Hi,

Sounds a bit like a school project, so you would probably want to learn then as well.

The subject is discussed here:

http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=1984

http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=1811

Regards David

 

0 Kudos
Reply