- avr16_V120.zip
- avr16
- build.dep
- adc.P
- applic.P
- dbgext.P
- debugger.P
- delay.P
- eeprom.P
- fpga_cfg.P
- fpgassi.P
- kernel.P
- Motor.P
- robolayer.P
- serapp.P
- Timer0.P
- typeconv.P
- Uart.P
- xcs_cfg.P
- build.err
- build.lst
- adc.lst
- applic.lst
- dbgext.lst
- debugger.lst
- delay.lst
- eeprom.lst
- fpga_cfg.lst
- fpgassi.lst
- kernel.lst
- kernel.map
- Motor.lst
- robolayer.lst
- serapp.lst
- Timer0.lst
- typeconv.lst
- Uart.lst
- xcs_cfg.lst
- build.obj
- adc.o
- applic.o
- dbgext.o
- debugger.o
- delay.o
- eeprom.o
- fpga_cfg.o
- fpgassi.o
- kernel.elf
- kernel.o
- kernel.obj
- Motor.o
- robolayer.o
- serapp.o
- Timer0.o
- typeconv.o
- Uart.o
- xcs_cfg.o
- build.rom
- kernel.eep
- kernel.rom
- cfg
- compile.in
- compileflags.in
- env.in
- hw.in
- srcobj.in
- swdef.in
- kernel_elf.aps
- kernel_elf.aws
- license.txt
- makefile
- src
- applic
- debug
- includes
- periphext
- periphint
- Utils
|
/***************************************************************************
Project: AVRILOS
Title: SST 49F020A Flash memory
Author: Ilias Alexopoulos
Version: 2.00
Last updated: 28-Oct-2010
Target: NA
File: sst.c
* Support E-mail:
* avrilos@ilialex.gr
*
* license: See license.txt on root directory (CDDL)
*
* DESCRIPTION
* Flash SST 49F020A access routines using LPC bus
*
***************************************************************************/
#include "../includes/types.h"
#include "../includes/settings.h"
#include "../periphext/lpc.h"
#include "sst.h"
void f_SSTWrite(INT32U addr, INT8U data)
{
f_LPC_Write(0x00005555,0xAA);
f_LPC_Write(0x00002AAA,0x55);
f_LPC_Write(0x00005555,0xA0);
f_LPC_Write(addr,data);
}
INT16U f_SSTID(void)
{
INT16U id;
/* Enter ID Mode */
f_LPC_Write(0x00005555,0xAA);
f_LPC_Write(0x00002AAA,0x55);
f_LPC_Write(0x00005555,0x90);
/* Get ID */
id = f_LPC_Read(0x00000001);
id = (id << 8) | f_LPC_Read(0x00000000);
/* Exit ID Mode */
f_LPC_Write(0x00005555,0xF0);
return id;
}
/* 49F020 has 16 blocks (16KB each block -> 4 sectors 4KB each Sector) */
void f_SSTErase(INT16U base_addr, INT8U type)
{
INT32U addr = base_addr;
f_LPC_Write(0x00005555,0xAA);
f_LPC_Write(0x00002AAA,0x55);
f_LPC_Write(0x00005555,0x80);
f_LPC_Write(0x00005555,0xAA);
f_LPC_Write(0x00002AAA,0x55);
if (type == c_SSTBLKERASE) f_LPC_Write(addr, 0x50);
else if (type == c_SSTSECERASE) f_LPC_Write(addr, 0x30);
else if (type == c_SSTCHIPERASE) f_LPC_Write(addr, 0x10);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
More than 15 year of Embedded Systems development designing both hardware & software.
Experience with Product Development,lab prototypes and Automated Testers, Sensors, motors and System Engineering. Have used numerous micro-controllers/processors, DSP & FPGAs.
Please check
AI ZeroCaliber if you need any help.
You may find also my personal site:
Ilialex and my blog site:
Ilialex Blog