cancel
Showing results for 
Search instead for 
Did you mean: 

ST7 assembler

chill_just_chill
Associate II
Posted on April 02, 2003 at 00:18

ST7 assembler

6 REPLIES 6
chill_just_chill
Associate II
Posted on March 30, 2003 at 11:29

Hi everybody,

I have some questions.

1. I need to declare an array of 255 bytes in the ROM of the ST7. How can I do that? And how can I use it?

2. I need to program the EEPROM of the ST7c2334 and the FLASH. I have to write all '0' and all '1' and then read it again. How can I do that?

thanks

Chr
yu-jun
Associate II
Posted on March 31, 2003 at 00:31

First question

#pragma INTO_ROM

const char data[256] =

{

...

}
yu-jun
Associate II
Posted on March 31, 2003 at 00:52

second question

1. set LAT bit in CSR of EEPROM, then write all ''0'' or ''1'',

2. After you finish the write operation, you set PGM bit in CSR of EEPROM

until PGM become 0.

3. clear LAT bit ,you can read the EEPROM
yu-jun
Associate II
Posted on March 31, 2003 at 01:05

Sorry!, first question my reply is C code assembler is:

segment 'rom'

.data DC.B $10,$AA,$00,$BB,50,%11111101,10,$FF

DC.B ...

chill_just_chill
Associate II
Posted on April 01, 2003 at 15:01

Quote:

On 2003-03-31 04:22, DiDiDuDu wrote:

second question

1. set LAT bit in CSR of EEPROM, then write all ''0'' or ''1'',

2. After you finish the write operation, you set PGM bit in CSR of EEPROM

until PGM become 0.

3. clear LAT bit ,you can read the EEPROM

How can I set that bit ?

the EECSR is on adress $002C

So I should do : bset $002C,#1 ?

And how do I write?

The EEprom is on 0C00h

=> ld A,#00

ld 0C00h,A

ld OCO1,A

...

?

And how can I program the flash memory?

thank you

Christophe
yu-jun
Associate II
Posted on April 02, 2003 at 00:18

bset $002C,#1 ;Set LAT bit to write mode

ld A,#00

ld 0C00h,A

ld OCO1,A

...

bset $002C,#0 ;Set PGM bit to program

.WAIT

BTJF $002C,#0,OVER ;Wait PGM bit be cleared by harewre

JRA WAIT

.OVER

In your sources you can not program the flash memory.