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*)

 

 

Interfacing Xicor X5163/323/643 Supervisors Microcontrollers Intr


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet




Interfacing Xicor X5163/323/643 Supervisors Microcontrollers
Introduction
Xicor Supervisors have on-chip programmable watchdog timer nonvolatile EEPROM memory. These features, coupled with 3-line Serial Peripheral Interface (SPI) 78K-series microcontroller from NEC, make effective combination features performance. This application note will explore some possibilities will provide example schematics software. possible write block data single operation. However, each block bytes long block write cannot cross block boundary. block boundaries begin addresses where bits through "0". previously described, WREN command required before block written. This block write mechanism implemented sample firmware code.
78K-Series
Interface
78K-Series microcontroller typically serial ports. these, synchronous three-line interface, used with watchdog timer (SPI WDT). This interface requires only additional line, chip select. Figure shows possible configuration. illustrated this connection requires additional components. Sample code, provided later section, written support hardware shown Figure
RESET
X5163 RESET
Implementation
While interface code implementation complex, there some areas where care must taken achieve functional code. write enable command (WREN) must precede each write operation, including write status register. WREN command begins with line going completed with line returning HIGH. Once writes have been enabled, they active only during byte, page, status register write. This means WREN command must precede each write operation. write enable also reset automatically upon power-up.
Figure Interfacing Xicor X5163 Supervisor 78K-Series using synchronous serial port
possible write values into status register change block protection change watchdog timer value. Since status register nonvolatile, write register must follow same restrictions other nonvolatile writes. This means that write status register will take maximum 10ms complete, cannot occur concurrently with data write operations. When using watchdog timer, RESET signal sent after selectable period time. microcontroller does respond this amount time, will reset. toggling line, watchdog RESET
October, 2000
www.xicor.com
held-off. sample firmware code does include this watchdog timer RESET hold-off operation. circuit Figure shows pull-up resistor RESET line. This required, since open drain output. Typically, however, microcontroller RESET circuit that allows user initiated re-start. this case, resistor shown figure additional component, part reset mechanism.
Wait_EE-This routine will wait EEPROM write complete. E2_Command_Fix-This routine will send various commands EEPROM. Block_Read-This routine will read block data from EEPROM will save block RAM. EEPROM source address pointer destination address pointer, along with block size bytes, pre-specified. Block_Write-This routine writes block data EEPROM. data source address pointer EEPROM destination address pointer pre-specified, number bytes block. This routine handles data blocks that begin EEPROM border handle blocks greater than bytes. Read_Stat-This routine will return current value EEPROM Status register.
Code Listings
listing interface firmware included following pages. code consists test program that moves block data from EEPROM, then moves block from EEPROM 78K2 internal RAM. EEPROM-specific routines takes less than bytes code. These routines are: Init_SIO-This routine will synchronous serial port communicate with WDT. Put_Byte-This routine sends data byte EEPROM using internal hardware shifter microcontroller. Write_Stat-This routine will write value into EEPROM status register. Get_Byte-This routine gets byte from EEPROM using internal hardware shifter microcontroller. Wait_COM-After writing byte microcontroller internal hardware shift register, this routine will wait byte transmit complete.
Conclusion
members NEC's 78K-series microcontrollers come equipped with on-board watchdog timer only family (the uPD7824x) on-chip EEPROM. introduction Xicor removes these limitations with single 8-lead device. Since this combination requires interface hardware minimal code, perfect combination many industrial control applications. Additional Xicor code found World Wide http://www. xicor.com.
October, 2000
www.xicor.com
TITLE ('X25163Interface') File Name: PC(213) OPERATION: This program will access Xicor Serial EEPROM with Serial Peripheral Interface (SPI) watchdog timer This routine EEPROM that uses synchronous serial port K-series devices. This program written DDB. TESTPG: Define Equates WREN Command: Write enable WRDI Command: Write Disable RDSR Command: Read Status Register WRSR Command: Write Status Register READ Command: Read EEPROM WRITE Command: Write EEPROM EEPROM Write Progress P6.0 Chip enable line Msg1 Start address EEPROM block NUM_TRY read this long before giving Define Stack area STKSEG DSEG 0FE00H STACK: Define Variables VARIAB DSEG 0FE20H BYTE_COUNT: MESSAGE: Where data moved. Used test program., Vector Table VRESET CSEG 9000H START CMAIN CSEG 9080H Main Routine
October, 2000
www.xicor.com
Initialize System. START: Disable interrupts #00010111B Fetch,no addr,1 wait RFM, #00000000B Disable refresh pulse PM6, #00000000B Select bank P64-67=output movw #STACK stack pointer call !Init_SIO Initialize Serial port Turn Xmit Recv PM0, set1 Disable EEPROM following Test program that writes block data into EEPROM from ROM, then reads back into 78K2 internal area. TEST: movw #MSG_ROM Location message movw #Msg1 Location message EEPROM BYTE_COUNT, Write bytes EEPROM call movw movw call call call LOOP: MSG_ROM: !Block_Write #MESSAGE #Msg1 BYTE_COUNT, !Block_Read #10H !Write_Stat !Fini_SIO Timer mSec Timer Turn Serial port Write block Location message Location message EEPROM Read bytes from EEPROM
LOOP
'This test Serial EEPROM'
Following various routines complete above operation. Init_SIO Initialize Serial Port Fini_SIO Turn Serial
October, 2000
www.xicor.com
Wait_COM Wait communication complete Wait_EE Wait EEPROM Write complete Put_Byte Sends byte EEPROM Get_Byte Gets Byte from EEPROM E2_Command_Fix Sends commands WREN (Write Enable) WRDI (Write Disable) RDSR (Read Status register) WRSR Write Status Register) READ (Read EEPROM) WRITE (Write EEPROM) Read_Stat Reads EEPROM Status register Write_Stat Writes EEPROM Status Register Block_Read Reads block data from EEPROM Block_Write Writes block data EEPROM Init_SIO This routine will initialize Serial port Synchronous operation, using internal clocking 750K bps. Routines Called: None Input: None Output: None Registers used: Init_SIO: set1 set1 MK0H, #10000000B Disable serial interrupt PMC3, #0CH CSIM, Serial clock fCLK/8 CTXE Turn transmit mode CRXE Turn receive mode
End_Ser_Setup: clr1 clr1 CSIIF Interrupt after each xfer Clear Sync Serial Intr Flag
Fini_SIO This routine will initialize Serial port Synchronous operation, using internal clocking 750K bps.
October, 2000
www.xicor.com
Routines Called: None Input: None Output: None Registers used: Fini_SIO: clr1 CTXE Turn transmit mode clr1 CRXE Turn receive mode End_Ser_Setup Wait_COM This routine will wait interrupt signal xmit recv complete Routines Called: None Input: None Output: None Registers used: None Wait_COM: btclr return: Wait_EE This routine will wait EEPROM write sequence complete. Routines Called: None Input: None Output: None Registers used: Wait_EE: Wait_EE_LP: call dbnz Wait_done: !Read_Stat Read Status Register #NUM_TRY Maximum number samples CSIIF, $Return Wait_COM Wait completion Xmit/Rcv
WIP, $Wait_done Write complete, done. $Wait_EE_LP done, give more time much.
October, 2000
www.xicor.com
else, return Put_Byte This routine will move byte data from memory pointed register EEPROM. Routines Called: None Input: Address data send Output: Next address data send Registers used: Put_Byte: SIO, byte serial port Wait_COM Wait byte sent Get_Byte This routine will move byte data from EEPROM memory pointed register. Routines Called: None Input: None Output: Returned byte Registers used: Get_Byte: SIO, Send dummy byte activate recv call !Wait_COM Wait byte recv'd byte E2_Command_Fix This routine will send control signal EEPROM Command: Write enable Command: Write Disable Command: Read Status Register Command: Write Status Register Command: Read EEPROM Command: Write EEPROM Routines Called: None Input: Command; Address EEPROM Output: None Registers used: None
October, 2000
www.xicor.com
E2_Command_Fix: clr1 Put_byte Enable EEPROM Write Command serial port
Read_Stat This routine will read value from status register Routines Called: None Input: None Output: Status value Registers used: Read_Stat: call call set1 #RDSR Read Status Register !E2_Command_Fix !Get_byte Disable chip
Write_Stat This routine will write value status register Routines Called: None Input: Status register data Output: None Registers used: Write_Stat: call set1 call call set1 #WREN Prepare enable writing !E2_Command_Fix Send WREN command Disable EEPROM #WRSR Write Status Register !E2_Command_Fix !Put_byte Write status Disable chip
Block_Read This routine will read block data from EEPROM
October, 2000
www.xicor.com
Routines Called: Get_Data_Byte Input: Save address pointer, BYTE_COUNT number bytes Output: Address next save location Registers used: BYTE_COUNT Block_Read: call call call #READ Send reset command !E2_Command_Fix !Put_Byte !Put_Byte Send Send Send Send upper address byte EEPROM Start Address lower address byte EEPROM Start Address EEPROM Address
Blk_Rd_Loop: call dbnz set1 !Get_Byte [HL+], BYTE_COUNT, $Blk_Rd_Loop Disable EEPROM
Block_Write This routine will write block data EEPROM Since EEPROM byte page, limit bytes data written before issuing non-volatile write cycle. Also, order avoid data wrapping page, care must taken when writing over page boundaries. Routines Called: E2_Command_Fix, Put_Byte, Wait_EE Input: Internal Address EEPROM (where data written) Address data written BYTE_COUNT Number bytes write Output: None Registers used: BYTE_COUNT Block_Write: call set1 Write_OP: call #WRITE !E2_Command_Fix #WREN !E2_Command_Fix Prepare enable writing Send WREN command Disable EEPROM
Start writing Send upper address byte
October, 2000
www.xicor.com
call call Blk_Loop: call [HL+] !Put_Byte next byte Send points next byte Count byte, last one, write else check byte boundary !Put_Byte !Put_Byte Send Send Send EEPROM Start Address lower address byte EEPROM Start Address EEPROM Address
dbnz BYTE_COUNT, $Next_bit NV_Write Next_bit: incw NV_Write: set1 call call set1 #WRDI !E2_Command_Fix !Wait_EE BYTE_COUNT, Block_Write $Blk_Loop
Increment EEPROM address pointer Check byte block boundary this block start? keep sending
Disable EEPROM Wait writes complete bytes sent keep
Disable writes Disable EEPROM
October, 2000
www.xicor.com

Other recent searches


XZFMOK07A - XZFMOK07A   XZFMOK07A Datasheet
UB104S01 - UB104S01   UB104S01 Datasheet
TA2009F - TA2009F   TA2009F Datasheet
TA2009P - TA2009P   TA2009P Datasheet
SRA2201 - SRA2201   SRA2201 Datasheet
NUP1301ML3T1 - NUP1301ML3T1   NUP1301ML3T1 Datasheet
NLSV1T240 - NLSV1T240   NLSV1T240 Datasheet
ELT-542SURWA - ELT-542SURWA   ELT-542SURWA Datasheet
S530-A3 - S530-A3   S530-A3 Datasheet
D62LCB - D62LCB   D62LCB Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive