View previous topic :: View next topic |
Author |
Message |
ian kenway
Joined: 31 Mar 2011 Posts: 2
|
write program memory PIC18F67K90 |
Posted: Fri Apr 01, 2011 9:45 am |
|
|
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
|
|
Posted: Fri Apr 01, 2011 12:37 pm |
|
|
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
|
|
Posted: Sun Apr 03, 2011 12:11 pm |
|
|
Thanks for that, I'll upgrade my compiler |
|
|
gip_mad
Joined: 23 Aug 2008 Posts: 24 Location: Italy
|
|
Posted: Fri May 20, 2011 11:28 am |
|
|
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
|
|
Posted: Fri May 20, 2011 11:42 am |
|
|
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
|
|
Posted: Fri May 20, 2011 11:48 am |
|
|
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
|
|
Posted: Fri May 20, 2011 11:58 am |
|
|
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
|
|
|
|