| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
AN1761 Freescale Semiconductor, Inc. Interfacing MC68HC705C8
Top Searches for this datasheetOrder this document AN1761/D AN1761 Freescale Semiconductor, Inc. Interfacing MC68HC705C8A X76F041 PASSSecureFlashMark Glenewinkel Field Applications Engineering Consumer Systems Group Austin, Texas Introduction Secure non-volatile memory necessary requirement today's embedded systems. With increased frequency code pirating data tampering, securing access system code data must. X76F041 password access security supervisor (PASS) SecureFlash from Xicor, Inc., gives user ability password protect sensitive memory. Although security system infallible, X76F041 adds extra layer difficulty deter system misuse. Some security applications using X76F041 are: User password protected system access node identification with password networked systems Redefinable 64-bit non-volatile security passwords PASS SecureFlash trademarks Xicor, Inc. Motorola, Inc., 1998 AN1761 More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note non-volatile memory X76F041 also provides additional applications such Storing system calibration constants Power down information storage consumer electronics like TVs, VCRs, hand-held portable devices Identification number storage remote addressing Storage telecommunication information like phone number recall speed dialing Ability code patches established systems Freescale Semiconductor, Inc. This application note describes interface between MC68HC705C8A (C8A) X76F041. Circuitry example code included demonstrate interface between parts. X76F041 Overview Features X76F041 provides these features: Four 128-byte memory arrays 8-byte sector write 64-bit password security Three password modes: read, write, configuration Programmable configuration Read, write, configuration passwords Multiple array access/functionality Retry counter 2-wire serial interface active current, standby current operating voltage ranges: volts volts volts volts AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Overview High endurance; 100,000 cycles High data retention; years 8-pin (dual in-line) SOIC (small outline integrated circuit) package Description X76F041 contains four SecureFlash arrays. Access controlled three different 64-bit passwords: Freescale Semiconductor, Inc. reading data writing data device configuration addition, non-volatile password retry counter used count password attempts. After preset number attempts occurred, device disabled. Each array individually programmed access according four options: Read write Read only Read only program (possible change from read write 64-bit passwords required these options. These passwords pre-configured write only cannot read. configuration password acts master password access operation. Data transceived 2-wire bus. signals clock input (SCL) bidirectional data input output (SDA). Access controlled with chip-select (CS) signal. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note X76F041 Hardware Interface Pinout Descriptions Freescale Semiconductor, Inc. Figure X76F041 Pinout These pins serve power source device. Operating voltage volts volts. clock input X76F041 2-wire serial interface. (input/output) used transmit receive data 2-wire serial interface. open-drain that requires external pullup resistor. When HIGH, X76F041 deselected turns into high-impedance device. X76F041 standby mode. When goes LOW, X76F041 enabled operating active mode. used reset X76F041. When pulsed HIGH while (active mode), device outputs bits fixed data which conforms standard "synchronous response reset." This feature used this application note. more information, consult X76F041 data sheet from Xicor, Inc. AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Hardware Interface Block Diagram CONTROL LOGIC CHIP ENABLE RETRY COUNTER DATA TRANSFER ARRAY ACCESS ENABLE $000-$07F $080-$0FF Freescale Semiconductor, Inc. INTERFACE LOGIC PASSWORD ARRAY VERIFICATION LOGIC $100-$17F RESET RESPONSE DATA REGISTER $180-$1FF CONFIGURATION REGISTER 8-BIT SecureFlash ARRAYS Figure X76F041 Block Diagram Serial Protocol X76F041 supports bidirectional 2-wire protocol. protocol these characteristics: AN1761 MOTOROLA More Information This Product, www.freescale.com device sending data defined transmitter. device receiving data defined receiver. device controlling transfer called master. device being controlled called slave. master initiates transactions. master always provides clock both transmit receive operations. X76F041 always considered slave. clock signal called SCL. data signal called SDA. data sent most significant (MSB) first. Freescale Semiconductor, Inc. Application Note Figure shows 2-wire interface between master slave. MASTER X76F041 2-WIRE PORT PORT DIRECTION Freescale Semiconductor, Inc. Figure 2-Wire Serial Interface Idle Start Transfer idle mode, both held high. transfers start with start transfer condition. This done bringing from HIGH while HIGH. X76F041 monitoring this signal will start transactions until this condition met. Figure transfers must terminated with stop transfer condition. This done taking from HIGH while HIGH. stop transfer used only after transmitting device releases bus. Figure Stop Transfer AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Hardware Interface START STOP Figure Start Stop Transfer Timing Freescale Semiconductor, Inc. Data Transfer Data transmitted rising edge SCL. Data changed only while LOW. receiving device samples after goes HIGH. There clock pulse data transmitted. Figure DATA STABLE DATA CHANGE DATA STABLE Figure Data Transfer Timing Acknowledge Transfer acknowledge transfer type handshaking convention used signify that successful transfer data taken place. After transmitting device sends eighth byte data, releases bus. master sends ninth clock signal receiver acknowledges transfer pulling LOW. Once transmitter reads condition SDA, proceeds taking over sending next byte data. X76F041 transmitting data master wants further transmissions, master sends signal (HIGH) back X76F041. This tells X76F041 that more transfers needed stop transfer condition will initiated soon. Figure these different timing patterns. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note FROM SLAVE FROM MASTER Freescale Semiconductor, Inc. LAST RECEIVE, HIGH Figure Acknowledge Timing 2-Wire Protocol Example Here example protocol needed write 8-byte buffer address $120 X76F041 with password required: master transmits start transfer. master transmits X76F041 3-bit command code, %000, concatenated with high bits address, %00001. This results value %00000001 transmitted X76F041. Since byte just been transmitted, receiver (X76F041) will send acknowledge transfer. master reads LOW. master sends byte address X76F041 receives back acknowledge. master sends eight bytes data. After each byte transmitted, signal from X76F041 received. Finally, stop transfer sent X76F041 complete transaction. Since this write command requires programming FLASH, wait least before executing other commands X76F041. AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Software Interface X76F041 Software Interface Memory X76F041 total 4096 bits SecureFlash. arranged four sectors 1024 bits. Most commands address each sector 8-byte sections. X76F041's memory shown Figure with addresses shown 8-byte segments memory. This results sets 8-byte segments sector. SECTORS 8-BYTE SEGMENTS $000 SECTOR $078 $080 SECTOR $0F8 $100 SECTOR $178 $180 SECTOR $0F8 Freescale Semiconductor, Inc. Figure X76F041 Memory AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Password Registers X76F041 passwords consist three 64-bit write-only registers. 64-BIT WRITE PASSWORD 64-BIT READ PASSWORD 64-BIT CONFIGURATION PASSWORD Freescale Semiconductor, Inc. Figure Password Registers Configuration Registers Five 8-bit configuration registers used control X76F041. They written read from this sequence: Array Control Registers ACR1 Array control register ACR2 Array control register Configuration register Password retry register Password retry counter Each memory sector programmed with different levels access functionality. Figure details ACR1 ACR2 register options. AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Software Interface SECTOR ACR1 SECTOR ACCESS FUNCTION ACCESS FUNCTION SECTOR ACR2 SECTOR ACCESS FUNCTION ACCESS FUNCTION Freescale Semiconductor, Inc. FUNCTION BITS FUNCTIONALITY READ WRITE UNLIMITED READ ONLY, WRITE LIMITED PROGRAM READ ONLY, ERASE LIMITED READ WRITE, FULLY LIMITED ACCESS BITS READ PASSWORD REQUIRED REQUIRED REQUIRED REQUIRED WRITE PASSWORD REQUIRED REQUIRED REQUIRED REQUIRED Figure ACR1 ACR2 Registers Configuration Register configuration register contains four bits control unauthorized access enable retry counter. Figure This register gives added system protection allowing user number password attempts that allowed before access totally off. RESERVED Figure Configuration Register AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Unauthorized Access Bits Access forbidden retry register equals retry counter, further access kind will permitted Only configuration operations allowed retry register equals retry counter Retry Counter Reset Bits Retry counter will reset following correct password. Retry counter will reset following correct password. Freescale Semiconductor, Inc. Retry Counter Enable Bits Retry counter enabled. Retry counter disabled. Device Operation Once LOW, X76F041 will accept commands serial bus. Communication started issuing start condition followed command address field. passwords needed, they sent next. After password verified, data then read written device. bytes data must followed condition. Refer Figure SEND COMMAND HIGH BYTE ADDRESS SEND BYTE ADDRESS CONFIGURATION INSTRUCTION SEND 8-BYTE PASSWORD NEEDED) VERIFY PASSWORD ACCEPTANCE ISSUE POLLING NEEDED) WRITE READ DATA BYTES Figure Device Operation Sequence devices shipped from factory non-password mode (all 0s). After password sent X76F041, waiting period least AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note X76F041 Software Interface must observed. continue transaction, master must then initiate polling sequence. code continually transmitted checks back from X76F041 password correct. Commands Freescale Semiconductor, Inc. commands modes operations X76F041 listed Table brevity, write with password read with password (sequential) protocols described Figure Figure These serve examples protocols needed create commands listed Table detailed protocol listing each command, consult X76F041 data sheet. Table X76F041 Command Command Description Write sector Read (random sequential) Write sector Read (random sequential) Program write password Program read password Program configuration password Reset write password Reset read password Program configuration registers Read configuration registers Mass program (all Mass erase (all First Byte 000XXXXA 001XXXXA 010XXXXA 011XXXXA 100XXXXX 100XXXXX 100XXXXX 100XXXXX 100XXXXX 100XXXXX 100XXXXX 100XXXXX 100XXXXX Second Byte Write address Read address Write address Read address 00000000 00010000 00100000 00110000 01000000 01010000 01100000 01110000 10000000 Password Used Write Read Configuration Configuration Write Read Configuration Configuration Configuration Configuration Configuration Configuration Configuration Write Sector with Password first byte transmitted write X76F041 3-bit command code concatenated with high byte address being written. X76F041 then transmits byte address. buffer eight bytes then sent X76F041. transmission stopped issuing stop condition bus. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note WRITE COMMAND HIGH ADDR START 0000000A ADDR XXXXXXXX DATA BYTE WRITTEN XXXXXXXX DATA BYTE WRITTEN XXXXXXXX STOP Figure Write with Password Sequence Read Sector with Password (Sequential) first byte transmitted read from X76F041 3-bit command code concatenated with high byte address being written. X76F041 then transmits byte address. When executing sequential read, unlimited amount bytes read from sector. Once address sector reached, address pointer wraps around address sector. sequence shown Figure shows process reading eight bytes only. Each read followed from master except last byte read. transmission then stopped issuing stop condition bus. READ COMMAND HIGH ADDR START 0010000A Freescale Semiconductor, Inc. ADDR XXXXXXXX DATA BYTE READ XXXXXXXX DATA BYTE READ XXXXXXXX STOP Figure Read with Password Sequence MC68HC705C8A Hardware Interface MC68HC705C8A (C8A) most popular members HC05 Family. total 7744 bytes erasable programmable read-only memory (EPROM) bytes RAM. part includes total pins seven input-only pins. Peripherals include serial peripheral (SPI), serial communications interface (SCI), 16-bit capture/compare timer. AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note MC68HC705C8A Software Interface schematic used testing X76F041 interface MMEVS development system shown Figure pins used drive X76F041 are: Port This (SCL) configured output drive serial clock pin, SCL, X76F041. Port This (SDA) used transmit receive data X76F041. Freescale Semiconductor, Inc. further information C8A, consult MC68HC705C8A Technical Data, Motorola document order number MC68HC705C8A/D. X76F041 MMEVS INTERFACE Figure MC68HC705C8A X76F041 Interface Test Circuit MC68HC705C8A Software Interface Serial interface Routines driving manipulation process toggling pins with software instructions create certain hardware peripheral. HC05 provides special instructions specifically manipulate single pins. Five subroutines were created provide easy application programming interface (API) 2-wire serial interface. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note These routines are: START_SER Sends start condition STOP_SER Sends stop condition ACK_POLL Sends code accepts acknowledge back from X76F041 master takes contents AccA transmits (most significant bit) first X76F041. master also checks acknowledgement from X76F041. After master addresses X76F041 with command code address protocol byte, X76F041 transmits byte data back master. This routine reads that byte puts into AccA. master then generates acknowledgment back X76F041. RXD_LAST This routine just like used last byte read from X76F041. does generate acknowledgment back X76F041. NV_WAIT This routine 10-ms loop that waits nonvolatile programming time X76F041 expire. Freescale Semiconductor, Inc. flowcharts X76F041 serial drivers shown Figure Figure Figure Figure These routines were written especially X76F041 able properly drive other peripherals with 2-wire serial buses. Command Routines command routines were generated using 2-wire serial subroutines building blocks. command subroutines are: WRITE_NO_PASS Sends 8-byte buffer WRITE_BUFFER address X76_ADDR READ_NO_PASS Starting X76_ADDR, routine reads eight bytes puts them READ_BUFFER MASS_PROGRAM Programs entire array PROG_CONFIG Programs configuration register with five bytes from WRITE_BUFFER AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note MC68HC705C8A Software Interface READ CONFIG Reads five bytes from configuration register stores them READ_BUFFER PROG_READ_PW Programs read password with eight bytes from WRITE_BUFFER READ_R_PASS Starting X76_ADDR, routine reads eight bytes puts them READ_BUFFER. Requires read password. Refer X76F041 data sheet create other command subroutines. Freescale Semiconductor, Inc. Main Test Routine main test routine written verify interface between X76F041 C8A. writes reads data from X76F041 with without passwords. eight bytes data that sent held buffer called WRITE_BUFFER. eight bytes data that read into buffer called READ_BUFFER. When emulator stopped, read contents READ_BUFFER verify transmission process. Figure shows flowchart main test routine. sequence tests Mass program device This command writes throughout FLASH array. 8-byte passwords read config also $00. Write data FLASH sector address $100 with password Eight bytes written sector starting location $100. Read data from FLASH sector address $100 with password Stop emulator verify that contents READ_BUFFER $77. Mass program device This command writes throughout FLASH array. 8-byte passwords read config also $00. Read data from FLASH sector address $100 with password Stop emulator verify that contents READ_BUFFER mass program command works. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Program config registers config registers programmed follows: ACR1 $00, ACR2 $04, $00, $00, $00. This configuration configures sector require read password when reading from this section memory. Read config registers Stop emulator verify that first five bytes READ_BUFFER equal what written them. Program read password with eight bytes $55. Freescale Semiconductor, Inc. Write data FLASH sector address $100 with password Eight bytes written sector starting location $100. Read data from FLASH sector address $100 with password Stop emulator verify that contents READ_BUFFER $AA. Only some X76F041 commands were used this example. Other commands created using building blocks serial interface subroutines. Refer X76F041 data sheet detailed explanation command set. main test routine demonstrates interface software needed communicate with X76F041. Although used, HC05 device could utilize this interface code. Minor adjustments port pins memory maps might necessary. assembly code test routine provided Code Listing. Development Tools interface created tested using these development tools: M68MMPFB0508 Motorola MMEVS platform board X68EM05C9A Motorola Series emulation module Version 1.02 Editor, assembler, debugger Microcomputer Systems AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Development Tools START_SER ACK_POLL TAKE HIGH JUMP SER_START TAKE HIGH AccA TAKE JUMP Freescale Semiconductor, Inc. TAKE RETURN FROM RETURN FROM NV_WAIT STOP_SER LOAD WITH TAKE LOAD AccA WITH TAKE HIGH AccA AccA-1 TAKE HIGH AccA TAKE RETURN FROM RETURN FROM Figure START_SER, ACK_POLL, STOP_SER, NV_WAIT Subroutine Flowcharts AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note COUNTER LEFT SHIFT AccA, CARRY MAKE INPUT CARRY Freescale Semiconductor, Inc. SDA=1 SLAVE SENT SCL= TOGGLE CLOCK DECREMENT MAKE OUTPUT LOOP DONE? RETURN FROM Figure Subroutine Flowchart AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Development Tools MAKE INPUT COUNTER Freescale Semiconductor, Inc. CARRY ROTATE LEFT AccA PUTS CARRY INTO AccA DECREMENT YES, RECEIVED 8-BIT DATA MAKE OUTPUT TOGGLE CLOCK RETURN FROM Figure Subroutine Flowchart AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note RXD_LAST MAKE INPUT COUNTER Freescale Semiconductor, Inc. CARRY ROTATE LEFT AccA PUTS CARRY INTO AccA DECREMENT YES, RECEIVED 8-BIT DATA MAKE OUTPUT RETURN FROM Figure RXD_LAST Subroutine Flowchart AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Development Tools START MASS PROGRAM X76F041 JUMP MASS_PROGRAM STORE READ_PW CONFIG_PW Freescale Semiconductor, Inc. WRITE SECTOR USING PASSWORD START ADDR $100, DATA LOAD X76_ADDR_H WITH LOAD X76_ADDR_L WITH WRITE WRITE_BUFFER WITH JUMP WRITE_NO_PASS READ SECTOR USING PASSWORD START ADDR $100 LOAD X76_ADDR_H WITH LOAD X76_ADDR_L WITH JUMP READ_NO_PASS STOP PROGRAM HERE VERIFY THAT READ_BUFFER $77S MASS PROGRAM X76F041 JUMP MASS_PROGRAM STORE READ_PW CONFIG_PW READ SECTOR USING PASSWORD START ADDR $100 LOAD X76_ADDR_H WITH LOAD X76_ADDR_L WITH JUMP READ_NO_PASS STOP PROGRAM HERE VERIFY THAT READ_BUFFER $00S Figure Test Routine Flowchart (Sheet AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note PROGRAM CONFIG REGISTERS LOAD WRITE_BUFFER WITH $00, $04, $00, $00, JUMP PROG_CONFIG Freescale Semiconductor, Inc. READ CONFIG REGISTER DATA STORED READ_BUFFER JUMP READ_CONFIG PROGRAM READ PASSWORD WITH BYTES WRITE WRITE_BUFFER WITH JUMP PROG_READ_PW STOP PROGRAM HERE VERIFY THAT READ_BUFFER $00, $04, $00, $00, WRITE SECTOR USING PASSWORD START ADDR $100, DATA LOAD X76_ADDR_H WITH LOAD X76_ADDR_L WITH WRITE WRITE_BUFFER WITH JUMP WRITE_NO_PASS READ SECTOR USING PASSWORD START ADDR $100 LOAD X76_ADDR_H WITH LOAD X76_ADDR_L WITH JUMP READ_R_PASS STOP PROGRAM HERE VERIFY THAT READ_BUFFER INFINITE LOOP Figure Test Routine Flowchart (Sheet AN1761 More Information This Product, www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Application Note Code Listing File name: X76F041.ASM Example Code MC68HC705C8A Interface Xicor X76F041 SecureFlash Ver: Date: June 1998 Author: Mark Glenewinkel Motorola Field Applications Consumer Systems Group Assembler: 1.02 code explanation flow charts, please consult Motorola Application Note "Interfacing MC68HC705C8A X76F041 SecureFlash" Literature AN1761/D NOTE: timing routines based 2MHz internal frequency SYSTEM DEFINITIONS EQUATES Internal Register Definitions PORTA ;PortA DDRA ;data direction PortA Application Specific Definitions SER_PORT Memory Definitions EPROM $160 RESET $1FFE Freescale Semiconductor, Inc. ;PortA SER_PORT ;PortA, clock signal ;PortA, data signal ;start EPROM ;start ;vector reset VARIABLES Buffers writing reading data from X76F041 READ_PW password CONFIG_PW password WRITE_BUFFER ;8byte buffer storing FLASH READ_BUFFER ;storage read from FLASH X76_ADDR_H ;starting address, high byte X76_ADDR_L ;starting address, byte COUNTER ;temp counter AN1761 More Information This Product, www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Application Note MAIN ROUTINE EPROM ;start beginning EPROM Initialize Ports START #%00000010 ;init SER_PORT SER_PORT #$03 ;make SER_PORT pins outputs DDRA Mass Program X76F041 zeros Make sure Read Config registers MASS_PROGRAM ;array cleared clra clrx READ_PW,X ;store passwords incx #16T ;loop times Write Sector using Password, starting address $100 Data bytes load address #$01 X76_ADDR_H ;store high address #$00 X76_ADDR_L ;store address load byte buffer clrx #$77 WRITE_BUFFER,X ;load buffer with incx #$08 ;loop bytes WRITE_NO_PASS ;write sector, pass Freescale Semiconductor, Inc. Read Sector using Password, starting address $100 Store READ_BUFFER load address #$01 X76_ADDR_H ;store high address #$00 X76_ADDR_L ;store address READ_NO_PASS ;read sector, pass Mass Program X76F041 zeros Make sure Read Config registers MASS_PROGRAM ;array cleared clra clrx READ_PW,X ;store passwords AN1761 More Information This Product, www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Application Note incx #16T ;loop times Read Sector using Password, starting address $100 Store READ_BUFFER, should zeros after mass program load address #$01 X76_ADDR_H ;store high address #$00 X76_ADDR_L ;store address Freescale Semiconductor, Inc. READ_NO_PASS ;read sector, pass Program Config Registers Make Third Sector need Read Password #$00 WRITE_BUFFER #$04 WRITE_BUFFER+1 #$00 WRITE_BUFFER+2 #$00 WRITE_BUFFER+3 #$00 WRITE_BUFFER+4 PROG_CONFIG ;ACR1=$00 ;ACR2=$04 ;CR=$00 ;RR=$00 ;RC=$00 ;program config Read Config registers X76F041 Store READ_BUFFER READ_CONFIG ;read config Program Read Password crux #$55 R_PW1 WRITE_BUFFER,X incx #$08 R_PW1 PROG_READ_PW ;store buffer ;loop bytes ;program read pass AN1761 More Information This Product, www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Application Note Write Sector using Password, starting address $100 Data bytes load address #$01 X76_ADDR_H ;store high address #$00 X76_ADDR_L ;store address load byte buffer clrx #$AA WRITE_BUFFER,X ;store buffer incx #$08 ;loop bytes WRITE_NO_PASS ;write sector, pass Freescale Semiconductor, Inc. Read Sector using Read Password, starting address $100 Store READ_BUFFER, verify #$01 X76_ADDR_H ;store high address #$00 X76_ADDR_L ;store address READ_R_PASS ;read sector pass DUMMY DUMMY ;test sequence over SUBROUTINES SERIAL Sends Start command START_SER bset SDA,SER_PORT ;SDA=1 bset SCL,SER_PORT ;SCL=1 bclr SDA,SER_PORT ;SDA=0 bclr SCL,SER_PORT ;SCL=0 Sends Stop command STOP_SER bclr SDA,SER_PORT bset SCL,SER_PORT bset SDA,SER_PORT bclr SCL,SER_PORT Sends polling ACK_POLL START_SER #$C0 ;SDA=0 ;SCL=1 ;SDA=1 ;SCL=0 ;send $C0, ACK? AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Code Listing Routine takes contents AccA transmits serially X76F041, first Looks ACK, infinite loop ;set counter WRITE asla bset bclr ;Carry SDA,SER_PORT CLOCK_IT SDA,SER_PORT SCL,SER_PORT SCL,SER_PORT WRITE SDA,DDRA SCL,SER_PORT SDA,SER_PORT,J2 ;SDA input ;SCL=1 SDA=0, slave slave ack, stay loop ;SCL=0 ;SDA output ;return from ;SDA=1 ;branch clock_it ;SDA=0 ;evens ;SCL=1 ;SCL=0 ;decrement counter Freescale Semiconductor, Inc. bset bclr decx Check bclr bset brset CLOCK_IT bclr bset SCL,SER_PORT SDA,DDRA Routine clocks contents Generates back bclr READ bset brclr rola bclr X76F041 read data from SDA, first AccA slave except last read SDA,DDRA ;make input ;set counter SCL,SER_PORT SDA,SER_PORT,J3 SCL,SER_PORT ;SCL=1 ;carry ;put carry into AccA ;SCL=0 ;decrement counter READ SDA,DDRA SDA,SER_PORT SCL,SER_PORT SCL,SER_PORT ;make output ;SDA=0 ;SCL=1 ;SCL=0 ;return from decx back slave bset bclr bset bclr READ_DONE AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Routine clocks X76F041 read data from SDA, first contents AccA Generates back slave, signals last read DS1307 RXD_LAST bclr SDA,DDRA ;make input ;set counter READ_LAST bset brclr rola bclr SCL,SER_PORT SDA,SER_PORT,J4 SCL,SER_PORT ;SCL=1 ;carry ;put carry into AccA ;SCL=0 ;decrement counter Freescale Semiconductor, Inc. decx READ_LAST back slave bset SDA,DDRA ;make output ;return from Routine creates ~10ms routine with 2MHz internal memory correctly NV_WAIT #14T #255T deca decx SUBROUTINES COMMANDS Routine writes X76F041 with address data buffer WRITE_NO_PASS START_SER ;start serial transmission X76_ADDR_H #%00000000 X76_ADDR_L ;send command high addr ;send addr transmit WRITE_BUFFER X76F041 clrx WRITE_BUFFER,X COUNTER COUNTER incx #$08 STOP_SER NV_WAIT ;X=0 ;AccA=buffer ;COUNTER=X ;transmit byte ;X=COUNTER ;X=X+1 ;loop times ;done? ;stop serial transmission ;wait 10ms ;return from AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Code Listing Routine reads X76F041 with address stores READ_BUFFER READ_NO_PASS START_SER ;start serial transmission X76_ADDR_H #%00100000 X76_ADDR_L ;send command high addr ;send addr Freescale Semiconductor, Inc. Read from X76F041, store READ_BUFFER clrx COUNTER COUNTER READ_BUFFER,X incx #$07 RXD_LAST #$07 READ_BUFFER,X STOP_SER ;X=0 ;COUNTER=X ;read byte ;X=COUNTER ;store byte read buffer ;X=X+1 bytes done? ;send with ;X=$07 ;store last byte ;stop serial transmission Routine mass programs X76F041 zeros MASS_PROGRAM START_SER #$80 #$70 send config password clrx CONFIG_PW,X COUNTER COUNTER incx #$08 NV_WAIT ACK_POLL STOP_SER NV_WAIT ;start serial transmission ;send command high addr ;send addr ;X=0 ;AccA=Config[x] ;COUNTER=X ;transmit AccA ;X=COUNTER ;X=X+1 ;COUNTER=8? not, loop again ;wait 10ms ;ack polling ;stop serial transmission ;wait 10ms AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Routine programs config registers with data from WRITE_BUFFER PROG_CONFIG START_SER ;start serial transmission #$80 #$50 Send config password clrx CONFIG_PW,X COUNTER COUNTER incx #$08 clrx incx NV_WAIT ACK_POLL ;send command high addr ;send addr Freescale Semiconductor, Inc. ;X=0 ;AccA=CONFIG_PW[x] ;COUNTER=X ;transmit AccA ;X=COUNTER ;X=X+1 ;COUNTER=8? not, loop again ;wait 10ms ;ack polling ;X=0 ;AccA=buffer byte ;COUNTER=X ;transmit byte ;X=COUNTER ;X=X+1 bytes done? ;stop serial transmission ;wait 10ms WRITE_BUFFER,X COUNTER COUNTER #$05 STOP_SER NV_WAIT Routine programs reads config registers, stores READ_BUFFER READ_CONFIG START_SER ;start serial transmission #$80 #$60 Send Config Password clrx CONFIG_PW,X COUNTER COUNTER incx #$08 NV_WAIT ;send command high addr ;send addr ;X=0 ;AccA=Config[x] ;COUNTER=X ;transmit AccA ;X=COUNTER ;X=X+1 ;COUNTER=8? not, loop again ;wait 10ms AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note Code Listing ACK_POLL ;poll Read store READ_BUFFER clrx COUNTER COUNTER READ_BUFFER,X incx #$04 ;X=0 ;COUNTER=X ;receive byte ;COUNTER=X ;store away byte ;X=X+1 bytes received ;read last byte ;store byte ;stop serial transmission ;wait 10ms Freescale Semiconductor, Inc. RXD_LAST #$04 READ_BUFFER,X STOP_SER NV_WAIT Routine programs Read Password with data from WRITE_BUFFER PROG_READ_PW START_SER ;start serial transmission #$80 #$10 send read password change clrx R_PW0 READ_PW,X COUNTER COUNTER incx #$08 R_PW0 clrx incx clrx NV_WAIT ACK_POLL ;send command high addr ;send addr ;X=0 ;AccA=0 ;COUNTER=X ;transmit AccA ;X=COUNTER ;X=X+1 ;COUNTER=8? not, loop again ;wait 10ms ;ack polling ;X=0 ;load byte from buffer ;COUNTER=X ;transmit byte ;X=COUNTER ;X=X+1 bytes sent? ;X=0 ;load byte from buffer ;COUNTER=X R_PW2 WRITE_BUFFER,X COUNTER COUNTER #$08 R_PW2 R_PW3 WRITE_BUFFER,X COUNTER AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note incx Store password clrx R_PW4 incx COUNTER #$08 R_PW3 STOP_SER NV_WAIT ;transmit ;X=COUNTER ;X=X+1 bytes sent? ;stop serial transmission ;wait 10ms Freescale Semiconductor, Inc. WRITE_BUFFER,X READ_PW,X #$08 R_PW4 ;X=0 ;load byte from buffer ;store away ;X=X+1 bytes written? Routine reads X76F041 with address stores READ_BUFFER Needs byte Read Password READ_R_PASS START_SER ;start serial transmission clrx incx clrx incx X76_ADDR_H #%00100000 X76_ADDR_L ;send command high addr ;send addr READ_PW,X COUNTER COUNTER #$08 NV_WAIT ACK_POLL RXD_LAST START_SER X76_ADDR_L ;X=0 ;AccA=READ_PW[x] ;COUNTER=X ;transmit AccA ;X=COUNTER ;X=X+1 ;COUNTER=8? not, loop again ;wait 10ms ;ack polling ;dummy read X76F041 ;start condition ;send addr COUNTER COUNTER READ_BUFFER,X #$07 ;X=0 ;COUNTER=X ;read byte ;X=COUNTER ;store away ;X=X+1 bytes read? AN1761 More Information This Product, www.freescale.com MOTOROLA Application Note References RXD_LAST #$07 READ_BUFFER,X STOP_SER ;read last byte ;store last byte ;stop serial transmission VECTOR TABLE RESET START Freescale Semiconductor, Inc. References MC68HC705C8A Technical Data, Motorola document order number MC68HC705C8A/D, 1996. M68HC05 Applications Guide, Motorola document order number M68HC05AG/AD, 1996. X76F041 Data Sheet, Xicor, Inc., 1997. AN1761 MOTOROLA More Information This Product, www.freescale.com Freescale Semiconductor, Inc. Application Note Freescale Semiconductor, Inc. Motorola reserves right make changes without further notice products herein. Motorola makes warranty, representation guarantee regarding suitability products particular purpose, does Motorola assume liability arising application product circuit, specifically disclaims liability, including without limitation consequential incidental damages. "Typical" parameters which provided Motorola data sheets and/or specifications vary different applications actual performance vary over time. operating parameters, including "Typicals" must validated each customer application customer's technical experts. Motorola does convey license under patent rights rights others. Motorola products designed, intended, authorized components systems intended surgical implant into body, other applications intended support sustain life, other application which failure Motorola product could create situation where personal injury death occur. Should Buyer purchase Motorola products such unintended unauthorized application, Buyer shall indemnify hold Motorola officers, employees, subsidiaries, affiliates, distributors harmless against claims, costs, damages, expenses, reasonable attorney fees arising directly indirectly, claim personal injury death associated with such unintended unauthorized use, even such claim alleges that Motorola negligent regarding design manufacture part. Motorola registered trademarks Motorola, Inc. Motorola, Inc. Equal Opportunity/Affirmative Action Employer. reach USA/EUROPE/Locations Listed: Motorola Literature Distribution, P.O. 5405, Denver, Colorado 80217, 1-800-441-2447 1-303-675-2140. Customer Focus Center, 1-800-521-6274 JAPAN: Nippon Motorola Ltd.: SPD, Strategic Planning Office, 141, 4-32-1 Nishi-Gotanda, Shinagawa-ku, Tokyo, Japan. 03-5487-8488 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd., Ping Industrial Park, Ting Road, N.T., Hong Kong. 852-26629298 MfaxTM, Motorola Back System: RMFAX0@email.sps.mot.com; http://sps.motorola.com/mfax/; TOUCHTONE, 1-602-244-6609; Canada ONLY, 1-800-774-1848 HOME PAGE: http://motorola.com/sps/ Mfax trademark Motorola, Inc. Motorola, Inc., 1998 AN1761/D More Information This Product, www.freescale.com Other recent searchesVF20150C - VF20150C VF20150C Datasheet VB20150C - VB20150C VB20150C Datasheet VI20150C - VI20150C VI20150C Datasheet SN74F125 - SN74F125 SN74F125 Datasheet SCCS017A - SCCS017A SCCS017A Datasheet S8040 - S8040 S8040 Datasheet LM433 - LM433 LM433 Datasheet KEMA98ATEX1683U - KEMA98ATEX1683U KEMA98ATEX1683U Datasheet KEMA98ATEX1683U - KEMA98ATEX1683U KEMA98ATEX1683U Datasheet KEMA98ATEX1683U - KEMA98ATEX1683U KEMA98ATEX1683U Datasheet FRM234D - FRM234D FRM234D Datasheet FRM234R - FRM234R FRM234R Datasheet FRM234H - FRM234H FRM234H Datasheet
Privacy Policy | Disclaimer |