The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

Gray Creager, 1997 following routines used interfacing Flash easily ad


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



Interfacing Xicor's X84F016/064/128 MPSFlash
Gray Creager, 1997 following routines used interfacing Flash easily adapted many different hardware platforms. debugging purposes, used conjunction with XK84 interface card. schematic this card shown Figure Depending position jumpers Flash memory-mapped into address banks determined jumper J2). Jumper determines exact address within bank. This allows address chosen following ranges: 301h-307h, 309h30Fh, 311h-317h, 319h-31Fh. single unused address selected bank (i.e. 300h, 308h, 310h, 318h) reserved flip-flop used toggle pin. This glue logic only necessary provide
AN96
generic interface Flash. such applications, much this logic already exist target card eliminated with user supplied strobe (i.e. jumper J3). This code obtained from Xicor's BBS, which reached toll free 1-800-258-8864, (408) area code internationally 1-408-943-0655. Xicor's will support 19.2K baud rate modem parity, words, stop bit, local echo). These listings found (Special Interest Group). Xicor application notes also available through Xicor's FaxBack system (408) 954-1627 World Wide URL, http://www.xicor.com).
X84F
USER
74F08 74F32 74F245
74F138 74F32 74F32 74F138 74F32
74F32 74F74
Figure XK84 Development System circuitry used verify this code with X84F064.
Xicor, Inc. 1511 Buckeye Drive Milpitas, 95035 (408) 432-8888
AN96-1
Xicor Code Xicor's X84F016/064/128 family EEPROMs (for example, save these routines file called "xicor.c") following subroutines provided interface with Xicor's family high density Flash. This code written perform with X84F016 (16K bits), X84F064 (64K bits), X84F128 (128K bits) devices. This code should also compatible with future devices this family with only trivial changes. This code tested using XK84 development system hardware, which consists standard interface card with address decoding logic shown Figure This software interfaces device that been memory mapped into this compatible space. With these subroutines, designer read multiple data bytes from X84F016/064/128 using simple function call: read_X84MPS(int no_bytes,int addr,int io_port,unsigned char *bytes) number bytes (no_bytes) read sequentially from starting address (addr) X84F016/064/128 mapped into given address (io_port). results passed back sequentially series system locations pointed (*bytes). Care should taken provide enough locations each data byte read. Additionally, sector write X84F016/064/128 initiated with following call: write_X84MPS(int addr,int io_port,unsigned char *bytes) bytes written X84F016/064/128 address (io_port) beginning sector denoted beginning address (addr). Sending more than bytes cause "wrap-around" data chosen sector should avoided. data written contained array (pointed *bytes). addition, routines have been added accessing Control Register, located FFFFh. writing data into this register (register_data) device given address (io_port), another reading data from this register, which returned value assigned user's chosen variable: write_X84MPS_register(int io_port,int register_data) read_X84MPS_register(int io_port) These routines appended other ANSI code with following similar) compiler directive: #include "c:\xicor.c"
AN96
AN96-2
Xicor Note that source code should have #include <dos.h> statement since code (xicor.c) needs access inportb() outportb() functions. Sends RESET sequence X84F016/064/128 io_port void x84reset(int io_port) inportb(io_port); read from io_port outportb(io_port,0x00); write io_port inportb(io_port); read from io_port Writes X84F016/064/128 io_port void x84write_one(int io_port) outportb(io_port,0xff); write HIGH io_port
AN96
Writes zero X84F016/064/128 io_port void x84write_zero(int io_port) outportb(io_port,0x00); write io_port*/ Reads from X84F016/064/128 io_port x84read(int io_port) bit_val; bit_val inportb(io_port) read from io_port return(bit_val); return value calling routine Polls early completion nonvolatile write cycle X84F016/064/128 io_port void x84poll(int io_port) bit_temp; bit_temp=x84read(io_port); continuously read bits until HIGH while (bit_temp Initiates completes nonvolatile write cycle X84F016/064/128 io_port
AN96-3
Xicor
AN96
void x84write_start(int io_port) x84read(io_port); read from io_port x84write_one(io_port); write HIGH io_port x84read(io_port); read from io_port x84poll(io_port); poll completion write cycle Sends required address bits, including unused upper address bits, X84F016/064/128 io_port void x84addr_send(int unused_bits,int io_port,int addr) addr_bit,mask_addr,addr_temp; (addr_bit addr_bit unused_bits; addr_bit++) x84write_zero(io_port); mask_addr 4096; loop send unused bits mask mask_addr mask_addr mask_addr isolate address 1024 X84F016 4096 X84F064 8192 X84F128
(addr_bit addr_bit (16-unused_bits); addr_bit++) addr_temp addr mask_addr; (addr_temp x84write_zero(io_port); else x84write_one(io_port); mask_addr mask_addr
loop through address bits mask determine next required address address LOW, then write io_port
otherwise, write HIGH io_port shift mask right next
Sends data bits X84F016/064/128 io_port void x84data_send(int io_port,int data) mask_data,data_temp,data_bit; mask_data 128; mask isolate data (data_bit data_bit data_bit++) loop through data bits data_temp data mask_data; mask determine next required data (data_temp data LOW, then x84write_zero(io_port); write io_port else x84write_one(io_port); otherwise, write HIGH io_port mask_data mask_data shift mask right next
AN96-4
Xicor
AN96
Reads data bits from X84F016/064/128 io_port reconstructs databyte x84data_get(int io_port) n,bit_temp[9]; bit_temp[0]=0; clear array position resetting previous (n=1;n<9;n++) loop through data bits bit_temp[n] current position, shift previous data bits left, read next bit, previous sum, store result return(bit_temp[8]); return data byte value calling routine General READ master routine that called user order read number bytes from X84F016/064/128 io_port void read_X84MPS(int no_bytes,int addr,int io_port,unsigned char *bytes) density; density density X84F064 density X84F016 density X84F128 x84reset(io_port); reset X84F016/064/128 send address bits (n=0;n<no_bytes;n++) loop through bytes read (no_bytes) bytes[n]=x84data_get(io_port); receive each byte store sequentially General WRITE master routine that called user order write sector X84F016/064/128 io_port void write_X84MPS(int addr,int io_port,unsigned char *bytes) density; density density X84F064 density X84F016 density X84F128 x84reset(io_port); reset X84F016/064/128 send address bits for(n=0;n<32;n++) loop through bytes written sector
AN96-5
Xicor x84write_start(io_port);
AN96
sequentially send each byte initiate nonvolatile write cycle
Writes value control register. user should send unused bits zeroes. control register defined {WPEN,0,0,0,BP1,BP0,0,0}, with WPEN being MSB. Writes this register require nonvolatile write cycle. void write_X84MPS_register(int io_port,int register_data) addr_bit; x84reset(io_port); reset X84F016/064/128 (addr_bit addr_bit addr_bit++) x84write_one(io_port); loop send address FFFFh send value control register x84write_start(io_port); initiate nonvolatile write cycle Reads value control register. control register defined {WPEN,0,0,0,BP1,BP0,0,0}, with WPEN being MSB. read_X84MPS_register(int io_port) scratch,addr_bit; x84reset(io_port); reset X84F016/064/128 (addr_bit addr_bit addr_bit++) x84write_one(io_port); loop send address FFFFh scratch x84data_get(io_port); read control register value return(scratch); return register value calling routine Main listing example utilize these functions When used larger program, following include directives must included prior compilation. example shows sector write initiated sector address 0x020 X84F064 memory mapped address 0x303. Data written stored sequentially send_buffer. Similarly, consecutive bytes read from this X84F064 starting address 0x01F stored receive_buffer. Control register manipulation also shown. loading send_buffer[] explicitly shown.
AN96-6
Xicor #include <dos.h> #include <c:\xicor.c> unsigned char send_buffer[32]; unsigned char receive_buffer[8192];
AN96
main outportb(0x300,0xfd); outportb(0x300,0xff);
buffer sector bytes needed X84F016/064/128 protocol receive_buffer[2048] X84F016 receive_buffer[8192] X84F064 receive_buffer[16384] X84F128 temporary register
only used setting XK84 only used setting HIGH XK84
clears WPEN, BP1, control register write sector X84F064 read bytes from X84F064 read_X84MPS_register(0x303); read control register
AN96-7

Other recent searches


XC641A - XC641A   XC641A Datasheet
WJR7080 - WJR7080   WJR7080 Datasheet
SBR2045 - SBR2045   SBR2045 Datasheet
LPC2194 - LPC2194   LPC2194 Datasheet
IHW30N90T - IHW30N90T   IHW30N90T Datasheet
CHR3894-98F - CHR3894-98F   CHR3894-98F Datasheet
ADM2914 - ADM2914   ADM2914 Datasheet
ACD80900A - ACD80900A   ACD80900A Datasheet
54ACTQ377 - 54ACTQ377   54ACTQ377 Datasheet
2N4338 - 2N4338   2N4338 Datasheet
4339 - 4339   4339 Datasheet
4340 - 4340   4340 Datasheet
4341 - 4341   4341 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive