Hello!
I compiled an old v6 project in v7.
An old "T1SOSCEN error" emerged.
Old thread: http://www.matrixtsl.com/mmforums/viewt ... 59&t=17312
PIC18F25K80 timer1 problem
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K80 timer1 problem
Hello,
For 8-bit PIC devices V7 and V8 use a different compiler to V6 which has a different syntax for accessing registers.
Instead of
Try this.
For 8-bit PIC devices V7 and V8 use a different compiler to V6 which has a different syntax for accessing registers.
Instead of
Code: Select all
st_bit(t1con, T1OSCEN);
Code: Select all
st_bit(T1CON, T1OSCEN);
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: PIC18F25K80 timer1 problem
Thanks,
I know the syntax but there is nothing T1CON, T1SOSCEN bit, only T1CON, SOSCEN.
I think you've passed the bug from an old version of V6.
I know the syntax but there is nothing T1CON, T1SOSCEN bit, only T1CON, SOSCEN.
I think you've passed the bug from an old version of V6.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PIC18F25K80 timer1 problem
Hello,
Aha yes in the xc8 compiler definition for the device the T1CON register has these bits.
Aha yes in the xc8 compiler definition for the device the T1CON register has these bits.
Code: Select all
typedef union {
struct {
unsigned :2;
unsigned NOT_T1SYNC :1;
};
struct {
unsigned TMR1ON :1;
unsigned RD16 :1;
unsigned nT1SYNC :1;
unsigned SOSCEN :1;
unsigned T1CKPS :2;
unsigned TMR1CS :2;
};
struct {
unsigned :4;
unsigned T1CKPS0 :1;
unsigned T1CKPS1 :1;
unsigned TMR1CS0 :1;
unsigned TMR1CS1 :1;
};
struct {
unsigned :3;
unsigned T1OSCEN :1;
unsigned :3;
unsigned T1RD16 :1;
};
} T1CONbits_t;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: PIC18F25K80 timer1 problem
I modified the fcd file.
I replaced T1SOSCEN to SOSCEN.
This is how the timer1 interruption works well.
I replaced T1SOSCEN to SOSCEN.
This is how the timer1 interruption works well.
- Attachments
-
- t1soscen.PNG
- (12.6 KiB) Downloaded 2133 times