Problem to program 24F16KA101

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Problem to program 24F16KA101

Post by Mathy »

Hello !

I try to program a 24F16KA101 with my PICKIT2 tool.

First problem : I can't compile to chip, Flowcode report me an error.

Second one : When I import the hex file, the pickit 2 software tells me : Warning : some configuration words not in hex file.
Ensure default values above right are acceptable.

Third : If I ignore this message, the pickit 2 sofware return me : verification of configuration failed.

My program only try to blink a led to verify if the configutation word works with internal oscillator at 8 x 4PLL = 32 Mhz.

Thank you for your help :)

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times

Re: Problem to program 24F16KA101

Post by Sean »

Can you post a copy of your program and/or the error message?

I have compiled several different led flashing programs for this device (using I/O and the LED component), but have not receive any compilation errors.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

The compile to Hex works well, but to chip don't ( and it's works with Flowcode for PIC 8 bit )

So i try to program with the pickit2 Software with the hex file generated by Flowcode with the problem I described.
Attachments
Flowcode1.fcf_pic16
(4 KiB) Downloaded 351 times

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: Problem to program 24F16KA101

Post by Benj »

Hello,

If you click Chip -> Compiler settings then check your programmer settings are specified correctly as shown below.

--PICkit 2 Settings

C:\Program Files\Matrix Multimedia\Flowcode PIC16BIT V4\Tools\PICkit2\pk2cmd.exe
-BC:\Program Files\Matrix Multimedia\Flowcode PIC16BIT V4\Tools\PICkit2\ -P%a -F%f.hex -M -R

--PPP Config settings

C:\Program Files\Matrix Multimedia\Flowcode PIC16BIT V4\Tools\PPP\PPPv3.exe
-cs 1 -chip %a -config

If these settings are correct then please can you post up the compiler output messages so we can see the error PICkit is reporting.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Hi !

The directory path are not exactly the same but the settings....yes.

Just one thing, by default on the ppp config settings, the parameters are : -chip %a -config
If I change by -cs 1 -chip %a -config, there is no diffrence.

Below, you can see the cut.paste of the flowcode message :

Code: Select all

Launching the compiler...
C:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\Tools\MX_bats\pic16_C30_comp.bat "Flowcode1" "C:\DOCUME~1\ADMINI~1\Bureau\COTCAM~1" 24F16KA101

C:\Documents and Settings\Administrateur\Bureau\Cot‚ cam‚ra>pic30-gcc -c -mcpu=24F16KA101 -funsigned-char -fno-short-double -Os -I"C:\PROGRA~1\MATRIX~1\FLOWCO~4\Tools\MX_bats\..\C_tools\support\h" -I"C:\PROGRA~1\MATRIX~1\FLOWCO~4\Tools\MX_bats\..\MX_support" -Wall -std=gnu99 "Flowcode1".c -o "Flowcode1".o 

Compilation successful!

Return code = 0

Launching the linker/assembler...
C:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\Tools\MX_bats\pic16_C30_link.bat "Flowcode1" 24F16KA101 PIC24F

C:\Documents and Settings\Administrateur\Bureau\Cot‚ cam‚ra>pic30-gcc -Wl,"Flowcode1".o,-L"C:\PROGRA~1\MATRIX~1\FLOWCO~4\Tools\MX_bats\..\C_tools\lib",--heap=256,--report-mem,--script="C:\PROGRA~1\MATRIX~1\FLOWCO~4\Tools\MX_bats\..\C_tools\Support\PIC24F\gld\p24F16KA101.gld",-o"Flowcode1".cof 


Program Memory  [Origin = 0x200, Length = 0x29ff]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.text                        0x200               0x5aa           0x87f  (2175)
.const                       0x7aa                 0x4             0x6  (6)
.text                        0x7ae               0x65c           0x98a  (2442)
.dinit                       0xe0a                 0x2             0x3  (3)
.isr                         0xe0c                 0x2             0x3  (3)

                     Total program memory used (bytes):         0x1215  (4629) 28%


Data EEPROM Memory  [Origin = 0x7ffe00, Length = 0x200]

section                    address   length (PC units)   length (bytes) (dec)
-------                    -------   -----------------   --------------------
.eedata                   0x7ffe00                 0x2             0x2  (2)

                        Total data EEPROM used (bytes):            0x2  (2) <1%


Data Memory  [Origin = 0x800, Length = 0x600]

section                    address      alignment gaps    total length  (dec)
-------                    -------      --------------    -------------------
.heap                        0x800                   0           0x100  (256)

                        Total data memory used (bytes):          0x100  (256) 16%


Dynamic Memory Usage

region                     address                      maximum length  (dec)
------                     -------                      ---------------------
heap                         0x800                               0x100  (256)
stack                        0x900                               0x500  (1280)

                        Maximum dynamic memory (bytes):          0x600  (1536)


C:\Documents and Settings\Administrateur\Bureau\Cot‚ cam‚ra>pic30-bin2hex "Flowcode1".cof 

C:\Documents and Settings\Administrateur\Bureau\Cot‚ cam‚ra>pic30-objdump -S "Flowcode1".cof  1>"Flowcode1".asm 

HEX file creation successful!

Return code = 0

Launching the programmer...
C:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\tools\PICkit2\pk2cmd.exe -BC:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\tools\PICkit2\ -PPIC24F16KA101 -FFlowcode1.hex -M -R
Could not find device PIC24F16KA101.



Return code = 36

Flowcode a été incapable de transférer l'algorigramme dans le microcontrôleur. Vérifier les options du programmateur et la connexion physique.

