mc9rs08ka8

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

mc9rs08ka8

1,231件の閲覧回数
Kaibigan
Contributor I

Hi,

 

Am relatively new to the freescale devices and would like some advice. I would like to store some data in the Flash area (constant values) and am a little confused on how to do it. How would i store data in the flash area ?

 

Much appreciated

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,045件の閲覧回数
bigmac
Specialist III

Hello, and welcome to the forum.

 

The programming of non-volatile parameters from within the user code is not really practical for MC9RS08 devices.  To do so would require the switching of an external programming voltage.

 

A portion of the programming code then needs to be run from RAM.  This code is relatively complex, and must generate critical timing intervals.  The incorrect timing may permanently damage the flash memory.  In addition, the programming of non-volatile parameters could be done only once because the only erase process available is a mass erase (which would also erase your code).

 

To do what you require, the use of a suitable MC9S08 device would be a far better choice.

  1. The programming voltage is internally generated.
  2. Some RAM based code is still required, but this is somewhat simpler, and does not require the generation of critical timing intervals.
  3. A page erase process is available, allowing the non-volatile parameters to be changed.

 

Regards,

Mac

 

0 件の賞賛
返信

1,045件の閲覧回数
Kaibigan
Contributor I

BigMac,

 

Not exactly what i was trying to do, i want to store some data in the flash area at compile time and then read them during program execution via a flash pointer, what i am struggling with is how to tell the compiler to store values in the flash area ie. config paramters for a radio device, i don't want to use ram space for what are constant values.

 

The device i am using is MC9RS08KA8.

 

Regards

 

0 件の賞賛
返信

1,045件の閲覧回数
bigmac
Specialist III

Hello,

 

Assuming you are coding in C, simply define the variable name as constant, and specifiy a value for the variable.

 

const byte cvar1 = 10;

const word cvar2 = 1000;

 

Of course, more complex data types such as arrays and structures, are also possible.  Another possibility, where the parameter of a function is a byte pointer to a string, the following string data is implicitly constant:

 

LCD_send( "MAIN MENU");

 

I always like to then verify that the variable has been placed in flash memory, by examining the project map file.

 

Regarda,

Mac

 

0 件の賞賛
返信

1,045件の閲覧回数
J2MEJediMaster
Specialist I

This topic gets discussed a lot in this forum. Use the search box at the upper right and try search phrases such as "flash programming" or "program flash" to display conversations on this subject. Also, when you do ask a question, please specify the part that you are using, as the programming techniques can vary.

 

---Tom

0 件の賞賛
返信