ZERS
New Member
Hi,
I'm designing a controller board for a CD PLAYER.
The controller is based around a PIC18F452.
I'm wondering whether I need to use interrupts or not.
To sum up, while playing (or not), the PIC could received instructions from a RC5 remote control or a switch board (buttons PLAY, STOP, SKIP FWD, ...)
Do I need to use interrupts to check whether a switch or a RC5 code is received by the PIC ?
Or do I include two Functions in the main loop that checks every 20ms if some RC5 code is reveived or some button is pressed.
I'm developping the code ic C.
Could be something like this
thanks for your help
Regards
I'm designing a controller board for a CD PLAYER.
The controller is based around a PIC18F452.
I'm wondering whether I need to use interrupts or not.
To sum up, while playing (or not), the PIC could received instructions from a RC5 remote control or a switch board (buttons PLAY, STOP, SKIP FWD, ...)
Do I need to use interrupts to check whether a switch or a RC5 code is received by the PIC ?
Or do I include two Functions in the main loop that checks every 20ms if some RC5 code is reveived or some button is pressed.
I'm developping the code ic C.
Could be something like this
Code:
void main(void)
{
InitializeControler();
while(1)
{
detectButtons(); //detect if a buttons is pressed
detectIRCode(); //detect if a RC5 code is recevied
waitFor(20); //delay of 20ms
}
}
Regards