FINISHED
Thank you for your help :)

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

But the programmer is well connected to my board and I can read the microcontroler with the pickit 2 software, I can erase it etc etc so the electric connection are OK.
Attachments
pickit2.jpg
pickit2.jpg (141.39 KiB) Viewed 11538 times

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

I have no interraction between the pickit 2 programmer and flowcode.

The target and busy LED stay off. When I use the pickit 2 software, everything goes well but there is a problem of fuse.

I don't have this problem with the PIC 8 bit release who works ok on the same PC.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

In the Flowcode Pickit 2 directory. There is a file : PK2DeviceFile.dat

In this file, there is nothing about 24f16ka101.

That is why I receive an error message by flowcode I think.

If I replace this file by the one present in the Microchip directory ( where 24f16ka101 exist ), Flowcode tells me : PK2DeviceFile.dat device file requires an update of pk2cmd.

How to fix the problem ?

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: Problem to program 24F16KA101

Post by Benj »

Hello,

Where did you get the update for the dat file from? You should also be able to get the updated PKCMD.exe from the same location. If not then it will be included inside the latest release of MPLAB.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

I get the update from the pickit2 microchip directory.

I don't have MPLAB. Thank you for the tips. I will try in fiw minutes.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Noway,

PK2CMD isn't installed with MPLAB. Only pickit2V2.exe

I can download PK2CMD from the microchip website : http://ww1.microchip.com/downloads/en/D ... Dv1-20.zip

But It is the same version who report me the same problem.

I have to buy a pickit 3 ?

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: Problem to program 24F16KA101

Post by Benj »

Hello,

The PK2CMD should be located here in the MPLAB install.

C:\Program Files\Microchip\MPLAB IDE\Programmer Utilities

One alternative is to load the standard PICkit 2 programming software and then use the button at the bottom of the window to monitor the source hex file you are using. What this does is check to see when the hex file changes. As soon as the change is detected the PICkit will send the new hex file to the device. Beats having to manually load the file each time. I would say the PK2CMD is more functional then the PK3 version and from the reports I've seen the PK2 is the more reliable and faster device even if it does not support as many of the newer chips.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

I found PK2CMD nowhere in the entire MPLAB directory ( MPLAB 8.66 )

I made a research on my C:\ and PK2CMD seams to be only in the Matrix Multimedia directory.

I only found PK3CMD in the MPLAB directory.

If I use the pickit 2 programming software, I always have the message I described on my first post.
I attached a picture.

I would like to use the 8Mhz internal oscillator + the x4 PLL = 32 Mhz
I add this code at the top of the program :

Code: Select all

OSCCON=0x1120;
OSCTUN=0x0000;
But my LED doesn't blink. I don't know where my problem comes from ?
The pickit 2 error message of my C code ?

Thank your for your time.

Mathy.
Attachments
pk2.jpg
pk2.jpg (153.06 KiB) Viewed 11498 times

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: Problem to program 24F16KA101

Post by Benj »

Hello,

I'm ordering one of these chips now and hopefully it will be here in the next day or so and I will be able to provide better support to get this working for you.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Oh that's very nice! Thank you!
I should test it before...I have already made a board with this PIC ...

I choose him because of the two USART and the very small package ( ssop20 ).

See you soon ;-)

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Hi :)

Any news ?

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: Problem to program 24F16KA101

Post by Benj »

Hello,

Still not had these devices in at the moment. I'll let you know as soon as they come in. Shouldn't be much longer.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Hi !

Any news about my problem ?

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: Problem to program 24F16KA101

Post by Benj »

Hello,

These devices came in today and I have been able to replicate your problem

Launching the programmer...
C:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\Tools\PICkit2\pk2cmd.exe -BC:\Program Files\Matrix Multimedia\Flowcode PIC24&dsPIC V4\Tools\PICkit2\ -PPIC24F16KA101 -Ffc1.hex -M -R
Could not find device PIC24F16KA101.

I will see what I can find out and see if I can get this working for you.

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: Problem to program 24F16KA101

Post by Benj »

Hello,

Right looks like I have gotten to the bottom of this. The PK2CMD tool does not support the KA range of devices. I have been online and looked at the latest version but it looks like this is still the version we included with the dsPIC version of Flowcode.

Funnily enough you cannot even program these devices via MPLAB.

Programming using the PICkit 2 stand alone software works fine.

Therefore you have two options.

1) Tell Microchip about the problem and ask for the KA devices to be supported.

2) Use my workaround where you have the PICkit 2 programming tool open and monitoring the Flowcode hex file so you do not have to manually program the device every time the hex file changes. http://www.matrixmultimedia.com/mmforum ... 422#p24071

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times

Re: Problem to program 24F16KA101

Post by Mathy »

Hello,

Thank you for your help :)

I will ask Microchip to support the 24FxxKA device on PK2CMD.

About your workaround, I have the error message I posted above.
I have a problem with the configuration words. Is it a message we have with all the 24F device ?

I am not be able to blink a LED with my device and the internal oscillator and the code I posted.
Is it possible to help me ?

Somebody already use the internal oscillator of the 24F series ?

Thank you again,

Mathy

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: Problem to program 24F16KA101

Post by Benj »

Hello Mathy,

What if you try enabling the following configuration settings?

Clock switching and monitor selection - Bottom Option both enabled.

I also think you have to do something using C code to get the PLL to fire up correctly so the clock is at 32MHz and not 8MHz. There is a good microchip white paper detailing this or I can provide help if you get stuck.

Post Reply