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 support@ccsinfo.com

write_program_memory() problems and possible alternative

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



Joined: 12 May 2005
Posts: 31
Location: BRAZIL

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

write_program_memory() problems and possible alternative
PostPosted: Wed May 25, 2005 3:56 pm     Reply with quote

Hi,

I am have problems using this function. Such as the execution halts before finishing to write the whole memory. I am trying to write between address 0x0 and 0x10000.

I have checked:
1) interrupts: placing disable code before the function
2) checked fuse configuration
3) placing the following code before write_program_memory()
#asm
bcf 3,0
#endasm


Does anyone have implemented an equivalent write_program_function() using #asm that writes a buffer into flash memory?
I am losing much time on this function and need to finish this very fast.

CCS 3.206, pic18f6720

Thanks in advance,
Andre Moutinho
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Thu May 26, 2005 1:28 am     Reply with quote

Check the device datasheet pages 68 and 70 for an alternative.
Ttelmah
Guest







PostPosted: Thu May 26, 2005 5:54 am     Reply with quote

How fast is 'very fast'?.
The fastest that the chip can be programmed, is one EEPROM block write time, for each block of memory, plus a block erase time. On a large chip, there can be 1000+ blocks, and the erase time is 2mSc, and the write time is 2mSec 'typical' for most of these latter chips. It can easily be longer. You are talking in terms of a 'best case' of perhaps 5 seconds, to write the chip, using data that is already in memory. Once you add the time to transfer the data (assuming hex transfers, typically 2.5bytes on the serial per byte written, which at 115200bps, will take just under 15 seconds to transfer, assuming 'perfect' start/stop control of the transmitter, and the handling to transfer it to the memory registers, you have a 'best case' write for the entire chip, in the order of perhaps 30 seconds.
If you then add verification, and possible re-writing, you move up to perhaps a minute.
The only way to go faster, is with an external programmer, where the entire memory can be cleared in one operation.

Best Wishes
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