This page might explain it.
http://darreltaylor.com/DT_INTS-14/kudos.html
Especially the last paragraph.
<br>
This page might explain it.
http://darreltaylor.com/DT_INTS-14/kudos.html
Especially the last paragraph.
<br>
DT
So Darrel if i made this with just an ASM interrupt i would be able to get my 125uS since i wouldnt need the Reenter Context Saving...
BUT please o please can you help me?..
I use to get to this point where: i dont know any assembler!!!
even worst
A bit Array of 120 samples in Assembler .... mmm..... mmmmm....
By the way would you consider (in my case) the pauseus 125 Take Sample option?
Please some lead to solve this matter.
Thanks again
DJC
>> So Darrel if i made this with just an ASM interrupt i would be able to get my 125uS since i wouldnt need the Reenter Context Saving...
Correct.
>> A bit Array of 120 samples in Assembler .... mmm..... mmmmm....
In ASM, you would just shift the bits into a byte var. After 8 bit's move to the next byte. After 15 bytes you're done.
>> By the way would you consider (in my case) the pauseus 125 Take Sample option?
YES!
Your program just sits in a loop anyways, waiting for the sample to finish.
No need to use interrupts, if it's not doing anything in the first place.
Or, you can still use the timer. Just poll the TMR2IF Flag.
<br>
DT
I will keep working on the interrupt option... This is supposed to detect DTMF (we talk about it before) so for it to work in the background of anything else is the best choice.
Everything is so complicated in ASM!.. thanks god there is picbasic.
Here's a quick untested stab at an ASM handler.
Change the Handler type to ASM
Code:Samples VAR BYTE[15] BANK0 SYSTEM SamplePTR VAR BYTE BANK0 SYSTEM SamplesAddr CON EXT @SamplesAddr = Samples BitCount VAR BYTE BANK0 SYSTEM ByteCount VAR BYTE BANK0 SYSTEM FlagSample VAR BIT TMR2ON VAR T2CON.2 ;----[Start getting the 120 samples]------------------------------------------ GetSamples: FlagSample = 0 SamplePTR = SamplesAddr ByteCount = 15 BitCount = 8 PR2 = 125 : TMR2 = 0 : TMR2ON = 1 return ;----[TMR2 Handler]----------------------------------------------------------- ASM Sample MOVE?BB SamplePTR, FSR ; Load FSR with pointer to array MOVE?TT CMCON,7, STATUS,C ; Put sample in carry flag rrf INDF, F ; Shift in the sample bit decfsz BitCount, F ; Are all 8 bits in ? goto Int_Done ; NO, done for now MOVE?CB 8, BitCount ; Yes, reset bitcount incf SamplePTR, F ; Point to next byte decfsz ByteCount, F ; Are all 15 bytes done ? goto Int_Done ; NO, done for now MOVE?CT 1, _FlagSample ; Yes, Indicate - Samples Complete MOVE?CT 0, _TMR2ON ; stop the timer Int_Done INT_RETURN ENDASM
DT
Your wish to help is INFITE and appreciated Darrel.
Thanks Again
Last edited by Josuetas; - 5th October 2007 at 16:32.
Ha!
You are using ....
LCD_AnyPin
Instant Interrupts
Elapsed Timer
and you showed your "Colors" when posting.
How could I possibly Not Help??
<br>
DT
Bookmarks