1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Timing with no WAIT

Discussion in 'Oshonsoft' started by camerart, Dec 13, 2015.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Thanks Ian,

    Looking forward to trying it tomorrow.

    Now back to watching rockets on TV. (Error removed:oops:)

    EDIT:1/ Changed the 'comma-space' to 'dot' and it compiled. See error gif
    2/ Only when the TMR1H/L was placed before the IF, would it enter the numbers into the SFRs
    3/ Is the TMR1 GIF relevant?

    C.
     

    Attached Files:

    Last edited: Dec 16, 2015
  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    Here is the full program, that I want to add my PACE idea to. You will see there is some ASM for PWM at CCP1/2

    In the TMR.GIF in post#21 you can see that nothing appears in the TMR1/2 SFRs also TIME does not increment. In the full program I have now changed the variable TIME to PACE.

    C.
     

    Attached Files:

  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Hi Camerart!!

    A couple of queries!! PORTA = 0x1C..

    That gives INX, QEA and QEB an input..... BUT!! The two buttons are connected to PORTA 6 & 7.... AND PORTA.0 (AN0) is set up as an analogue input BUT you specify that PORTA 0 & 1 are connected to NFET's???
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.

    Hi Ian,

    Well spotted, probably from a POT input test program.

    PORTA should = 0xDC 110111000.
    PORTA.0 should be digital

    ADCON0 = %00000000 'A/D Control Register 0
    ADCON1 = %00000000
    ADCON2 = %10100001 'Not sure>>>>>>>>>>>>>
    ADCON3 = %00000000
    ADCHS = %00000000 'A/D Channels select
    ANSEL0 = %00000000 'Analogue select Register 0
    OSCCON = %01110010 'internal 8Mhz clock (Should bit0 be 1?)
    TRISA = %11011100 'IN 7AF FOR BUTTON-6AR REV BUTTON-4QEA-3QEA -2IND
    TRISB = %00000000 'OUT 4,LED
    TRISC = %11000000 'IN 7RX-OUT-6TX-5#-4#-3#-2PWMFOR-1PWMREV

    Hopefully these are now correct??

    C.
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    [I have re-named the title from INTERRUPT to WAIT, which is what I was looking for]

    Thanks to Ian Rogers and others, I now have 2x TIMER (0 and 1) code, one of which I can use in my main program. Attached:

    Camerart.
     

    Attached Files:

  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Error duplicate.
     

Share This Page