PIC16LF18426 does not work correctly

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
Bruno
Posts: 67
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 21 times
Contact:

PIC16LF18426 does not work correctly

Post by Bruno »

Hi Martin and everyone

In one of my projects, I changed the micro for memory capacity problems:
from PIC16LF18325 to PIC16LF18426.
Unfortunately, the RXINT0 UART interrupt no longer works
and even the ADC is not working
The compiler gives me the following error:

https://www.matrixtsl.com
Avvio del compilatore...
C:\Program Files (x86)\Flowcode v8\pic\batch\pic_xc8_2.20_comp.bat 16LF18426 "C:\Users\BRUNOS~1\Desktop\SENSOR~1\Test\" "Extensometer _NTC_Pic16LF18426_1.0"
C:\Users\BRUNOS~1\Desktop\SENSOR~1\Test>"C:\Program Files\Microchip\xc8\v2.20\bin\xc8-cc.exe" -mcpu=16LF18426 "Extensometer _NTC_Pic16LF18426_1.0.c" -w=359,1273,1388 -fshort-float -fshort-double -std=c90 -Os
Extensometer_NTC_Pic16LF18426_1.0.c:2311:16: error: (255) not a member of the struct/union ""
Extensometer_NTC_Pic16LF18426_1.0.c:2311:19: error: (182) illegal conversion between types
int -> volatile union S893
Extensometer_NTC_Pic16LF18426_1.0.c:2522:20: error: (255) not a member of the struct/union ""
Extensometer_NTC_Pic16LF18426_1.0.c:2522:40: error: (255) not a member of the struct/union ""
Extensometer_NTC_Pic16LF18426_1.0.c:2522:41: error: (199) logical type required
NOT volatile union S875
Extensometer _NTC_Pic16LF18426_1.0.c:2522:41: error: (199) logical type required
NOT volatile union S893
Extensometer_NTC_Pic16LF18426_1.0.c:2525:16: error: (255) not a member of the struct/union ""
Extensometer_NTC_Pic16LF18426_1.0.c:2525:19: error: (182) illegal conversion between types
int -> volatile union S875
(908) exit status = 1
Error returned from [xc8.exe]
C:\Program Files (x86)\Flowcode v8\pic\batch\pic_xc8_2.20_comp.bat ha riportato il codice di errore 1
Autoclose turned off

I read, from the datasheet, that the UART interrupt is enabled by the PIE3 register and not the PIE1 register.
"// Name: Interrupt, Type: Interrupt: Enable RXINT0
st_bit (INTCON, GIE);
st_bit (PIE1, RCIE);
st_bit (INTCON, PEIE); "
For the ADC, on the other hand, I can't understand :( :(
Can you help me solve the problem?

Thank you very much
best regards

medelec35
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: PIC16LF18426 does not work correctly

Post by medelec35 »

Hi Bruno.
Just regarding UART interrupt
Browse to this location using file explorer, it's hidden by default so just paste the link into your address bar.
C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC
Replace the existing file with the attached file.
If Flowcode was running when you replaced the file, you will need to reload your flowchart.
Attachments
16LF18426.fcdx
(27.81 KiB) Downloaded 107 times
Martin

medelec35
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: PIC16LF18426 does not work correctly

Post by medelec35 »

Hi Regarding ADC,
Can you see if the attached file works better?
The same as above post, but this time the file belongs:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC

Edit: Removed file as not working.
Martin

User avatar
Bruno
Posts: 67
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 21 times
Contact:

Re: PIC16LF18426 does not work correctly

Post by Bruno »

Hi Martin
Thank you for your help
Next Monday I'll take a test and let you know.
Have a nice week end

User avatar
Bruno
Posts: 67
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 21 times
Contact:

Re: PIC16LF18426 does not work correctly

Post by Bruno »

Hi Martin
I have tested your modification, and the interrupt problem is solved.
On the other hand, as far as the ADC is concerned, it didn't work due to my configuration error, so I solved it. :oops:
I have tested your CAL_ADC.c file and it is not working correctly.
I point out that the micro in question has 4 timers 8bit and 4 timers 16bit, but in the interrupt property there are only three as shown in the attached photo. Why are the other timers not available?
thanks for your time
best regards
Attachments
Interrupt.jpg
Interrupt.jpg (26.48 KiB) Viewed 3121 times

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: PIC16LF18426 does not work correctly

Post by Steve »

If an interrupt is not available in the list, then you could use the "Custom" (or "Personalizza") entry and code this yourself.

User avatar
Bruno
Posts: 67
Joined: Thu Jan 18, 2018 2:11 pm
Been thanked: 21 times
Contact:

Re: PIC16LF18426 does not work correctly

Post by Bruno »

OK, thank you

Post Reply