CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Can't program >640 instructions to PIC18F47K40 w/ ICD-U64
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

Can't program >640 instructions to PIC18F47K40 w/ ICD-U64
PostPosted: Mon Dec 19, 2016 3:09 pm     Reply with quote

Got another PIC18F47K40 programming problem.

CCS - 5.065
CCSLoad - software 5.035, firmware 3.19, hardware rev.3

I can't seem to program more than 640 instructions to this chip with CCSLoad and ICD-U64

Code with exactly 640 instructions
Code:

#include <18F47K40.h>
#device ADC=10

#FUSES NOEXTOSC                 //External Oscillator not enabled

#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O

#FUSES NOWDT,NOPROTECT

#use delay(internal=4MHz)

#USE RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, STREAM = pc)

//========================================================================================================================


void main() {
   
   while(1)   {
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxx11");
   
   output_high(pin_a0);
   }
}

Code with 641 instructions
Code:

#include <18F47K40.h>
#device ADC=10

#FUSES NOEXTOSC                 //External Oscillator not enabled

#FUSES NOMCLR                   //Master Clear pin used for I/O
#FUSES NOBROWNOUT               //No brownout reset
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O

#FUSES NOWDT,NOPROTECT

#use delay(internal=4MHz)

#USE RS232(BAUD=9600, XMIT=PIN_C6, RCV=PIN_C7, STREAM = pc)

//========================================================================================================================


void main() {
   
   while(1)   {
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
   fprintf(pc, "xxxxxxxxxxxxxxxxx1122");
   
   output_high(pin_a0);
   }
}

-I only added the "22"

I get a verification error if more than 640 instructions. Verification results say from address 000004F2 to 000004FF actual is FF(not programmed).

With 640 instruction pin A0 goes high. With 641 it does not. Confirming that its not getting programmed past 640 instructions.

I've tried multiple chips and same thing. Didn't check to see if its always 640 instruction on them all though, just that I do get a verification error on a large file. I also use this programmer on other PIC chips and it works fine.

I do have a workaround for now. Its an inconvenience but at least I can continue. If I load the same hex created by the CCS IDE into microchips IPE (Integrated Programming Environment)V3.50 and use the pickit programmer is works fine.

I don't see anywhere in this forum where anyone has used the PIC18F47K40. Is this because its a newer chip or some other reason?


Last edited by mob1182 on Sat Jan 21, 2017 6:55 pm; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 19, 2016 3:33 pm     Reply with quote

Any chance you've got a 'demo' or 'student' version of the software ?
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Mon Dec 19, 2016 3:44 pm     Reply with quote

Nope paid full price for the PCWH plus a maintenance plan. You think I should put a support ticket in?
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 19, 2016 5:00 pm     Reply with quote

hmm silly question
have you tried another PIC ? like a 16F84, 18F46k22, etc. ?

same program, just different PIC.....

Jay
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Mon Dec 19, 2016 5:06 pm     Reply with quote

Yep I used the same program on a PIC18F4685 with no problems
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Mon Dec 19, 2016 7:18 pm     Reply with quote

Try downgrading the programmer's FW from 3.19 to something earlier. I've been bitten, many times, by a CCS programmer FW upgrade.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 20, 2016 6:39 am     Reply with quote

I'm thinking it has to be CCSLoad.

Since the compiled code works, not a compiler problem
Since the code runs(once in) not a 'newPIC' issue
What's left is CCSLoad.
Interesting number 640 though. I recal ,decades ago, having an issue with '640', though what it is escapes me now.....

I'd email CCS about it ASAP....

Jay
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Tue Dec 20, 2016 11:52 am     Reply with quote

Thanks everyone! I sent an email to CCS and will let you know what they say.
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 5:02 pm     Reply with quote

@mob1182. Can you update the solution to this specific issue you mentioned last month.

I see you've been also having issues with I2C, CCP on later posts.

I've been dealing with CCS support for another member of the K40 family. Seems like the entire K40 family needs TLC. Apparently they are releasing a compiler update and CCSload firmware as well after the weekend. Hope that solve the tons of issues i am having with 18F66K40. Just saw your posts and i am guessing as you were able to move forward that they solved the verification error only for 48K40 last month.
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 5:51 pm     Reply with quote

Hey NAR. I sent CCS an email about this but never heard anything back regarding this issue.

I also have a Pickit 3 so my solution was to download and use the IPE from microchip, not the IDE. Although if I'm remembering correctly I believe the IPE and IDE are in one download package. I use CCS to compile the hex and upload it to the IPE and program with the pickit.

I'm sorry to hear you are also having problems but it's also comforting knowing its not just me. Looking forward to the update from CCS after the weekend!
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 6:15 pm     Reply with quote

Thanks for the quick reply. Makes sense to use the IPE. I only have the ICD-U80 at the moment. Been wanting to even try the code in MPLAB IDE just to check but if the problem in the programmer then guessing it would be the same.

Timer Interrupts sometimes stop working after including new (unrelated) code and re-compiling/loading. I think they will release the debugger for the chip after the weekend also. A new issue that i just isolated; my interrupts dont fire if i use a Receive buffer for UART in the #use statement!! Still yet to test I2C and CCP which are needed but hoping this new update will resolve everything.
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 6:25 pm     Reply with quote

Interesting. I wonder if this has anything to do with the access ram and banked ram thing PCM was talking about.

Also, the errata about TBLRD Ttelmah found is also a concern. In this case I wonder if CCS will even fix a bug that's not really their fault.

It seems all the K series had the TBLRD issue with earliest revs

Errata link for your chip...
http://ww1.microchip.com/downloads/en/DeviceDoc/80000714B.pdf

I can get the Master mode for I2C to work fine. So working with EEPROMS is no prob. And I decided to use rs485 instead of Master to multiple I2C slave pics. Went to a pic18F67k40 and had the same issue with the CCP, and same solution
NAR



Joined: 01 Dec 2016
Posts: 17
Location: IL, USA

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 6:42 pm     Reply with quote

Will have to check the Rev. This is a batch of circuits that was just fabricated, unless the PCB house used older stock!
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sat Jan 21, 2017 6:48 pm     Reply with quote

There is a reason i use socketed 40 and 28 pin parts-
where board size and I/O pins is not an issue... Shocked Shocked
mob1182



Joined: 03 Mar 2016
Posts: 28

View user's profile Send private message

PostPosted: Sat Jan 21, 2017 6:51 pm     Reply with quote

They are fairly new chips. I think they came out June of 2016 so its possible. I just ordered a few from digi-key this week and they all came in at rev A2
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group