Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC

Ads

Discussion Groups

Discussion Groups | 68HC12 | how to initialze the EEPROM on MC9S12DP256?

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

how to initialze the EEPROM on MC9S12DP256? - º´ÁÖ Áø - Jan 23 7:01:00 2003


Hello

I am now using Mc9S12DP256B.

I can not initialize the Internal EEPROM of MC9S12DP256B after serveral EEPROM wrting and erasing test.

Could anyone give me how to initialize the Internal EEPROM and how many times i can rewrite the Internal EEPROM?

ByungJu JIn ---------------------------------
µðÁöÅ» Ä«¸Þ¶ó¿Í Âû¶± ±ÃÇÕ - ¾ßÈÄ! »çÁø
µ· µÇ´Â Áß°íÂ÷ ¼îÇθô - ¾ßÈÄ! ÀÚµ¿Â÷

[Non-text portions of this message have been removed]





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


RE: how to initialze the EEPROM on MC9S12DP256? - Kellogg Dave - Jan 23 9:25:00 2003

Have you read and understood the relevant manuals and data sheets? The
info is all there. In particular, you may have inadvertently placed the
part into secure mode. 607-656-2597 -----Original Message-----
From: [mailto:]
Sent: Thursday, January 23, 2003 7:02 AM
To: Motorola
Subject: [68HC12] how to initialze the EEPROM on MC9S12DP256?
Hello

I am now using Mc9S12DP256B.

I can not initialize the Internal EEPROM of MC9S12DP256B after serveral
EEPROM wrting and erasing test.

Could anyone give me how to initialize the Internal EEPROM and how many
times i can rewrite the Internal EEPROM?

ByungJu JIn ---------------------------------
µðÁöÅ» Ä«¸Þ¶ó¿Í Âû¶± ±ÃÇÕ - ¾ßÈÄ! »çÁø
µ· µÇ´Â Áß°íÂ÷ ¼îÇθô - ¾ßÈÄ! ÀÚµ¿Â÷

[Non-text portions of this message have been removed]
--------------------------------------------------------
To unsubscribe from this group, send an email to: 68HC12- To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

RE: how to initialze the EEPROM on MC9S12DP256? - º´ÁÖ Áø - Jan 24 5:07:00 2003


thanks for yout kindness
I had programed the EEPROM successfully but during my EEPROM wrintg and reding, I found Process is down. I mean Processor is broken, out of order, I can not run the processor with SDI tool.
regards
Kellogg Dave <> wrote:Have you read and understood the relevant manuals and data sheets? The
info is all there. In particular, you may have inadvertently placed the
part into secure mode. 607-656-2597 -----Original Message-----
From: [mailto:]
Sent: Thursday, January 23, 2003 7:02 AM
To: Motorola
Subject: [68HC12] how to initialze the EEPROM on MC9S12DP256?
Hello

I am now using Mc9S12DP256B.

I can not initialize the Internal EEPROM of MC9S12DP256B after serveral
EEPROM wrting and erasing test.

Could anyone give me how to initialize the Internal EEPROM and how many
times i can rewrite the Internal EEPROM?

ByungJu JIn ---------------------------------
µðÁöÅ» Ä«¸Þ¶ó¿Í Âû¶± ±ÃÇÕ - ¾ßÈÄ! »çÁø
µ· µÇ´Â Áß°íÂ÷ ¼îÇθô - ¾ßÈÄ! ÀÚµ¿Â÷

[Non-text portions of this message have been removed]
--------------------------------------------------------
To unsubscribe from this group, send an email to: 68HC12- To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu Yahoo! Groups SponsorADVERTISEMENT

--------------------------------------------------------
To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ---------------------------------
µðÁöÅ» Ä«¸Þ¶ó¿Í Âû¶± ±ÃÇÕ - ¾ßÈÄ! »çÁø
µ· µÇ´Â Áß°íÂ÷ ¼îÇθô - ¾ßÈÄ! ÀÚµ¿Â÷

[Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: how to initialze the EEPROM on MC9S12DP256? - kennykslam - Jan 26 23:14:00 2003

John,

You can take the following code as reference:

Note: printf0(....); is the error message. You can ignore.

#include <hidef.h>

#define pviol 0x20
#define accerr 0x10
#define prog 0x20
#define ccif 0x40
#define cbeif 0x80
#define erase 0x40

#define fcnfg (*((volatile unsigned char*)(0x0103)))
#define fstat (*((volatile unsigned char*)(0x0105)))
#define fcmd (*((volatile unsigned char*)(0x0106)))
#define eclkdiv (*((volatile unsigned char*)(0x0110)))
#define ecnfg (*((volatile unsigned char*)(0x0113)))
#define eprot (*((volatile unsigned char*)(0x0114)))
#define estat (*((volatile unsigned char*)(0x0115)))
#define ecmd (*((volatile unsigned char*)(0x0116)))

/*******************************************************************
* EEPROM program command subroutine
* Description : Copy from RAM area to EEPROM area
* : Input RAM,EEPROM start address and no. of word to be
* : programmed
* Example : Copy 4 words from RAM(0x1000) to EEPROM (0x600)
* input : ram_addi=0x1000, eeprom_addi=0x600, no_of word=0x4
* modify : eeprom content (0x600 to 0x608)= (0x1000 to 0x1008)
*********************************************************************/

void eeprom_program_cmd(int ram_addi, int eeprom_addi, int no_of_word)
{
int *ram_add,*eeprom_add,count=0;

ram_add=(int*)ram_addi;
eeprom_add=(int*)eeprom_addi;
eclkdiv = 0x49; //16Mhz osc

DisableInterrupts;

estat=pviol+accerr; //movb #$30,$115 ; clear
previous command error
while(count!=no_of_word)
{
*eeprom_add=*ram_add; //; get data and put it to EEPROM
ecmd=prog; //; initiate PROGRAM
COMMAND
estat=cbeif; //; begin command
if(((estat&pviol)==pviol)||((estat&accerr)==accerr))
printf0("EEprom programming error\n\r"); //display
eree_program_error
else
while((estat&ccif)==0x00); // wait for command
to complete

count++;
eeprom_add++;
ram_add++;
}
EnableInterrupts;
} /*******************************************************************
* EEPROM erase command subroutine
* Description : Erase EEPROM long word (4 bytes)
* : Input EEPROM start address and no. of word to be
* : erased
* Example : Erase 4 long words from EEPROM (0x600)
* input : eeprom_addi=0x600, no_of word=0x4
* modify : eeprom content (0x600-0x610)=0xff
*********************************************************************/

void eeprom_erase_cmd(int eeprom_addi, int no_of_long_word)
{
int *eeprom_add,count=0;

eeprom_add=(int*)eeprom_addi;
eclkdiv = 0x49; //16Mhz osc

DisableInterrupts;

estat=pviol+accerr; //movb #$30,$115 ; clear
previous command error
while(count!= no_of_long_word)
{
*eeprom_add=0; // to erase the data at EEPROM
ecmd=erase; //; initiate ERASE
COMMAND
estat=cbeif; //; begin command
if(((estat&pviol)==pviol)||((estat&accerr)==accerr))
{
printf0("EEprom programming error in \n\r"); //display
eree_program_error
hex_asc((unsigned char)(eeprom_addi>>8));
hex_asc((unsigned char)(eeprom_addi));
printf0("\n\r"); //display lf
}
else
while((estat&ccif)==0x00); // wait for command
to complete

count++;
eeprom_add+=2; //int pointer increment
eeprom_addi+=4; //eeprom_addi increment by 4 (long)
tx_char0('.');
}
EnableInterrupts;
}

BR
Kenny --- In , º´ÁÖ Áø <j2bichon@y...> wrote:
>
> Hello
>
> I am now using Mc9S12DP256B.
>
> I can not initialize the Internal EEPROM of MC9S12DP256B after
serveral EEPROM wrting and erasing test.
>
> Could anyone give me how to initialize the Internal EEPROM and how
many times i can rewrite the Internal EEPROM?
>
> ByungJu JIn > ---------------------------------
> µðÁöÅ» Ä«¸Þ¶ó¿Í Âû¶± ±ÃÇÕ - ¾ßÈÄ! »çÁø
> µ· µÇ´Â Áß°íÂ÷ ¼îÇθô - ¾ßÈÄ! ÀÚµ¿Â÷
>
> [Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )