shsn
Junior Member level 3
- Joined
- Nov 28, 2012
- Messages
- 26
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,523
Hello,
I have been working on a design that drives 8 individual LEDs driven by a PIC16F716. The design works by converting an incoming voltage that varies from 0 to 5V using ADC and depending on this analogue voltage input I have programmed it to turn on X LED(s). For instance, at 4.5V 6 out of 8 LEDs are turned on. Although it works well the response is not so good considering it will be used in time-critical environment (measuring engine RPM speed) -- I did more reading and came up with two alternative ways to re-design the current design.
1. Use Interrupts.
The current design's program uses 'Polling' method with a bunch of IF statements that has following routine:
- Check the converted ADC value
- Go through IF statement for matching ADC value
- Turn LED(s) on
So if I am not mistaken I can take 'turn LED(s) on' part outside the main routine to interrupt, this way it will not 'turn on LED(s)' unless it detects changes in ADC value.
2. Use MAX7221 driver using Serial interface
I am not too sure about this but the ability to drive 64 individual LEDs might come in handy. But the question I want to ask with this method is, will the LEDs have more faster response time than simply using 16F877A with interrupts?
Thank you.
I have been working on a design that drives 8 individual LEDs driven by a PIC16F716. The design works by converting an incoming voltage that varies from 0 to 5V using ADC and depending on this analogue voltage input I have programmed it to turn on X LED(s). For instance, at 4.5V 6 out of 8 LEDs are turned on. Although it works well the response is not so good considering it will be used in time-critical environment (measuring engine RPM speed) -- I did more reading and came up with two alternative ways to re-design the current design.
1. Use Interrupts.
The current design's program uses 'Polling' method with a bunch of IF statements that has following routine:
- Check the converted ADC value
- Go through IF statement for matching ADC value
- Turn LED(s) on
So if I am not mistaken I can take 'turn LED(s) on' part outside the main routine to interrupt, this way it will not 'turn on LED(s)' unless it detects changes in ADC value.
2. Use MAX7221 driver using Serial interface
I am not too sure about this but the ability to drive 64 individual LEDs might come in handy. But the question I want to ask with this method is, will the LEDs have more faster response time than simply using 16F877A with interrupts?
Thank you.