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

write program memory PIC18F67K90

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ian kenway



Joined: 31 Mar 2011
Posts: 2

View user's profile Send private message

write program memory PIC18F67K90
PostPosted: Fri Apr 01, 2011 9:45 am     Reply with quote

I've written a small program to test the Write_Program_Memory command but when I compile it (PCH V4.116) no code is generated for the command. Has anybody else had this problem, and if so how was it resolved ?

Here is the program
Code:

#include <c:\program files\picc-h\devices\18F67k90.h>
#fuses HSM,PLLEN,WDT2048,BBSIZ1K
#use delay(clock=32000000)
#use rs232(baud=9600, xmit=PIN_D4, rcv=PIN_D3)

byte data_buffer[128];

void main(void) {

     write_program_memory(0xa00,data_buffer,128);

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 01, 2011 12:37 pm     Reply with quote

I agree, it's not there. It just returns. I compiled your program with
vs. 4.119 and it is there in that version. Do you have the possibility of
upgrading ?
ian kenway



Joined: 31 Mar 2011
Posts: 2

View user's profile Send private message

PostPosted: Sun Apr 03, 2011 12:11 pm     Reply with quote

Thanks for that, I'll upgrade my compiler
gip_mad



Joined: 23 Aug 2008
Posts: 24
Location: Italy

View user's profile Send private message Visit poster's website

PostPosted: Fri May 20, 2011 11:28 am     Reply with quote

Hi, I have the same exact problem here with a PIC 18F2480, but with compiler version 4.120... this is the lst output:

Code:

....................                   write_program_memory(addr, data, count);
3D20:  MOVFF  4E,FF8
3D24:  MOVFF  4D,FF7
3D28:  MOVFF  4C,FF6
3D2C:  CLRF   FEA
3D2E:  MOVLW  57
3D30:  MOVWF  FE9
3D32:  MOVFF  56,77
3D36:  RCALL  3A2E


but there is no code at memory location 3A2E...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 20, 2011 11:42 am     Reply with quote

It probably really is there, it's just that the compiler is not showing it to you.
To make it show you the code, edit the 18F2480.h file and comment out
the #nolist statement at the top of the file. Example:
Quote:

//////// Standard Header file for the PIC18F2480 device ////////////////
#device PIC18F2480
//#nolist

Then re-compile and look for the code in the .LST file.
gip_mad



Joined: 23 Aug 2008
Posts: 24
Location: Italy

View user's profile Send private message Visit poster's website

PostPosted: Fri May 20, 2011 11:48 am     Reply with quote

Thank you, now I see it... So I guess my problem is different. The PIC resets at that exact function (I tried placing a putc before and after). Do you have any hints? (do I have to open a new topic?)
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 20, 2011 11:58 am     Reply with quote

Start a new topic and post a very small and compilable test program.
It has to be a complete program with #include, #fuses, #use delay, etc.
But less that 20 lines, if you can show the problem with that few lines.
gip_mad



Joined: 23 Aug 2008
Posts: 24
Location: Italy

View user's profile Send private message Visit poster's website

PostPosted: Sun May 22, 2011 2:54 am     Reply with quote

Nevermind, I got it working with this bootloader:
https://www.ccsinfo.com/forum/viewtopic.php?t=39179
Thank you anyway!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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