Instant Interrupts - Revisited - Page 7


Closed Thread
Page 7 of 20 FirstFirst ... 3456789101117 ... LastLast
Results 241 to 280 of 773
  1. #241
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Darrel

    I'm playing with PbP Interrupts ( a Lawn tractor computer: Total run Time, Split time, RPM, max RPM, Air and Oil Temp and Oil press ... AND a maintenance reminder)

    ... AND ...

    I did not see an INT_DISABLE GLOBAL and INT_ENABLE GLOBAL Macros ... just for the compatibility with the others "interrupt control" macros ...

    Of course just to set "THE" INTCON.7 bit ... ( case is i.e.... using the asm "sleep" instruction !!! )

    No, no thats not to be called lazyness ...

    Nice playing ground ... Thank you once more !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #242
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    You are absolutely correct.
    To keep everything consistant, there should be a GLOBAL for the INT_ENABLE/DISABLE.

    I will include that in the next version, which should be available very soon.

    Thanks for the idea's.
    Wish I received more of them.
    <br>
    DT

  3. #243
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Thank you Darrel,

    That's nice from you.

    By the way ... I also modified "a bit" your Elapsed Timer to get only HHHH:MM:SS, using The Timer 1 Clock with a 32.768 Khz Xtal.

    That gives more computing time for other tasks ... especially other interrupts.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #244
    Join Date
    Jun 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    I downloaded your Instant Interrupts files and I am having trouble compiling them. I am using MPASM assembler with PBP. I take your 3 files and try to compiler them straight from what I downloaded.

    On the DT_INTS-14.bas I get the following:

    Error [113] c:\pbp\pbppic14.lib 1141: Symbol not previously defined (INT_ENTRY)

    On the ReEnterPBP.bas I get the following:

    Warning [207] c:\pbp\reenterpbp.asm 217: Found label after column 1 (INT_RETURN)

    Warning [207] c:\pbp\reenterpbp.asm 313: Found label after column 1 (INT_RETURN)

    Error [116] c:\pbp\reenterpbp.asm 313 : Address label duplicated or different in second pass (INT_RETURN)

    The Elapsed_INT.bas compiles without any errors but gives me the following warning:

    Warning [207] c:\pbp\elapsed_INT.asm 237: Found Label after column 1 INT_RETURN


    Do you have any ideas what might be wrong?

  5. #245
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    What do you have in the main program?

    Error [113] c:\pbp\pbppic14.lib 1141: Symbol not previously defined (INT_ENTRY)
    Usually means there isn't an INT_LIST macro.

    The files won't compile without it.
    DT

  6. #246
    Join Date
    Jun 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    As of yet I have not put your code into my main program. I was just trying to compile each on their own. If I understand you correctly, your code needs to be put of another program or it will not compile. Is that correct?

  7. #247
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    That's correct!
    DT

  8. #248
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Alain,

    Well, you may have noticed I didn't get the "GLOBAL" for INT_ENABLE/DISABLE put in the last version of DT_INTS-18.
    It turns out that GLOBAL is a reserved word for MPASM. It's used with relocatable code.

    I could have used GLBL or GLBAL I suppose, but somehow

    @ INT_DISABLE GLBL

    Seems even more cryptic than

    GIE = 0

    I still think it should be in there, as should PERIPHERAL, HIPRIORITY and LOWPRIORITY.

    But I'm not sure what the best way is, AKA less confusing.

    Any thoughts?
    <br>
    DT

  9. #249
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Alain,

    Well, you may have noticed I didn't get the "GLOBAL" for INT_ENABLE/DISABLE put in the last version of DT_INTS-18.
    It turns out that GLOBAL is a reserved word for MPASM. It's used with relocatable code.

    I could have used GLBL or GLBAL I suppose, but somehow

    @ INT_DISABLE GLBL

    Seems even more cryptic than

    GIE = 0

    I still think it should be in there, as should PERIPHERAL, HIPRIORITY and LOWPRIORITY.

    But I'm not sure what the best way is, AKA less confusing.

    Any thoughts?
    <br>

    Hi, Darrel

    What about

    @ G_INT_DISABLE and @ G_INT_ENABLE ??? ... would be simple enough. ... and it's just "ordinary" macros !!!

    Remember the goal was only to use something simple to remind ( in other words: to use for datasheet non-lovers !!! )

    To me, GIE = 0 is also the simpler ... But, as you've seen, nowadays nobody dares to read the datasheets !!!




    The Tractor computer soft is just finished (!)... I had some precedence headaches ( particularly with // !!! ), and it was really difficult to see what was wrong ...

    despite result was good for setting a flag, operation was wrong !!! ... and was no way to cancel that flag ...

    Now, I must translate my comments to English ...

    Regards
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  10. #250
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default Button and Instant interrupts

    Hello Darrel !

    I´m using your Instat interrupts to work with TIMER1, TIMER2 and CCP1 with a 16F877 @ 4Mhz, like this :

    ASM
    ;T0IF = TMR0IF
    ;T0IE = TMR0IE
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler CCP1_INT, _Capture, PBP, yes
    INT_Handler TMR1_INT, _Timer1, PBP, yes
    INT_Handler TMR2_INT, _tick, PBP, yes
    endm
    INT_CREATE ; Cria a interrupção
    ENDASM

    Everything is working very, very well.

    I´m doing a On-board computer for my small Opel Corsa, and this interrupts are just great !
    Me and Sirvo (remember him ?) are doing almost the same on-board computer.

    But now, I would like to implement 4 Buttons to my application (Start, Stop, Pause, Funcition Keys).

    I´m trying to do that with the button statement without success / good results.

    I read your sample (hello word for instant interrupts) but the INT_INT read just the RB0/INT right ?

    Is that possible to use the Instant Interrupts to create/read, let´s say, 4 different buttons on PORTC ?

    Tahank You very much !

    bye


    Sérgio Pinheiro

  11. #251
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Is that possible to use the Instant Interrupts to create/read, let´s say, 4 different buttons on PORTC ?
    Yes, that's possible. But it would be a lot easier if you used RBC_INT "Port B change interrupts". It uses PORTB.4 thru PORTB.7

    But if those pins aren't available, you could do something like this, which uses only 1 interrupt (INT_INT on Falling Edge), then the interrupt handler can read PORTC to figure out which one was pressed.


    <br>
    DT

  12. #252
    Join Date
    Nov 2003
    Location
    Sao Paulo - Brazil
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel

    Thank you very Much !

    I think this could help me a Lot !

    I´m already using some portb pins and this solution will help a lot !

    Thank you again !

    Sérgio

  13. #253
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default Instant Interrupts and Internal Comparators

    Hi Darrel,

    I have been using your wonderful instant interrupts routine, i have experienced a hiccup and cannot work out what I am doing wrong.

    I wonder anybody may be able to help direct me to a solution.

    I am using a 18F4520 with 2.5 and masm401. I have checked that I have your latest version which I beleive to be 3.2 (dated 28/8/07).

    when I compile the following code:

    define OSC 16
    INCLUDE "DT_INTS-18.bas"
    INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler CMP1_INT, _HopOut, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM

    TRISA = %00111111'
    TRISD = %00000000
    Z var bit
    x var byte
    CMCON = %00000010
    @ INT_ENABLE CMP1_INT
    Start:
    PORTD.4 = 0
    z = 0
    Waiting:
    if z = 0 then waiting

    for x = 1 to 20
    pause 50
    toggle PORTD.4
    next x
    goto start

    HopOut:
    z = 1
    @ INT_RETURN

    end


    I recieve the following complie errors



    Error[128]........: Missing argument(s)
    Error[113]........: Symbol not previously defined(IntFlagReg)
    Error[113]........: Symbol not previously defined(IntFlagBit)
    Error[113]........: Symbol not previously defined(IntFlagReg)
    Error[113]........: Symbol not previously defined(IntFlagBit)
    Error[101]........: ERRORInterrupt Source(IntFlagReg,IntFlagBit)not found)
    Error[128]........: Missing argument(s)
    Error[101]........: ERRORINT_ENABLE -Interupt Source not Found!)


    If I change the CMP1 to CMP2 I receive errors

    If I change the CMP1 to CMP then it compiles okay.

    Any thoughts... should I be looking to set the registers manually maybe? I was planning to use both comparators independantly.

    Thanks

  14. #254
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Post

    Hi,

    No surprise if you read the interrupt sources list

    #define INT_INT INTCON,INT0IF ;-- INT External Interrupt, 16F compatible
    #define INT0_INT INTCON,INT0IF ;-- INT0 External Interrupt
    #define INT1_INT INTCON3,INT1IF ;-- INT1 External Interrupt
    #define INT2_INT INTCON3,INT2IF ;-- INT2 External Interrupt
    #define INT3_INT INTCON3,INT3IF ;-- INT3 External Interrupt
    #define RBC_INT INTCON,RBIF ;-- RB Port Change Interrupt
    #define TMR0_INT INTCON,TMR0IF ;-- TMR0 Overflow Interrupt 18F
    #define TMR1_INT PIR1,TMR1IF ;-- TMR1 Overflow Interrupt
    #define TMR2_INT PIR1,TMR2IF ;-- TMR2 to PR2 Match Interrupt
    #define TMR3_INT PIR2,TMR3IF ;-- TMR3 Overflow Interrupt
    #define TMR4_INT PIR3,TMR4IF ;-- TMR4 Overflow Interrupt
    #define TX_INT PIR1,TXIF ;-- USART Transmit Interrupt
    #define TX1_INT PIR1,TX1IF ;-- USART1 Transmit Interrupt
    #define TX2_INT PIR3,TX2IF ;-- USART2 Transmit Interrupt
    #define RX_INT PIR1,RCIF ;-- USART Receive Interrupt
    #define RX1_INT PIR1,RC1IF ;-- USART1 Receive Interrupt
    #define RX2_INT PIR3,RC2IF ;-- USART2 Receive Interrupt
    #define CMP_INT PIR2,CMIF ;-- Comparator Interrupt
    #define EE_INT PIR2,EEIF ;-- EEPROM/FLASH Write Operation Interrupt
    #define BUS_INT PIR2,BCLIF ;-- Bus Collision Interrupt
    #define LVD_INT PIR2,LVDIF ;-- Low Voltage Detect Interrupt
    #define HLVD_INT PIR2,HLVDIF ;-- High/Low Voltage Detect Interrupt
    #define PSP_INT PIR1, PSPIF ;-- Parallel Slave Port Read/Write Interrupt
    #define AD_INT PIR1, ADIF ;-- A/D Converter Interrupt
    #define SSP_INT PIR1, SSPIF ;-- Master Synchronous Serial Port Interrupt
    #define CCP1_INT PIR1, CCP1IF ;-- CCP1 Interrupt
    #define CCP2_INT PIR2, CCP2IF ;-- CCP2 Interrupt
    #define CCP3_INT PIR3, CCP3IF ;-- CCP3 Interrupt
    #define CCP4_INT PIR3, CCP4IF ;-- CCP4 Interrupt
    #define CCP5_INT PIR3, CCP5IF ;-- CCP5 Interrupt
    #define USB_INT PIR2, USBIF ;-- USB Interrupt
    #define OSC_INT PIR2, OSCFIF ;-- Oscillator Fail Interrupt



    ... only this :

    #define CMP_INT PIR2,CMIF ;-- Comparator Interrupt

    I think you have Yourself to look from which comparator the interrupt comes ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  15. #255
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    Hi Alain

    Thankyou Alain for taking the trouble to read my post and make a suggestion, may I draw your attention to the defines further down Darrel's wonderful coding.

    ;_____ Comparators __________________________________________________ ________
    #define CMP0_INT PIR1, CMP0IF ;-- Comparator 0 - 1230/1330 only

    CMPIFREG = PIR2 ;-- Comparator 1
    CMPIEREG = PIE2
    CMPIPREG = IPR2
    ifdef C1IF ; 18F24K20 18F25K20 18F26K20
    CM1IFBIT = C1IF ; 18F44K20 18F45K20 18F46K20
    endif
    ifdef CM1IF
    CM1IFBIT = CM1IF ; several J PICs
    endif
    ifdef CMP1IF
    CMPIFREG = PIR1 ; 1230/1330 only
    CM1IFBIT = CMP1IF
    CMPIEREG = PIE1
    CMPIPREG = IPR1
    endif

    ifdef CM1IFBIT
    #define CMP1_INT CMPIFREG, CM1IFBIT
    endif

    ifdef C2IF ;-- Comparator 2
    CM2IFBIT = C2IF ; 18F24K20 18F25K20 18F26K20
    endif ; 18F44K20 18F45K20 18F46K20
    ifdef CM2IF
    CM2IFBIT = CM2IF ; several J PICs
    endif
    ifdef CMP2IF
    CM2IFBIT = CMP2IF ; 1230/1330 only
    endif

    ifdef CM2IFBIT
    #define CMP2_INT CMPIFREG, CM2IFBIT
    endif
    '-----------------------------------------------------------------------------

    I think we are all waiting for the "K" series, perhaps this will compile to the K. I shall try it.

    I did wonder wether I should set the ADCON for this device particularily the LATA register. But I am also aware that <6> of the PIR2 PIE2 and IPR2 only refers to one CMI, I presume I shall have to be careful to make sure that any interrupt on either comparator does not interfere with the other. ie if one comparator is set then the other is disabled.

    Thanks again for your help.

    Duncan

  16. #256
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The difference is that on the 4520, there is only 1 interrupt source for the Comparator module. A change in either comparator will cause an interrupt to the same handler.

    There are other chips that have individual interrupt flags for each comparator, but not the 4520.

    So you need to use the CMP_INT, on that chip.
    <br>
    DT

  17. #257
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    Thanks for reply, I had slowly worked my way towrds that.

    for th 18F45K20 Migration
    The comparator is no longer controlled by the
    CMCON register and each comparator now has it’s
    own control register, CM1CON and CM2CON. The
    functionality of the bits has also changed.

    there is a section that confirms the observations made about the registers, so it really does always boil down to RTFD, but reading is sometimes not enough if you suffer from word blindness, anyway it gave me the opportunity to say thankyou for your routines which I intend to use.

    Duncan.

    Furthermore if everybody read and fully "understood" the datasheets this forum would die.

  18. #258
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    ... thankyou for your routines which I intend to use ...
    Grrreat! Hope the rest works out OK.
    If not, let me know.

    Furthermore if everybody read and fully "understood" the datasheets this forum would die.
    Or, then we could actually talk about the real purpose of this forum.
    Programming with PicBasic Pro.
    <br>
    DT

  19. #259
    Join Date
    Feb 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default POT & RCTIME works with DT_INTS-14.bas?

    Hi Darrel,

    this is my first post on this comunity. First of all I would thanks for the fantastic DT_INTS-14.bas background PWM routine.

    I have uset your SW on a 16F628 in order to drive some LED with different brightness an WORK PEFECTLY. Darrel YOU ARE GREAT!!!!!

    Now I need to use a potentiometer so set at run time the brightnes value for the LEDs, and after reading tons of html page and googled for hours, I have the founded suspect that the PBP instruction POT and RCTIME do not work with DT_INTS-14.bas.

    Can you please confirm?

    Ciao

    Leo

  20. #260
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Leo,
    Any time you have a routine or command that counts time, an interrupt will cause the timing to be off. Since the POT command times the discharge time of a cap, an interrupt in the middle of it will cause the command to give you a faulty reading when it is resumed.

    There are several options;
    --turn off the interrupts just before your POT command (and any other timing-specific command), and restore them just after.
    --write yourself a home-made "pot" command, and use it inside the interrupts (but this only works if your interrupts are high frequency.)
    --use a "real" a/d converter, either one in the PIC or off the chip.

  21. #261
    Join Date
    Feb 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Default POT & RCTIME works with DT_INTS-14.bas?

    Many thanks tenaja for your prompt reply.
    Ciao
    Leo

  22. #262
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Wirecut View Post
    Many thanks tenaja for your prompt reply.
    My sentiments, exactly.
    <br>
    DT

  23. #263
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Darrel, does your interrupt routine selectively choose which system variables to save, based on which ones are used, to save time? Or, does it save them all, regardless?

  24. #264
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Saves them all, no matter what.

    Without an external program like VBIS for Proton, there's no way to know which system variables are being used by a particular Handler.

    But from what I've seen, while optimizing out what isn't used does increase the maximum interrupt frequency available, it only really helps if you're pushing the limits. For normal everyday interrupts (with Basic Language) the extra saves don't have that much effect, and helps provide stability.

    And as always, if you really need the speed ?
    The interrupts should be in ASM anyways. (no PBP system variables saved at all)

    Which is one of the best parts of DT_INTs.
    You can have both ASM and Basic Language interrupts in the same program.
    <br>
    DT

  25. #265
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    And all this with a minimum of efforts
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  26. #266
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Post Instant interrupts PIC12F675 (12f675)

    For the record (partial pasted from other thread):
    Quote Originally Posted by wlundonly View Post
    Hi all, I've been trying to get Darrel Taylor's Instant interrupts to work with a 12f675 with no luck. Will they work with a 12f675?

    I just get the following error message when I try to compile it:

    ERROR: Variable wsave3 position request 416 beyond RAM_END 95.
    ERROR: Variable wsave2 position request 288 beyond RAM_END 95.
    ERROR: Variable wsave1 position request 160 beyond RAM_END 95.
    ERROR: Unable to fit variable RS2_Save
    <..snip...>
    Thanks for any help.

    Bill
    See Darrel’s solution:
    “To get Instant interrupts with Basic Language working on a 12F675 ...”
    Open the DT_INTS-14.bas file and comment out the wsave lines. The 675 doesn't have any usable RAM in banks 1,2 or 3
    Code:
    ' --- IF any of these three lines cause an error ?? ---------------------------- 
    '       Comment them out to fix the problem ----
    ' -- It depends on which Chip you are using, as to which variables are needed --
    ;wsave1      var byte    $A0     SYSTEM      ' location for W if in bank1
    ;wsave2      var byte    $120    SYSTEM      ' location for W if in bank2
    ;wsave3      var byte    $1A0    SYSTEM      ' location for W if in bank3
    ' ------------------------------------------------------------------------------
    Then in the ReEnterPBP.bas file comment the T?_save variables.
    Code:
    ;    T1_Save     VAR WORD
    ;    T2_Save     VAR WORD
    ;    T3_Save     VAR WORD
    ;    T4_Save     VAR WORD
    Just remember that if you use Instant Interrupts on a different chip later, you will need to un-comment those lines.
    HTH,
    __________________
    DT
    http://www.picbasic.co.uk/forum/show...9510#post49510
    Ohm it's not just a good idea... it's the LAW !

  27. #267
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Post

    Hello all

    Today I play with " Instant Interrupts" thank's Darrel

    For to begin I use blinky program
    I want to augment the speed of blink light by loading a value
    in TMR1H and TMR1L but the speed does not change

    Rq:
    I want not to change the value of the prescaler


    code:

    '********************
    TMR1H = %11111111
    TMR1L = %11111110
    '********************

    1CON = %110001 ; Prescaler = 8, TMR1ON

    what is wrong please?

  28. #268
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    I want to augment the speed of blink light by loading a value
    in TMR1H and TMR1L but the speed does not change

    code:

    '********************
    TMR1H = %11111111
    TMR1L = %11111110
    '********************
    Loading that value %1111111111111110 = $FFFE = 65534
    Means the timer will overflow after only 2 ticks.
    A smaller number would help.

    Also, it has to be loaded after every interrupt, not just at the beginning of the program.
    <br>
    DT

  29. #269
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    thank's Darrel

    Remark:

    In my next code if I load TMR1H with a high value code work fine

    Main:

    TMR1H = %11111111
    pause 1

    ----------------------------

    but if I reduce the value in TMR1H code don't work
    display is OFF

    Main:

    TMR1H = %10111111
    pause 1

    -------------------------------
    if I want use this value "TMR1H = %10111111"
    I must write "pause 20" and not "pause 1"

    an idea ???????

  30. #270
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    No, I have no idea what you are doing.
    If you're using a timer, why do you need pauses?

    What frequency are you trying to run the timer at?
    What frequency is your primary oscillator?
    What PIC are you using?
    <br>
    DT

  31. #271
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    I use one 16F877 MCU to 20 Mhz

    TMR1 produce an interrupt every 0,4 µSec
    for to drive four 7 segment displays (prescaler:1)

    My board developpement is EasyPic4

    If I write not a Pause after TMR1H %11111111
    then the displays don't work

  32. #272
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by debutpic View Post
    I use one 16F877 MCU to 20 Mhz
    TMR1 produce an interrupt every 0,4 µSec
    At 4Mhz, each instruction takes 1 uSec to execute.
    At 20Mhz, each instruciton takes .2 uSec to execute.
    When you take in to account the fact that each jump/return to/from the interrupt handler takes at minimum 4 instructions cycles (2 for the jump into the int handler, 2 for the RETFIE after the handler), which happens to be .8uSec, you have less than ZERO time to do anything.
    Even at 40Mhz, you're still at ZERO time left over.
    At 48Mhz, you might get one instruction in here and there...
    And even at 64Mhz, you probably won't get more than one or two instructions done between interrupts.

  33. #273
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,802


    Did you find this post helpful? Yes | No

    Default

    I think it is better to post the details of your project so that you could get a decent help. And the .4usec to drive a LED display, to me seems too little time.

    Ioannis

  34. #274
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    And the .4usec to drive a LED display, to me seems too little time.
    Maybe it's .4uSec for each update and not so much to display...
    but like you said, can only help as much as you know in the first place...

  35. #275
    Join Date
    Dec 2005
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Thank's for your explanation it's clear now
    I reduced the value preloaded in TMR1
    and he works fine without "pause"

  36. #276
    Join Date
    Apr 2004
    Posts
    34


    Did you find this post helpful? Yes | No

    Cool ResetFlag

    Hello,

    I've been reading through the posts regardings the Instant interrupts.
    I'm still a little confused on the usage or setting of the ResetFlag.
    Maybe I overlooked it in the posts but I did not find any info on this.
    In some cases it is set to 'yes' but what is the influence.
    --> ; IntSource, Label, Type, ResetFlag?

    Can someone give me a little explanation on this?

    Thank you.

    Best regards,

  37. #277
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you set it to YES, you don't need to clear the interrupt flags manually, DT's INT will do it for you.

    If you set it to NO, the program won't reset the interrupt flag, so you'll have to do it yourself. In case you don't, your program will always turn in round in your ISR.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  38. #278
    Join Date
    Apr 2004
    Posts
    34


    Did you find this post helpful? Yes | No

    Thumbs up

    Thank you for the fast response!

    Regards

  39. #279
    Join Date
    Sep 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Question 16F689 and DT INT14

    After reviewing all posts on INT14.



    Added

    RBIF = RABIF
    RBIE = RABIE to after ASM and just before INT_LIST.

    @ INT_ENABLE RBC_INT

    I can't get simple blinky to work and the errors are as listed.

    I get few errors as shown

    Error testin~1.ASM 985:[224] local directive only for use in macros
    :[225] undefined symbol 'iflagreg'
    :[226] numeric constant or symbol name expected
    Fatal TESTIN~1.ASM 895:[300] too many errors.



    Any idea?

  40. #280
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You have to be using MPASM as the assembler.
    The default PM assembler will not work.
    <br>
    DT

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 10

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts