Menu

#2409 pic18f14k22 include

closed-invalid
PIC16
1
2016-04-12
2015-08-11
No

in sdcc/non-free/include/pic16/pic18f14k22.h TMR3 is 8 bit sfr, same as TMR3L
...
extern at(0x0FB2) sfr TMR3;
extern at(0x0FB2) sfr TMR3L;
...
but TMR3 is 16 bit timer/counter
may be in this header should be
extern __at(0x0FB2) volatile unsigned short int TMR3;
?

Discussion

  • egan.fryazino

    egan.fryazino - 2015-08-11

    same problem in all other 16bit timers/counters in pic16 headers

     
  • Molnár Károly

    Molnár Károly - 2016-02-13
    • assigned_to: Molnár Károly
     
  • Molnár Károly

    Molnár Károly - 2016-02-13

    The SDCC not able to deal well with the timer registers. This it is because the reading and writing of two half-register work well in a different order. Example:

    read:

        movf    TMR3L, w
        movwf   value
        movf    TMR3H, w
        movwf   (value + 1)
    

    write:

        movf    (value + 1), w
        movwf   TMR3H
        movf    value, w
        movwf   TMR3L
    

    See: PIC18(L)F1XK22 Data Sheet page 110

    Molnár Károly

     
  • Molnár Károly

    Molnár Károly - 2016-04-12
    • status: open --> closed-invalid
     

Log in to post a comment.