The meaning of "overline"

Thread Starter

FroceMaster

Joined Jan 28, 2012
702
Hi
C Code in MPLABX
Have this from datasheet

Code:
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:

Papabravo

Joined Feb 24, 2006
21,227
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.
 

spinnaker

Joined Oct 29, 2009
7,830
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.
 

Papabravo

Joined Feb 24, 2006
21,227
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.
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
 

Thread Starter

FroceMaster

Joined Jan 28, 2012
702
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:
;----- T1CON Bits -----------------------------------------------------
ON_T1CON         EQU  H'0000'
RD16             EQU  H'0001'
NOT_SYNC         EQU  H'0002'

TMR1ON           EQU  H'0000'
T1RD16           EQU  H'0001'
NOT_T1SYNC       EQU  H'0002'
T1CKPS0          EQU  H'0004'
T1CKPS1          EQU  H'0005'

CKPS0            EQU  H'0004'
CKPS1            EQU  H'0005'
Have tried with "NOT_T1SYNC" but that is not accepted .

Use compiler , see screen.png.
 

Attachments

Papabravo

Joined Feb 24, 2006
21,227
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:
;----- T1CON Bits -----------------------------------------------------
ON_T1CON         EQU  H'0000'
RD16             EQU  H'0001'
NOT_SYNC         EQU  H'0002'

TMR1ON           EQU  H'0000'
T1RD16           EQU  H'0001'
NOT_T1SYNC       EQU  H'0002'
T1CKPS0          EQU  H'0004'
T1CKPS1          EQU  H'0005'

CKPS0            EQU  H'0004'
CKPS1            EQU  H'0005'
Have tried with "NOT_T1SYNC" but that is not accepted .

Use compiler , see screen.png.
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.
 

Papabravo

Joined Feb 24, 2006
21,227
Many things in datasheet confuses me.,
Ex. Figure 28-1 Timer 1 Block diagram, not the same as the registers on page 417-420
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:

AlbertHall

Joined Jun 4, 2014
12,347
This is from the pic16f18877.h file, so you could use nSYNC or nT1SYNC - the n meaning negation.
Code:
// Register: T1CON
#define T1CON T1CON
extern volatile unsigned char           T1CON               @ 0x20E;
#ifndef _LIB_BUILD
asm("T1CON equ 020Eh");
#endif
// bitfield definitions
typedef union {
    struct {
        unsigned ON                     :1;
        unsigned RD16                   :1;
        unsigned nSYNC                  :1;
        unsigned                        :1;
        unsigned CKPS                   :2;
    };
    struct {
        unsigned TMR1ON                 :1;
        unsigned T1RD16                 :1;
        unsigned nT1SYNC                :1;
        unsigned                        :1;
        unsigned T1CKPS0                :1;
        unsigned T1CKPS1                :1;
    };
    struct {
        unsigned                        :4;
        unsigned CKPS0                  :1;
        unsigned CKPS1                  :1;
    };
    struct {
        unsigned                        :1;
        unsigned RD161                  :1;
    };
} T1CONbits_t;
 

Papabravo

Joined Feb 24, 2006
21,227
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

 

spinnaker

Joined Oct 29, 2009
7,830
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. ;)
 
Top