DSPRelated.com
Forums

Data flash

Started by dibosco March 28, 2003
I have a few questions on data flash:

1. Is the "XMEMORY" dialogue box that comes up in Codewarrior when
you select "Data | View Memory" showing what's in Data Flash from
0x2000 (for the 807)? I've got an 807EVM and Codearrior, btw.

2. Can anyone see why the following simple routine might not be
programming the data flash? I've followed the instructions in section
5.10.1 of the manual to no avail. (Missgin out step 3 as I'm not
bothered about interrupts at the moment.)

char ProgramFlash(int FlashData,int FlashAddress)
{

if ((DFIU_CNTL & 0x3F) == 0) // Ensure flash is idle
{
DFIU_PE |= 0x4000; // Set IPE bit
DFIU_ADDR = (FlashAddress + DATA_FLASH_BASE); // Write the flash
address to be written to
DFIU_DATA = FlashData; // then the word to be written
while ((DFIU_CNTL & 0x8000) == 1); // Wait until the busy flag is
cleared
return 1;
}
else
{
return 0;
}
}

3. Finally, does anyone have an algorithm for reading data flash?
There doesn't seem to be anything in the manual about it.

Cheers,

Rob.



RE: [motoroladsp] Data flash

See embedded comments!

Also need to clear the IPE bit when done.

Jerry.

> -----Original Message-----
> From: dibosco [mailto:R...@apostrophe.org.uk]
> Sent: Thursday, March 27, 2003 5:27 PM
> To: m...@yahoogroups.com
> Subject: [motoroladsp] Data flash
>
>
> I have a few questions on data flash:
>
> 1. Is  the "XMEMORY" dialogue box that comes up in Codewarrior when
> you select "Data | View Memory" showing what's in Data Flash from
> 0x2000 (for the 807)? I've got an 807EVM and Codearrior, btw.

Yes, assuming you are in internal address mode (EX=0).

>
> 2. Can anyone see why the following simple routine might not be
> programming the data flash? I've followed the instructions in section
>  5.10.1 of the manual to no avail. (Missgin out step 3 as I'm not
> bothered about interrupts at the moment.)
>
> char ProgramFlash(int FlashData,int FlashAddress)
> {
>
>       if ((DFIU_CNTL & 0x3F) == 0)                    //
>       // Ensure flash is idle

        DFIU_CNTL also has the busy bit in it,
        if (!(DFIU_CNTL & 0x803F))

>               {
>               DFIU_PE |= 0x4000;                             
>       // Set IPE bit

        DFIU_PE needs the Row Number in it in addition to IPE enable.
                DFIU_PE = ((FlashAddress & 0x7fff) >> 8) | 0x4000;

>               DFIU_ADDR = (FlashAddress  + DATA_FLASH_BASE); 
>               // Write the flash

        DFIU_ADDR is a read only register!!!
        you write to flash by writing the data into the actual address.
        *FlashAddress = FlashData;

> address to be written to
>               DFIU_DATA = FlashData;                         
> //  then the word to be written

                DFIU_DATA is a read only register!!!

>               while ((DFIU_CNTL & 0x8000) == 1);      // Wait

        The above will never be equal to 1!!!
                while (DFIU_CNTL & 0x8000) ; or ((DFIU_CNTL & 0x8000) == 0x8000)

> until the busy flag is
> cleared
>               return 1;
>       }
>       else
>       {
>               return 0;
>       }
> }

> 3. Finally, does anyone have an algorithm for reading data flash?
> There doesn't seem to be anything in the manual about it.

        just read the data:  value = *FlashAddress;
>
> Cheers,
>
> Rob.
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Your own Online Store Selling our Overstock.
> http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/PNArlB/TM
> --------------------------
> -------~->
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only
> the author of this message will receive your answer.  You
> need to do a "reply all" if you want your answer to be
> distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join:  m...@yahoogroups.com
>
> To Post:  m...@yahoogroups.com
>
> To Leave: m...@yahoogroups.com
>
> Archives: http://www.yahoogroups.com/group/motoroladsp
>
> More Groups: http://www.dsprelated.com/groups.php3

>
> " TARGET="_blank">http://docs.yahoo.com/info/terms/
>
>
>
> ______________________________________________________________
> __________
> This email has been scanned for all viruses by the MessageLabs SkyScan
> service. For more information visit http://www.messagelabs.com
> ______________________________________________________________
> __________
>


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information visit http://www.messagelabs.com
________________________________________________________________________