pic18f led blink error

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
asdf11
Posts: 5
Joined: Thu Nov 23, 2017 8:10 am
Been thanked: 1 time
Contact:

pic18f led blink error

Post by asdf11 »

Hi.
I made a simple program for the microcontroller pic18f4550 and pickit3 + flowcode7,
but see the error when the firmware of the chip.
What could be wrong in my case.

"Target folder: C:\Users\Public\DOCUME~1
Source name: C:\Users\Public\Documents\Flowcode1.fcfx
Title:
Description:
Device: PIC.18F.18F4550
Generated by: Flowcode v7.2.1.4
Date: Thursday, November 23, 2017 08:13:50
Users: 1
Registered to:
Licence key: *****
NOT FOR COMMERCIAL USE
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe /P18F4550 /F"C:\Users\Public\DOCUME~1\Flowcode1.hex" /TPPK3 /M /OL /W3.3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
*****************************************************
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............PIC18F
. . . .
Programmer to target power is enabled - VDD = 3,250000 volts.
Target device PIC18F4550 found.
Device ID Revision = 7
. . . . . .
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0xff
configuration memory
program memory
Address: e Expected Value: 44 Received Value: 40
Failed to program device
Programming Target Failed.
. . . .
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe reported error code 7

FINISHED
"
Attachments
pic3kit.jpg
pic3kit.jpg (170.77 KiB) Viewed 8894 times
flow.jpg
flow.jpg (40.85 KiB) Viewed 8894 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: pic18f led blink error

Post by kersing »

Have you connected pin 31 and 32 to ground/power as well? If not the device might respond unpredictable.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
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: pic18f led blink error

Post by Benj »

Looks to me like programming has failed during the verify stage.
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0xff
configuration memory
program memory
Address: e Expected Value: 44 Received Value: 40
Failed to program device
Programming Target Failed.
Programmer to target power is enabled - VDD = 3,250000 volts.
To program the 8-bit devices that are designed for 5V you need to be powering them at 5V. I've had similar problems programming the 16F and 18F devices at 3V3. The 16LF and 18LF devices on the other hand cannot be powered at 5V and should program fine at 3V3.

asdf11
Posts: 5
Joined: Thu Nov 23, 2017 8:10 am
Been thanked: 1 time
Contact:

Re: pic18f led blink error

Post by asdf11 »

I found a power supply at 5V,
and connected it,
also connect the contacts 31 and 32,
the chip is programmed, but there is a window


Target folder: C:\Users\Public\DOCUME~1
Source name: C:\Users\Public\Documents\Flowcode1.fcfx
Title:
Description:
Device: PIC.18F.18F4550
Generated by: Flowcode v7.2.1.4
Date: Friday, November 24, 2017 09:52:57
Users: 1
Registered to:
Licence key: *****
NOT FOR COMMERCIAL USE
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe /P18F4550 /F"C:\Users\Public\DOCUME~1\Flowcode1.hex" /TPPK3 /M /OL
. . . .

*****************************************************
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............PIC18F
. . . .

Target voltage detected
Target device PIC18F4550 found.
Device ID Revision = 7
. . . . . .

Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0xff
configuration memory
Programming/Verify complete
PICKIT3 Program Report
24-lis-2017, 09:53:13
Device Type:PIC18F4550
Program Succeeded.
Operation Succeeded
. . . . . .

Launching the linker/assembler...
C:\Program Files\Flowcode 7\tools\DoNothing\DoNothing.exe

Launching the programmer...
C:\Program Files\Flowcode 7\tools\mLoader\mLoader.exe -chip 18F4550 "C:\Users\Public\DOCUME~1\Flowcode1.hex"
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Attachments
no.jpg
no.jpg (9.88 KiB) Viewed 8863 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: pic18f led blink error

Post by QMESAR »

Hi
C:\Program Files\Flowcode 7\tools\mLoader\mLoader.exe -chip 18F4550 "C:\Users\Public\DOCUME~1\Flowcode1.hex"
What are you using now for programming mloader with a Matrix programmer or PICKIT
clearly your setting as programmer are for mLoader not PICKIT ,the window you are seeing is looking for mloader and the relevant programmer

go to build>>> compiler options>>> programmer and enter the path for PICkit3 as powered for external powered

Code: Select all

/P$(chip) /F"$(outdir)$(target).hex" /TPPK3 /M /OL
also make sure you have entered the Microchip IPE path for example

Code: Select all

C:\Program Files (x86)\Microchip\MPLABX\v3.65\mplab_ipe\ipecmd.exe

User avatar
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: pic18f led blink error

