Hi
I have designed a PIC development board and initially I tried programming it using a 16F877A. All was good no issue. I have now replaced it with a 16F18877 and there is an error. I stripped the program back to a simple flashing LED. I note there are so many more options that can be set in project options. There is every likelihood I have something set wrong in there. I have attached my program.
Could someone please have a look to see if there is anything obvious wrong.
Just to add anything I try just seems to give PIC 16F18877 not found. I do have a 20Mhz crystal connected on my board
Many thanks
Pete
problem programming a PIC16F18877
-
- Posts: 33
- http://meble-kuchenne.info.pl
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
-
- Valued Contributor
- Posts: 1575
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 561 times
Re: problem programming a PIC16F18877
Hi
In Project Options you have the external oscillator "Off", the internal oscillator set for 32MHz and "Clock Speed" set at 20MHz (this tells FC what the clock speed is and must match actual clock speed).
To use the internal clock, set "clock speed" to 32MHz and include a C-Block as your first icon containing the required code. Flowcode has a component called Internal Oscillator Helper which will check speeds and generate the required code.
I have modified your code to use the internal at 32MHz.
If you want to run with your external 20MHz crystal then in Project Options change External Oscillator to HS Oscillator and change Software Oscillator to EXTOSC.
Regards
In Project Options you have the external oscillator "Off", the internal oscillator set for 32MHz and "Clock Speed" set at 20MHz (this tells FC what the clock speed is and must match actual clock speed).
To use the internal clock, set "clock speed" to 32MHz and include a C-Block as your first icon containing the required code. Flowcode has a component called Internal Oscillator Helper which will check speeds and generate the required code.
I have modified your code to use the internal at 32MHz.
If you want to run with your external 20MHz crystal then in Project Options change External Oscillator to HS Oscillator and change Software Oscillator to EXTOSC.
Regards
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
Re: problem programming a PIC16F18877
Thank you for the reply. I tried your file and I am getting the same problem: Could not find device PIC16F18877.
Pete
https://www.flowcode.co.uk
Using <PICkit2 PK2CMD External Power> inbuilt settings for compiler
Launching the compiler...
C:\Users\peter\Documents\flowcode>REM REVISION: 3.0
C:\Users\peter\Documents\flowcode>REM DATE: 09\01\2024
Memory Summary:
Program space used 136h ( 310) of 8000h words ( 0.9%)
Data space used 77h ( 119) of 1000h bytes ( 2.9%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of F87h bytes ( 0.0%)
Configuration bits used 5h ( 5) of 5h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Compilation successful!
Using <PICkit2 PK2CMD External Power> inbuilt settings for linker
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode v10\tools\DoNothing\DoNothing.exe
Using <PICkit2 PK2CMD External Power> inbuilt settings for programmer
Launching the programmer...
Could not find device PIC16F18877.
Autoclose turned off
FINISHED
Pete
https://www.flowcode.co.uk
Using <PICkit2 PK2CMD External Power> inbuilt settings for compiler
Launching the compiler...
C:\Users\peter\Documents\flowcode>REM REVISION: 3.0
C:\Users\peter\Documents\flowcode>REM DATE: 09\01\2024
Memory Summary:
Program space used 136h ( 310) of 8000h words ( 0.9%)
Data space used 77h ( 119) of 1000h bytes ( 2.9%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of F87h bytes ( 0.0%)
Configuration bits used 5h ( 5) of 5h words (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Compilation successful!
Using <PICkit2 PK2CMD External Power> inbuilt settings for linker
Launching the linker/assembler...
C:\Program Files (x86)\Flowcode v10\tools\DoNothing\DoNothing.exe
Using <PICkit2 PK2CMD External Power> inbuilt settings for programmer
Launching the programmer...
Could not find device PIC16F18877.
Autoclose turned off
FINISHED
-
- Valued Contributor
- Posts: 1520
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 138 times
- Been thanked: 732 times
Re: problem programming a PIC16F18877
Looks like a wiring issue? Either one or more of the Pickit pins is to the wrong chip pin, or insufficient / no power (which is set as external)
Martin
Martin
-
- Valued Contributor
- Posts: 1575
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 357 times
- Been thanked: 561 times
Re: problem programming a PIC16F18877
Hi
I don't use a PICkit2 and I don't think it supports the PIC16F18877. I think MPLAB has a support file in ReadMe / Devices that documents the chips it can handle.
A google search may help too.
I assume the ICSP lines are good?
Regards
EDIT....
Martin got in first
I don't use a PICkit2 and I don't think it supports the PIC16F18877. I think MPLAB has a support file in ReadMe / Devices that documents the chips it can handle.
A google search may help too.
I assume the ICSP lines are good?
Regards
EDIT....
Martin got in first

-
- Posts: 74
- Joined: Thu Jun 16, 2022 6:16 pm
- Has thanked: 116 times
- Been thanked: 13 times
Re: problem programming a PIC16F18877
Hi
Everyone
I had encountered this little scenario with both those Chips
I just tried the example, It WORKED
"18877 LED test_IntOsc.fcfx"
I don't think there's a problem with the connection, As the 16877A and the 18877 are of the same Pins
The only difference is that the 18877 is FAR advance than the 877A
So, you will be needing a pickit 3 to program the 18877 chips
Regards
Everyone
I had encountered this little scenario with both those Chips
I just tried the example, It WORKED
"18877 LED test_IntOsc.fcfx"
I don't think there's a problem with the connection, As the 16877A and the 18877 are of the same Pins
The only difference is that the 18877 is FAR advance than the 877A
So, you will be needing a pickit 3 to program the 18877 chips
Regards
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
Re: problem programming a PIC16F18877
Thank you all for your help I will get a pickit3 on order
Thanks again it is the help available from everyone that makes this software a good investment
Thank you all
Pete
Thanks again it is the help available from everyone that makes this software a good investment
Thank you all
Pete
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time
Re: problem programming a PIC16F18877
OK so pickit3 arrived and I am still having issues as below can anyone suggest what this may be?
Compilation successful!
Using <> user settings for linker
Launching the linker/assembler...
Using <> user settings for programmer
Launching the programmer...
C:\Program Files (x86)\Flowcode v10\tools\PICkit3\PK3CMD.exe -P16F18877 -F"18877 LED test_IntOsc.hex" -E -M -L
C:\Program Files (x86)\Flowcode v10\tools\PICkit3\PK3CMD.exe reported error code 0xC0000135
Autoclose turned off
FINISHED
Thanks
Pete
Compilation successful!
Using <> user settings for linker
Launching the linker/assembler...
Using <> user settings for programmer
Launching the programmer...
C:\Program Files (x86)\Flowcode v10\tools\PICkit3\PK3CMD.exe -P16F18877 -F"18877 LED test_IntOsc.hex" -E -M -L
C:\Program Files (x86)\Flowcode v10\tools\PICkit3\PK3CMD.exe reported error code 0xC0000135
Autoclose turned off
FINISHED
Thanks
Pete
-
- Posts: 33
- Joined: Sat Nov 20, 2021 11:28 am
- Has thanked: 1 time