Software PWM for DT_INTS-xx
Ok Willem,
Well, I decided to forget about the things I should have done this weekend, and went ahead and re-wrote the SPWM program to work with the Instant Interrupt system.
I've added a few things, and it works a little different this time around. So, be sure to look close at the example.
It'll work with either the 18F or 14-bit versions, even though I only put it in the DT_INTS-14 section for now.
SPWM_INT
http://www.darreltaylor.com/DT_INTS-14/SPWM.html
Enjoy,
Software PWM for DT_INTS-xx
Dear Darrel,
I just would like to let you know the combined DT_INTS-14 and SPWM_INT working fine!!
I control 5 Hi power LED’s Using 5 PWM signals (100Herz, 200 step), LED selecting is done by 3 address lines and the actual control by a pulsed STEP and a UP/DOWN level input.
STEP is causing the INT external interrupt doing the actual PWM change (controlling DutyVar1 to DutyVar5)
Whenever I change a PWM value, it’s stored as the new default in EEprom (using WRITE command with DISABLE INTERRUPT before and ENABLE INTERRUPT after, working OK too).
If you like to have more info on both hardware and software, let me know.
Thank you for your help!
Regards,
Willem
Moon or mood.... that's the question
http://www.mister-e.org/Pics/DOH.jpg
Well maybe i should say MOOD?
Your Canadian to English dictionnary is still good :D
Enjoy!
Can nested gosubs be used from within PBP instant Interrupt
Hi,
I need to call a subroutine from within a low priority PBP instant interrupt on a PIC 18F452. I am using both High Priority and Low Priority Interrupts.
I need to know whether PBP uses a software stack for its gosub calls or use the PIC18 stack pointer. I am concerned if calling a nested gosub from within a PBP InstInt would cause stack overflow.
AD_INT does not work that way
Hi,
Quote:
an interrupt whenever the voltage on my analog input pin changes
The ADC takes a finite time to complete its conversion. When the conversion is complete the AD_INT flag is set. This means that you should always start your conversion manually. However your PIC16F88 has a compare module. That can automatically setup periodic conversion of your AD module. So you would be getting interrupts from the AD_INT that a new value is available. Just read the AD results and compare it with the previous one to find out if your pot has been changed. Please note do not expect two consecutive conversions to be exactly equal even if you are not touching the pot. Supply, layout, noise, blah, blah...... . So compare it for a change of value within a range.