Post by Benj »

Hello,

It looks like you have entered the PICkit Programmer settings in the Compiler tab.
Launching the compiler...
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe /P18F4550 /F"C:\Users\Public\DOCUME~1\Flowcode1.hex" /TPPK3 /M /OL
Flowcode does the following steps.

Compile -> Compiles C code into object code or .hex code.
Link -> Assembles object code into .hex code on some devices.
Program -> Programs .hex file to device.

For your compile stage you are calling the PICkit, the programmer stage is still calling mLoader.

asdf11
Posts: 5
Joined: Thu Nov 23, 2017 8:10 am
Been thanked: 1 time
Contact:

Re: pic18f led blink error

Post by asdf11 »

Hi.
I changed the compiler and the programmer.
then came the error L
next, I changed the FILE PK3CMD.exe in the folder
C:\Program Files\Flowcode 7\tools\PICkit3
Programmer pierces program
but the led never flashes.

As far as I know,
after flashing I have to press the button on the programmer pickit3,
further the microcontroller to start the program?
Or do I need to check with a multimeter the contacts and check if he gives voltage with a period of 1 second.
the led is reversed (polarity),
but the LEDs are not.

"Target folder: C:\Users\Public\DOCUME~1
Source name: C:\Users\Public\Documents\Flowcode1.fcfx
Title:
Description:
Device: PIC.18F.18F4550
Generated by: Flowcode v7.2.1.4
Date: Saturday, November 25, 2017 20:23:17
Users: 1
Registered to:
Licence key: *****
NOT FOR COMMERCIAL USE
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe /P18F4550 /F"C:\Users\Public\DOCUME~1\Flowcode1.hex" /TPPK3 /M /OL
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

*****************************************************
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............PIC18F
. . . .
Target voltage detected
Target device PIC18F4550 found.
Device ID Revision = 7
. . . . . . .
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0xff
configuration memory
Programming/Verify complete
PICKIT3 Program Report
25-lis-2017, 20:23:55
Device Type:PIC18F4550
Program Succeeded.
Operation Succeeded
. . . . . .

Launching the linker/assembler...
C:\Program Files\Flowcode 7\tools\DoNothing\DoNothing.exe

Launching the programmer...
C:\Program Files\Flowcode 7\tools\PICkit3\PK3CMD.exe -P18F4550 -FFlowcode1.hex -E -M -Y -L
. . . .
Connecting...
PICkit 3 detected
Connecting to PICkit 3...

Firmware Suite Version...... 01.51.06
Firmware type......................PIC18F

PICkit 3 Connected.
. .
Target Detected

Device ID Revision = 00000007

Erasing ...
Erase device complete
. . . . . . . . . . . . . . . . . .
Programming Device ...
Programming/Verify complete
. . . . . .
Verifying Device ...
Verify complete

FINISHED"
Attachments
led.jpg
led.jpg (101.53 KiB) Viewed 8840 times

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: pic18f led blink error

Post by medelec35 »

It looks like chip has been successfully programmed.
Issue could be configuration settings or/and hardware.
We would have more of a clue if you posted your flowchart.


Martin
Martin

asdf11
Posts: 5
Joined: Thu Nov 23, 2017 8:10 am
Been thanked: 1 time
Contact:

Re: pic18f led blink error

Post by asdf11 »

this is my circuit on a development Board,
voltage 33 contact outputs about 1.4 V
I'll try to install an older version flowcode
or to flash microcontroller using mplab
Attachments
breadboard.jpg
breadboard.jpg (100.7 KiB) Viewed 8825 times

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: pic18f led blink error

Post by medelec35 »

As I have previously stated, issue could be your configuration settings?
If your not willing to post flowchart then we are unable to determine if that is the case or not.

Martin
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: pic18f led blink error

Post by kersing »

asdf11 wrote:Hi.
I changed the compiler and the programmer.
... some text removed ...
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files\Microchip\MPLABX\v4.05\mplab_ipe\ipecmd.exe /P18F4550 /F"C:\Users\Public\DOCUME~1\Flowcode1.hex" /TPPK3 /M /OL
This is not the compiler. The compiler would have a C file as input, not a HEX file.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

asdf11
Posts: 5
Joined: Thu Nov 23, 2017 8:10 am
Been thanked: 1 time
Contact:

Re: pic18f led blink error

Post by asdf11 »

Yes,
You're right.
The whole thing was in the settings of the flowcode and programmer.
I installed version 6 of the program
and began to change the settings of the programmer, the compiler and the linker.
the LED flashed.
now I look at him and am happy.
:D

Post Reply