Hello
I was thinking that you are working on 16f or 18f series
Yes that good idea don’t track asm codes if you turn to dspic MCU
Its very hard to study asm command when you move to new series of micro controllers
About me during my business trip like ARM, renesas ,AVR , PIC its very hard to study asm command for every MCU you working with we have to study only C programming and looking for good compiler use it after PIC 18f series I have moved to renesas MCU
Belong to Renesas Technology Corp Visit
www.America.Renesas.comH8 microcontrollers are designed to
deliver high throughput for excellent
application performance.
For example, their CISC CPU cores
execute most instructions in just one
clock cycle, and their Advanced
Data Management peripherals
utilize a 3-bus architecture to speed
data transfers.
Also, the on-chip Flash can be
accessed in a single cycle, achieving
the best possible performance
per MHz
any way don’t use an old trick if your mcu is dspic its doesn’t work
and mikroC don’t have directive for allocation rom during compilation time
but like CCS compiler
#rom 0x200={1,2,3,45}
flash_write function working fine for update your data in flash memory and flash_read function also working well for retrieve data belong to this exam:
unsigned int iArr[64] = {'m', 'i', 'k', 'r', 'o', 'E', 'l', 'e', 'k', 't', 'r', 'o', 'n', 'i', 'k', 'a'};
char cArr[] = "supercalifragillisticexpialidotiousABCDEFGHIJKLMNOPRSTUVWXYZ1234";
char cArr2[64];
void * pv1;
void main() {
unsigned i, k;
AD1PCFG = 0xFFFF;
PORTB = 0x0004;
TRISB = 1;
for(i=16;i<64;i++)
iArr[i] = 'x';
for(i=64;i<192;i++)
cArr[i] = 'y';
// press RB0 to continue
while (!PORTB.f0)
;
//--- erase the block first
Flash_Erase(0x006400);
//--- now for some non-compact flash-write
pv1 = iArr;
Flash_Write(0x006500, pv1);
PORTB = 0x0008;
//--- write compact format to flash
pv1 = cArr;
Flash_Write_Compact(0x006400, pv1);
PORTB = 0x0010;
//--- read compact format
pv1 = cArr2;
Flash_Read_Compact(0x006400, pv1, 64);
pv1[64] = 0; //termination
//--- show what has been written
i = 0;
Uart1_Init(9600);
Uart1_Write_Char('s'); Uart1_Write_Char('t'); Uart1_Write_Char('a'); Uart1_Write_Char('r');
Uart1_Write_Char('t'); Uart1_Write_Char(10);
while(cArr2[i])
Uart1_Write_Char(cArr2[i++]);
PORTB = 0x0018;
}//~!
regards Eng amar