Page 1 of 2

problem programming a PIC16F18877

Posted: Mon Jan 13, 2025 5:59 pm
by peterhalloway
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

Re: problem programming a PIC16F18877

Posted: Mon Jan 13, 2025 9:30 pm
by chipfryer27
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.

18877 LED test_IntOsc.fcfx
(59.4 KiB) Downloaded 54 times

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

Re: problem programming a PIC16F18877

Posted: Tue Jan 14, 2025 5:18 pm
by peterhalloway
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

Re: problem programming a PIC16F18877

Posted: Tue Jan 14, 2025 5:48 pm
by mnfisher
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

Re: problem programming a PIC16F18877

Posted: Tue Jan 14, 2025 5:50 pm
by chipfryer27
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 :)

Re: problem programming a PIC16F18877

Posted: Tue Jan 14, 2025 6:20 pm
by daddytims_tims
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

Re: problem programming a PIC16F18877

Posted: Tue Jan 14, 2025 7:11 pm
by peterhalloway
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

Re: problem programming a PIC16F18877

Posted: Wed Jan 15, 2025 7:32 pm
by peterhalloway
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

Re: problem programming a PIC16F18877

Posted: Wed Jan 15, 2025 8:18 pm
by mnfisher
Google thinks that is a DLL issue. Maybe try reinstalling the Pickit software?

Martin

Re: problem programming a PIC16F18877

Posted: Wed Jan 15, 2025 8:48 pm
by peterhalloway
I didn't think I needed any software?