Page 1 of 1

PIC16LF18426 does not work correctly

Posted: Fri Feb 11, 2022 12:36 pm
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

Re: PIC16LF18426 does not work correctly

Posted: Fri Feb 11, 2022 3:10 pm
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.

Re: PIC16LF18426 does not work correctly

Posted: Fri Feb 11, 2022 7:02 pm
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.

Re: PIC16LF18426 does not work correctly

Posted: Fri Feb 11, 2022 10:09 pm
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

Re: PIC16LF18426 does not work correctly

Posted: Mon Feb 14, 2022 12:41 pm
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

Re: PIC16LF18426 does not work correctly

Posted: Mon Feb 14, 2022 2:02 pm
by Steve
If an interrupt is not available in the list, then you could use the "Custom" (or "Personalizza") entry and code this yourself.

Re: PIC16LF18426 does not work correctly

Posted: Mon Feb 14, 2022 2:37 pm
by Bruno
OK, thank you