The meaning of "overline"

Discussion in 'Programmer's Corner' started by FroceMaster, Dec 25, 2017.

  1. FroceMaster

    Thread Starter Well-Known Member

    Jan 28, 2012
    529
    4
    Hi
    C Code in MPLABX
    Have this from datasheet

    Code (Text):
    1. T1SYNC
    The identifyer has an OVERLINE in datasheet
    When putting in MPLAPX it will not accept the identifyer
    Have tried all combinations i could think of,.. TMR1SYNC ect.
    MCU is 16F18877
     
    Last edited: Dec 25, 2017
  2. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    The "overline" in a typeset document means logical negation.

    I think you are talking about bit 2 of T1CON

    bit 2 \bar{SYNC} : Timer1 Synchronization Control bit
    When TMR1CLK = FOSC or FOSC/4
    This bit is ignored. The timer uses the internal clock and no additional synchronization is performed.
    When TMR1CS<1:0> = (any setting other than FOSC or FOSC/4)
    1 = Do not synchronize external clock input
    0 = Synchronized external clock input with system clock


    See where it defines the meaning of the value 0 for that bit, as meaning "Synchronized external clock input with system clock". That's logical negation.

    To find the list of identifiers you can use in code, examine closely the header file for the processor of interest. This will be a file named according to the processor you are using with the extension ".h" or ".inc" In that file you should find the definition of some identifier as follows:

    #define <some identifier> T1CON.2

    meaning bit 2 of the T1CON register.
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627
    You need to post a screen shot of what you mean but it likely means 'not".

    I can't find T1SYNC or TMR1SYNC anywhere in the datasheet. What register are you talking about?

    What compiler???? MPLABX is not a compiler. It is a programming enviroment.
     
  4. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    He is making an inference about what the bit might be called in the header file, and his inference is just wrong. He needs to look in the header file for the answer, or he can make up his own name for it.

    #define BLIFIX T1CON.2
     
  5. FroceMaster

    Thread Starter Well-Known Member

    Jan 28, 2012
    529
    4
    The register is T1CON on page 417 in datasheet, attached this page as pdf.

    Found the 16F188877.inc file, and here is the info from that
    Code (Text):
    1.  
    2.  
    3. ;----- T1CON Bits -----------------------------------------------------
    4. ON_T1CON         EQU  H'0000'
    5. RD16             EQU  H'0001'
    6. NOT_SYNC         EQU  H'0002'
    7.  
    8. TMR1ON           EQU  H'0000'
    9. T1RD16           EQU  H'0001'
    10. NOT_T1SYNC       EQU  H'0002'
    11. T1CKPS0          EQU  H'0004'
    12. T1CKPS1          EQU  H'0005'
    13.  
    14. CKPS0            EQU  H'0004'
    15. CKPS1            EQU  H'0005'
    16.  
    17.  
    Have tried with "NOT_T1SYNC" but that is not accepted .

    Use compiler , see screen.png.
     
  6. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    Congratulations you have found the header file that you would use if you were doing an assembly language program. The definition of "NOT_SYNC" is just another name for the constant 2. What you need to do is locate the corresponding header file with a ".h" extension that you will use with some C-compiler.
     
  7. FroceMaster

    Thread Starter Well-Known Member

    Jan 28, 2012
    529
    4
    Many things in datasheet confuses me.,
    Ex. Figure 28-1 Timer 1 Block diagram, not the same as the registers on page 417-420
     
  8. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    The diagram in figure 28-1 is meant to apply to more timers than Timer1. For the lower case x you substitute the number of the timer you are interested in. If you like, print a copy of that page and use a marker to put a 1 in place of the little x. I don't have a bit of trouble matching up the bit names.

    How about the other symbols in the drawing? Do you know that the four-sided trapezoid is a multiplexer? If you did you are way ahead of most. If not -- no worries. Keep asking questions.

    The small box with an X inside is an external pin.
    Flip-flops have a D, CLK, Q, and Q-bar inside.
    Rectangular boxes with a name inside are registers. eg. TMRxH an TMRxL
     
    Last edited: Dec 25, 2017
    xox likes this.
  9. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,518
    1,818
    This is from the pic16f18877.h file, so you could use nSYNC or nT1SYNC - the n meaning negation.
    Code (Text):
    1.  
    2. // Register: T1CON
    3. #define T1CON T1CON
    4. extern volatile unsigned char           T1CON               @ 0x20E;
    5. #ifndef _LIB_BUILD
    6. asm("T1CON equ 020Eh");
    7. #endif
    8. // bitfield definitions
    9. typedef union {
    10.     struct {
    11.         unsigned ON                     :1;
    12.         unsigned RD16                   :1;
    13.         unsigned nSYNC                  :1;
    14.         unsigned                        :1;
    15.         unsigned CKPS                   :2;
    16.     };
    17.     struct {
    18.         unsigned TMR1ON                 :1;
    19.         unsigned T1RD16                 :1;
    20.         unsigned nT1SYNC                :1;
    21.         unsigned                        :1;
    22.         unsigned T1CKPS0                :1;
    23.         unsigned T1CKPS1                :1;
    24.     };
    25.     struct {
    26.         unsigned                        :4;
    27.         unsigned CKPS0                  :1;
    28.         unsigned CKPS1                  :1;
    29.     };
    30.     struct {
    31.         unsigned                        :1;
    32.         unsigned RD161                  :1;
    33.     };
    34. } T1CONbits_t;
    35.  
     
    xox and Papabravo like this.
  10. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627
    So it would be T1CONbits.nSync from the looks of it.
     
  11. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627
    Or T1CONbits.NOT_T1SYNC works with my chip.

    That is assuming TS is using XC or HTC. Compiler has yet to be mentioned.
     
  12. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,518
    1,818
    Compiler is XC8 from post #5 screen.png
     
    spinnaker likes this.
  13. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    Sure is nice to know we have a wealth of experience and knowledge here.

    Good advice costs nothing and it's worth the price.
    -- Alan Sherman

     
  14. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627

    He made it so obvious. ;)
     
  15. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,518
    1,818
    Oh, keep up at the back there.
     
    Papabravo likes this.
  16. Papabravo

    Expert

    Feb 24, 2006
    12,043
    2,591
    Class! CLASS!
    Let's not ruin the self image of the slower children without at least a trigger warning.
    ROFL:DLMAO
     
  17. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627
    Come on now. TS could have mentioned it in the text on the post rather than to put it in an attachment that might be ignored. Not to mention it tis the wrong forum in the first place. ;)
     
  18. FroceMaster

    Thread Starter Well-Known Member

    Jan 28, 2012
    529
    4
    Have figured it out now.
    nT1SYNC
    But still the outcome is not as wanted.

    More work to Come.

    Yes wrong forum.
     
  19. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    7,815
    3,627

    Post #10.

    You need to tell us what you are trying to do and what the issue is. It looks like that bit is only used with an external clock Do you have one?
     
  20. AlbertHall

    AAC Fanatic!

    Jun 4, 2014
    7,518
    1,818
    Post #9
     
Loading...