|
|
View previous topic :: View next topic |
Author |
Message |
moutinho
Joined: 12 May 2005 Posts: 31 Location: BRAZIL
|
write_program_memory() problems and possible alternative |
Posted: Wed May 25, 2005 3:56 pm |
|
|
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
|
|
Posted: Thu May 26, 2005 1:28 am |
|
|
Check the device datasheet pages 68 and 70 for an alternative. |
|
|
Ttelmah Guest
|
|
Posted: Thu May 26, 2005 5:54 am |
|
|
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 |
|
|
|
|
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
|