PIC16F15355 Uart and ADC problem
Moderator: Benj
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
PIC16F15355 Uart and ADC problem
Hi,
My project with PIC16F15355 has a problem with the Hardware uart.
I get an undefined identifier error at compiling the project.
Title:
Description:
Device: PIC.16F.16F15355
Generated by: Flowcode v7.3.0.5
Date: Thursday, December 20, 2018 19:34:08
Users: 1
Registered to: ps
Licence key: X7--
http://www.matrixtsl.com
Launching the compiler...
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
366: RX1PPS = 15;
^ (192) undefined identifier "RX1PPS"
(908) exit status = 1
(908) exit status = 1
FINISHED
Uart in software setting works.
Second i tried to use the ADC.
Also here several undefined identifiers.
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: FC_CAL_ADC_Enable()
4756: ADREF = 0x00;
^ (192) undefined identifier "ADREF"
4771: ADPCH = 0x01;
^ (192) undefined identifier "ADPCH"
5008: ADCLK = Conv_Speed & 0x3F;
^ (192) undefined identifier "ADCLK"
5019: ADCON0bits.ADGO = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S53
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: FC_CAL_ADC_Sample()
5027: while (ADCON0bits.ADGO);
^ (255) not a member of the struct/union ""
^ (199) logical type required
(908) exit status = 1
(908) exit status = 1
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1
FINISHED
Also PWM only uses Timer2 and only PWM 1 and 2 do compile but no working results
PWM 3-6 do give compiling mesages..
Please check, and thanks.
My project with PIC16F15355 has a problem with the Hardware uart.
I get an undefined identifier error at compiling the project.
Title:
Description:
Device: PIC.16F.16F15355
Generated by: Flowcode v7.3.0.5
Date: Thursday, December 20, 2018 19:34:08
Users: 1
Registered to: ps
Licence key: X7--
http://www.matrixtsl.com
Launching the compiler...
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
366: RX1PPS = 15;
^ (192) undefined identifier "RX1PPS"
(908) exit status = 1
(908) exit status = 1
FINISHED
Uart in software setting works.
Second i tried to use the ADC.
Also here several undefined identifiers.
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: FC_CAL_ADC_Enable()
4756: ADREF = 0x00;
^ (192) undefined identifier "ADREF"
4771: ADPCH = 0x01;
^ (192) undefined identifier "ADPCH"
5008: ADCLK = Conv_Speed & 0x3F;
^ (192) undefined identifier "ADCLK"
5019: ADCON0bits.ADGO = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S53
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_ADC.c: FC_CAL_ADC_Sample()
5027: while (ADCON0bits.ADGO);
^ (255) not a member of the struct/union ""
^ (199) logical type required
(908) exit status = 1
(908) exit status = 1
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe reported error code 1
FINISHED
Also PWM only uses Timer2 and only PWM 1 and 2 do compile but no working results
PWM 3-6 do give compiling mesages..
Please check, and thanks.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi patrick,
If you update to the latest version (7.3.0.7),
then that will eliminate UART bug and just leave ADC bug.
I can fix it for you, but it means replacing two files.
Would you like me to produce updated files,
or would you rather wait for MM staff to produce official update?
If you update to the latest version (7.3.0.7),
then that will eliminate UART bug and just leave ADC bug.
I can fix it for you, but it means replacing two files.
Would you like me to produce updated files,
or would you rather wait for MM staff to produce official update?
Martin
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Martin,
Thanks for the quick support.
I Can't find the latest 7.3.0.7 online!
But you may send me the two patch files.
I know how it works.
Thanks.
Thanks for the quick support.
I Can't find the latest 7.3.0.7 online!
But you may send me the two patch files.
I know how it works.
Thanks.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Patrick,
Attached are the two updated files:
16F15355.fcdx goes in C:\Program Files (x86)\Flowcode 7\FCD (if 64bit windows) or C:\Program Files\Flowcode 7\FCD (if 32bit windows)
PIC_CAL_ADC.c goes in C:\Program Files (x86)\Flowcode 7\CAL\PIC (if 64bit windows) or C:\Program Files\Flowcode 7\CAL\PIC (if 32bit windows)
Attached are the two updated files:
16F15355.fcdx goes in C:\Program Files (x86)\Flowcode 7\FCD (if 64bit windows) or C:\Program Files\Flowcode 7\FCD (if 32bit windows)
PIC_CAL_ADC.c goes in C:\Program Files (x86)\Flowcode 7\CAL\PIC (if 64bit windows) or C:\Program Files\Flowcode 7\CAL\PIC (if 32bit windows)
- Attachments
-
- 16F15355.fcdx
- (27.91 KiB) Downloaded 253 times
-
- PIC_CAL_ADC.c
- (132.17 KiB) Downloaded 272 times
Martin
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Martin,
All thumbs up.
The ADC and both hardware uarts are working now.
I still get compiling errors when using timer 1 and 2, timer 0 is working well.
Proberly this is also the issue why the pwm is not working. Pwm is only using timer2.
Pwm ch 1 and 2 can be compiled but no working results, 3-6 also give compiling errors.
Many thanks for now.
Patrick
All thumbs up.
The ADC and both hardware uarts are working now.
I still get compiling errors when using timer 1 and 2, timer 0 is working well.
Proberly this is also the issue why the pwm is not working. Pwm is only using timer2.
Pwm ch 1 and 2 can be compiled but no working results, 3-6 also give compiling errors.
Many thanks for now.
Patrick
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Patrick,
I can't make any promises,
but I will see if I can get those working as well?
I'm glad it's working, thanks for letting me know.patrick schoon wrote:The ADC and both hardware uarts are working now.
I did not know there is an issue with timers and PWM.patrick schoon wrote:I still get compiling errors when using timer 1 and 2
I can't make any promises,
but I will see if I can get those working as well?
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Patrick,
Can you see if the attached solves your issues?
Can you see if the attached solves your issues?
- Attachments
-
- 16F15355.fcdx
- (31.75 KiB) Downloaded 246 times
Martin
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Martin,
Many thanks in such short notice.
Both timers do compile and work on their own.
When used both (TMR1 and 2) they disturb each other, I get interupted pulses.. Proberly swatped some code...
Timer0 is ok.
Simple example in the attachment. Great help, thanks.
Patrick
Many thanks in such short notice.
Both timers do compile and work on their own.
When used both (TMR1 and 2) they disturb each other, I get interupted pulses.. Proberly swatped some code...
Timer0 is ok.
Simple example in the attachment. Great help, thanks.
Patrick
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Hi Martin,
I did a quick test but no working results.
To be sure i deleted all timer2 components and reselected a new pwm component.
But no working output. Compiling does work..
Regards,
Patrick
I did a quick test but no working results.
To be sure i deleted all timer2 components and reselected a new pwm component.
But no working output. Compiling does work..
Regards,
Patrick
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Try adding a c code block at the start with
Code: Select all
T2CLKCON = 1;
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
You will need the above code for timer 2 to work, including PWMmedelec35 wrote:Try adding a c code block at the start withCode: Select all
T2CLKCON = 1;
Martin
-
- Posts: 74
- Joined: Mon Aug 23, 2010 7:07 pm
- Location: Amsterdam
- Has thanked: 7 times
- Been thanked: 13 times
- Contact:
Re: PIC16F15355 Uart and ADC problem
Sorry,
No results.
Attached my test file for check. Regards,
Patrick
No results.
Attached my test file for check. Regards,
Patrick