18F27K40 Silicon issue with rev a002 [Resolved].
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
18F27K40 Silicon issue with rev a002 [Resolved].
I have a developed a touch screen heating controller.
Development uses DIP version of 18F27K40 which has silicon rev a003 which works perfect.
Prototype production uses SMD but the silicon version is a002 which does not work perfect.
The touch screen uses SPI via FT810.
It can't be a PCB or other component fault as a lot of the touch display works.
The difference are Screen saver is on instantly instead of a 30-second delay.
Pass codes are not the same.
Using internal clock and same hex file on both silicon revisions.
The only thing I can see in the errata which may or may not affect the differences is: Is there a work around, assuming it is this issue and not an undocumented issue?
I can PM the project to a Matrix team member, If it will help?
Development uses DIP version of 18F27K40 which has silicon rev a003 which works perfect.
Prototype production uses SMD but the silicon version is a002 which does not work perfect.
The touch screen uses SPI via FT810.
It can't be a PCB or other component fault as a lot of the touch display works.
The difference are Screen saver is on instantly instead of a 30-second delay.
Pass codes are not the same.
Using internal clock and same hex file on both silicon revisions.
The only thing I can see in the errata which may or may not affect the differences is: Is there a work around, assuming it is this issue and not an undocumented issue?
I can PM the project to a Matrix team member, If it will help?
- Attachments
-
- PIC18F27_47K40 Errata DS80000713D.pdf
- (130.31 KiB) Downloaded 236 times
Martin
Re: 18F27K40 Silicon issue.
Hi Martin,
Could you try this C code at the start of the program
Source:
viewtopic.php?f=76&t=20479
Have you tried it before?
I used this solution for PIC18F67K40 MCU and it worked for me.
Best Regards,
Lagoda
Could you try this C code at the start of the program
Code: Select all
asm ("BSF NVMCON1, 7");
viewtopic.php?f=76&t=20479
Have you tried it before?
I used this solution for PIC18F67K40 MCU and it worked for me.
Best Regards,
Lagoda
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Hi Lagoda,
Thank you for your reply.
It's worrying you had to switch in the end as that what I may need to do.
Hopefully it won't come to that.
I will try the solution you posted, and post an update a bit later this morning.
Thank you for your reply.
It's worrying you had to switch in the end as that what I may need to do.
Hopefully it won't come to that.
I will try the solution you posted, and post an update a bit later this morning.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Hi Lagoda,
In my case it has not made any difference by adding a C code block with
I appreciate the reply.
In my case it has not made any difference by adding a C code block with
Code: Select all
asm ("BSF NVMCON1, 7");
Martin
Re: 18F27K40 Silicon issue.
Hi Martin,
Does your project file compiled into C language contain the TBLRD instruction?
I tested this silicone issue with a very simple program, because was a problem with string operations.
Unfortunately, I have little experience with this silicone bug.
Regards,
Lagoda
Does your project file compiled into C language contain the TBLRD instruction?
I tested this silicone issue with a very simple program, because was a problem with string operations.
Unfortunately, I have little experience with this silicone bug.
Regards,
Lagoda
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
I could not see TBLRD within the generated C code, but I do use strings.
I'm not sure if TBLRD is used under the hood or not?
Trouble is my project has a lot of functions and even using the professional version of XC8 compiler, uses 107609 bytes.
I'm not sure if TBLRD is used under the hood or not?
Me neither.Lagoda wrote:Unfortunately, I have little experience with this silicone bug.
Trouble is my project has a lot of functions and even using the professional version of XC8 compiler, uses 107609 bytes.
Martin
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: 18F27K40 Silicon issue.
Hi Martin,
My only recollections on this issue is that we had to do a fix (about a year ago) in the EEPROM component to explicitly reset the NVMREG access selection back to Flash after reading EEPROM.
This is done in the EEPROM CAL code.
My only recollections on this issue is that we had to do a fix (about a year ago) in the EEPROM component to explicitly reset the NVMREG access selection back to Flash after reading EEPROM.
Code: Select all
NVMCON1bits.NVMREG = 2;
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Thanks Leigh, I have opened a case with microchip.
If they are able to resolve this then I will post the solution within this topic.
If they are able to resolve this then I will post the solution within this topic.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
After some debugging I have worked out why silicon a002 is not working and a003 is.
With a002 the initial value of all variables are being cleared to 0 ("" for strings), no matter what values set within flowchart.
With a002 the initial value of all variables are being cleared to 0 ("" for strings), no matter what values set within flowchart.
Martin
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
Re: 18F27K40 Silicon issue.
Ah! Well spotted!
... the (NVMREG) fix will need to go into the (Microchip compiler) startup code, hmm....
Does setting your string values in an icon after the NVMREG fix work OK?
... the (NVMREG) fix will need to go into the (Microchip compiler) startup code, hmm....
Does setting your string values in an icon after the NVMREG fix work OK?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Hi Leigh,
Just to test, I have commented out the NVMREG fix and makes no difference.
Strings values are OK if set in calculation boxes.
Just to test, I have commented out the NVMREG fix and makes no difference.
Strings values are OK if set in calculation boxes.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
I have had a reply from Microchip on this,
In order to see how to call the powerup.as file you can do a small test.
For example, if you generate an empty project in MPLABX, with only while(1); loop in main and include the powerup.as file, you can build the project and see what you have to call in the output window.
So my question is How is the powerup.as added and included?For example on my side the compiling and linking path look like this:
"C:\Program Files (x86)\Microchip\xc8\v2.05\bin\xc8-cc.exe" -c -mcpu=18F45K40 -fno-short-double -fno-short-float -memi=wordwrite -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/powerup.o powerup.as
"C:\Program Files (x86)\Microchip\xc8\v2.05\bin\xc8-cc.exe" -mcpu=18F45K40 -Wl,-Map=dist/default/production/PIC18F45K40.X.production.map -DXPRJ_default=default -Wl,--defsym=__MPLAB_BUILD=1 -fno-short-double -fno-short-float -memi=wordwrite -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -Wl,--memorysummary,dist/default/production/memoryfile.xml -o dist/default/production/PIC18F45K40.X.production.elf build/default/production/main.p1 build/default/production/powerup.o
If you do not manage to get it working, I think the solution is to ask the Flowcode guys how to have this file included.
Martin
- 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: 18F27K40 Silicon issue.
Hi Martin,
It looks to me like it is added to the end of the compiler parameters probably inside the batch file.
So this line in the batch file "C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat".
The change might look something like this.
You might also need to add the powerup.o to the parameters for the linker.
It looks to me like it is added to the end of the compiler parameters probably inside the batch file.
So this line in the batch file "C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat".
Code: Select all
%~dp0..\bin\xc8.exe --chip=%~1 "%~3.c" --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32
Code: Select all
%~dp0..\bin\xc8.exe --chip=%~1 "%~3.c" --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32 C:\FC\powerup.as
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
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Thanks Ben.
Won't be able to test until Monday.
Once tested, will let you know the results.
Won't be able to test until Monday.
Once tested, will let you know the results.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Hi Ben.
All the steps I have taken.
1. Named a directory to FC on the root drive.
2. Placed within the FCdirectory a file called powerup.as
Contents of powerup.as:
3. Modifed batch file to:
Flowcode has a compiling error with the powerup.as:
All the steps I have taken.
1. Named a directory to FC on the root drive.
2. Placed within the FCdirectory a file called powerup.as
Contents of powerup.as:
Code: Select all
#include <xc.inc>
GLOBAL powerup, start
PSECT powerup, class=CODE, delta=1,
reloc=2
powerup:
BSF NVMCON1, 7
GOTO start
end
Code: Select all
@REM $(chip) "$(outdir)" "$(target)"
@PUSHD %~2
"C:\Program Files (x86)\Microchip\xc8\v2.05\bin\xc8-cc.exe" -mcpu=%~1 "%~3.c" -w=359,1273,1388 -fshort-float -fshort-double -std=c90 -Os C:\FC\powerup.as
@POPD
@IF %ERRORLEVEL% NEQ 0 GOTO Error
@ECHO.
@ECHO Compilation successful!
@EXIT 0
:Error
@ECHO.
@ECHO Error returned from [xc8.exe]
@EXIT 1
Code: Select all
Launching the compiler...
C:\Program Files (x86)\Flowcode\Compilers\pic\batch\pic_xc8 V2.05_comp 18F27K40 Only.bat 18F27K40 "M:\New Temperature controller\Software Dev\Controller\" "Heat Control Beta13Test silicon only"
M:\New Temperature controller\Software Dev\Controller>"C:\Program Files (x86)\Microchip\xc8\v2.05\bin\xc8-cc.exe" -mcpu=18F27K40 "Heat Control Beta13Test silicon only.c" -w=359,1273,1388 -fshort-float -fshort-double -std=c90 -Os C:\FC\powerup.as
. . . . . . . . . . . . . . . . . . . . .
powerup.i:15561:: error: (876) syntax error
(908) exit status = 1
Error returned from [xc8.exe]
C:\Program Files (x86)\Flowcode\Compilers\pic\batch\pic_xc8 V2.05_comp 18F27K40 Only.bat reported error code 1
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: 18F27K40 Silicon issue.
Update,
After changing:
To
Flowcode compiles and hardware works as expected I.e variables can now be preassigned.
Thank you for your help with this silicon issue.
After changing:
Code: Select all
#include <xc.inc>
GLOBAL powerup, start
PSECT powerup, class=CODE, delta=1,
reloc=2
powerup:
BSF NVMCON1, 7
GOTO start
end
Code: Select all
#include <xc.inc>
GLOBAL powerup, start
PSECT powerup, class=CODE, delta=1, reloc=2
powerup:
BSF NVMCON1, 7
GOTO start
end
Thank you for your help with this silicon issue.
Martin