PDA

View Full Version : Problem with DT Inst Interrupt + NAP



Pimentel
- 2nd May 2016, 15:22
I MADE A CONTROLLER TO SETUP A PLL OF THE MY RECEIVER AIR BAND THAT IS WORKING WELL. HOWEVER, I NEEDED USING THE COMMAND NAP TO REDUCE THE NOISE THAT PIC GENERATE AT RADIO CIRCUIT. I WAS USING TON INTERRUPT TO DETECT A KEYBOARD 4X4 THAT USING TO INSERT THE DESIRED FREQUENCY.
USING THE COMMAND NAP I GOTTA REDUCE THE PIC PROCESSING NOISE LEVELS THE ACCEPTABLE. SO I DECIDED TO USE PATTERNS DT INSTANT INTERRUPT TO IMPLEMENT A TIMER USING THE ELAPSED TIMER. BUT THE TIMER DOESN'T WORDED, AND I NEEDED REMOVING THE NAP COMMANDS TO MAKE THE TIMER WORK, BUT THEN THE PIC NOISE RETURNED ON AUDIO OF THE RADIO.
SOMEONE KNOW SAY WHAT AM I DOING WRONG?
FROM WHAT I UNDERSTAND, THE ELAPSED INTERRUPTION NOT TO WORK WITH COMMAND NAP.
ANY HELP IS COMING BEEM!

THANK YOU

PIMENTEL:confused:

HenrikOlsson
- 2nd May 2016, 18:02
Hi,

* When the NAP command executes the PIC is put to SLEEP.
* When the PIC is put to SLEEP the main oscillator stops.
* If you're clocking the timer from the main oscillator then the timer won't increment during the NAP period since the oscillator is stopped.

As I think (hope) you can see by now it has nothing to do with DT-Ints but with the way the PIC works, plain and simple.

By the way, WHY ARE YOU SHOUTING AT US?

/Henrik,

Pimentel
- 3rd May 2016, 02:43
I thank the explanation. I'm not yelling friend, just written with capital letters because it was using the translator, because I am still learning English. Looks like I will not be able to use the Elapsed routine along with the NAP command. It's a shame because without the NAP pic generates noise in the receiver circuit. Would you have any idea to help me with this?

Demon
- 3rd May 2016, 02:48
Pas de problème. :)

Can you:
- have an external clock IC,
- save the time on memory,
- put PIC to sleep,
- wake up the PIC every once in a while using a 555 timer,
- check the time elapsed since sleep?

I'm sure there are simpler ways.

Robert

HenrikOlsson
- 3rd May 2016, 06:47
I'm not sure if ElapsedTimer supports it but the way to do it, I'd think, is to use the TMR1 oscillator and drive it with an external 32.768kHz clock crystal. That oscillator doesn't stop when the PIC is put to sleep.

/Henrik.