AN530. Interfacing 93CX6 Serial EEPROMs to PIC16C5X Microcontrollers INTRODUCTION THE HARDWARE CONNECTION THE SOFTWARE CONNECTION

Size: px
Start display at page:

Download "AN530. Interfacing 93CX6 Serial EEPROMs to PIC16C5X Microcontrollers INTRODUCTION THE HARDWARE CONNECTION THE SOFTWARE CONNECTION"

Transcription

1 Interfacing 93CX6 Serial EEPROs to PIC16C5X icrocontrollers Authors: Stan D'Souza icrochip Technology Inc. Bob Ward icrochip Technology Inc. INTRODUCTION icrochip Technology Inc. s popular 93C46/56/66 and 93LC46/56/66 Serial EEPROs feature a three/four wire serial interface bus. The attractive price and simple interface make it the ideal device for additional memory space. This application note is intended for design engineers who wish to incorporate a pre-packaged serial EEPRO interface driver into their application. THE HARDWARE CONNECTION A typical 4-wire hardware connection is illustrated in Figure 1 and a typical 3-wire connection is illustrated in Figure 2. Since all I/O ports on the PIC16C5X are configurable as input and/or output, a 3-wire interface makes optimum utilization of the I/O pins by having a common connection for the DI and DO lines of the Serial EEPRO. The port pin on the PIC16C5X connected to these pins, has a default setting as an output and is configured, when needed, as an input during program eecution. THE SOFTWARE CONNECTION An eample interface driver is listed in Appendi A. A flow diagram is given in Figure 2. The interface driver is written to minimize both overhead to the calling program as well as the program space necessary for its inclusion into the user s code. The driver has been written as a generic driver to service all 93 Series Serial EEPROs made by icrochip. Processor resources which must be made available to the driver prior to being called are: 1. Two levels of processor stack. 2. Si register locations (four for command/data passing and two for software counters). 3. The File Select Register (FSR), which is used to pass a command/data string pointer to the driver. Note: The four command/data passing registers have to be defined consecutively in order for the FSR to access them successfully in the program eecution. FIGURE 1: FIGURE 2: RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 PIC16C5X RTCC 4-WIRE CONNECTION RA0 RA1 RA2 RA3 CLR OSC1 OSC WIRE CONNECTION The user should take the following steps when using the routines provided in Appendi A. A) Specify and define a 3-/4-wire interface by defining the common connection to the DI/DO lines and setting the equate 'wire3' TRUE or FALSE (4-wire is automatically assumed if 3-wire is false). B) Specify and define if 16-bit or 8-bit data organization is used, by setting equate 'org8' TRUE or FALSE VCC 93CXX NC 7 ORG 6 Note 1 CS >CLK DI DO 40 Hz 20 pf 20 pf Note 1: FOR 93LCXX For 16-bit data word connect to VCC For 8-bit data word connect to GND RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 PIC16C5X RTCC RA0 RA1 RA2 RA3 CLR OSC1 OSC CXX 1 CS NC 2 >CLK 3 DI ORG 4 DO 10KΩ VCC 40 Hz 20 pf 20 pf 7 6 VCC Note 1 Note 1: FOR 93LCXX For 16-bit data word connect to VCC For 8-bit data word connect to GND 1999 icrochip Technology Inc. DS00530F-page 1

2 FIGURE 3: FLOW CHART Inc. FSR to Register Containing 1st write byte Call dout8, output 1st byte Start 8 bit mode? Y Transfer location of register cmd to FSR N Select device, clock out start bit Inc. FSR to Register Containing 2nd write byte Call dout, clock out bits of cmd/addr Call dout8, output 2nd byte Write or erase? time Y Erase? N Y Read? N Y Inc. FSR to Register Receiving 1st byte Call rdychk wait for rdy status within allocated time N EWEN? (erase all) Y Call din8, input 1st byte De-select device N ERAL? (erase all) Y 8 bit mode? Y Compute completion status (error/no_error) and return N WRAL? (write all) Y N Inc. FSR to Register Receiving 2nd byte N Call din8, input 2nd byte De-select device Return with no error DS00530F-page icrochip Technology Inc.

3 C) The user should assemble the source file by specifying which type of serial EEPRO is being used. This is done by defining the equate S93C46, S93LC46, etc., as TRUE. Only one device can be TRUE, the rest have to be defined FALSE. D) The user would invoke the driver as follows: 1. Load the register defined as 'cmd' with the 93CX6 Command Opcode (only the four upper bits are used in this register; see Figure 3). 2. If necessary, load the register defined 'addr' with the lower 8/7/6 bit address of the location. 3. If necessary, load the 9th bit of the address as bit 3 of the register defined as 'cmd' (Figure 3). Note: READ, WRITE and ERASE commands need to have an address associated with the command and the 9th bit of the address is only required when using the 93C56/66 or 93LC56/66 devices in the 8 bit mode (ORG tied to GND). 4. If necessary, load the register defined as 'highb' and 'lowb' with the 16 bits of data, the most significant byte loaded in 'highb'. In 8 bit mode, 'highb' should be loaded with the 8 bit data. Note: Only the WRITE and WRAL commands require data to be loaded in the 'highb', 'lowb' locations. 5. Call the driver sub-routine 'see'. 6. Upon completion, the driver will return a completion status in the W register (error/no error). Only commands requiring a status check are capable of returning a valid error/no error status, in all other cases a no error is returned. 7. If the READ command is eecuted, the 16/8 bit data will be loaded in the 'highb' and 'lowb' registers, where 'highb' contains the SB in the 16 bit mode and 8 bit data in the 8-bit mode. The Eample interface assumes a 4 Hz oscillator clock which gives us a 1 µs instruction cycle. If a higher clock speed is used, additional NOPs have to be included in the code in order to meet the minimum clock speed requirements of the 93 Series Serial EEPROs (see data sheet for further details). Listing in Appendi B is for an interface to 93C46 Serial EEPRO only. SUARY The 93 Series Serial EEPROs are a simple and versatile method of increasing read/write memory capability in a PIC16C5X application. The 'generic' code in Appendi A makes it easy to incorporate in any PIC16C5X application. Any of the 93 Series Serial EEPROs can be applied, while at the same time using a minimal amount of I/O, code and RA resources. Code size: 6 bytes of RA. Appendi A listing: 127 bytes program code (ma.) 100 bytes program code (min.) Appendi B listing: 86 bytes program code FIGURE 4: CD, ADDR, DATA BYTE DEFINITION Bit7 Bit6 Bit5 Bit4 Bit3 Command Register (cmd) SB of address in 8-bit mode for 93C56/66 (if necessary) LSB of 4-bit opcode 3rd bit of opcode 2nd bit of opcode SB of 4-bit opcode A7 A6 A5 A4 A3 A2 A1 A0 high b 16-Bit ode Command Register (cmd) SB of address in 8-bit mode for 93C56/66 (if necessary) LSB of 4-bit opcode 3rd bit of opcode 8 Bit ode high b D15 D8 D7 D0 low b D7 D icrochip Technology Inc. DS00530F-page 3

4 Please check the icrochip Worldwide Website at for the latest version of the source code. APPENDIX A: 93XCXX.AS PAS Released 93XCXX.AS :13:47 PAGE 1 LOC OBJECT CODE VALUE LINE SOURCE TEXT TITLE R/W EEPRO LIST P = 16C ;Serial Eprom interface to PIC16C5X ; ; ; Program: 93XCXX.AS ; Revision Date: 8/26/ ; 10/31/92 Comments clarified REV ; Compatibility with PASWIN ; ;********************************************************************* ; ;Define Equates: ; FF PIC54 EQU 1FFH ; PAGE ; ORG START A7B goto main ;run test program ; PAGE ; TRUE EQU FALSE EQU F EQU S93C46 EQU FALSE S93LC46 EQU FALSE S93C56 EQU FALSE S93LC56 EQU FALSE S93C66 EQU TRUE S93LC66 EQU FALSE wire3 equ TRUE ; for four-wire setup equate to FALSE org8 EQU FALSE ; IF S93LC IF org LC468 EQU TRUE XC46 EQU FALSE H16 EQU FALSE H8 EQU FALSE ELSE LC468 EQU FALSE XC46 EQU TRUE H16 EQU FALSE H8 EQU FALSE ENDIF ELSE ENDIF IF S93C LC468 EQU FALSE XC46 EQU TRUE H16 EQU FALSE H8 EQU FALSE ENDIF DS00530F-page icrochip Technology Inc.

5 00057 IF S93C56 + S93C66 + S93LC56 + S93LC IF org H8 EQU TRUE H16 EQU FALSE LC468 EQU FALSE XC46 EQU FALSE ELSE H16 EQU TRUE H8 EQU FALSE LC468 EQU FALSE XC46 EQU FALSE ENDIF ELSE ENDIF ;******************************************************************** ;* Register Assignments * ;******************************************************************** indir equ 0 ;Use this register as source/destination ;for indirect addressing pc equ 2 ;PIC Program Counter status equ 3 ;PIC Status Register fsr equ 4 ;File Select Register serial equ 5 ;Port used for 93CX6 control ;The following four registers must be ;located consecutively in memory A cmd equ 1a ;This register contains the 4 bit ;command op code for 93CX6 as follows: ;bit 7 msb of command op code ;bit 6 net bit of op code ;bit 5 net bit of op code ;bit 4 lsb of op code ;bit 3 A8 of address in case of ;56/66 in 8 bit mode B addr equ 1b ;memory address of lower 7/8 bits C highb equ 1c ;Used in read/write routines to store the ;upper byte of a 16 bit data word, ;or the data in a 8 bit data word D lowb equ 1d ;Used in read/write routines to store the ;lower byte of a 16 bit data word, ;or not used in 8 bit data word E cnthi equ 1e ;Used as the upper byte of a siteen bit ;loop counter in RDYCHK routine F cnt equ 1f ;Used as the lower byte of a siteen bit ;loop counter in RDYCHK routine, and ;elswhere as an eight bit counter E temp_cmd equ 1e ;doubles as a temp register for cmd F temp_addr equ 1f ;doubles as a temp register for addr ;******************************************************************* ;* Bit Assignments: The following assignments are for 3-wire. For ;* 4-wire assign din and dout to seperate pins carry equ 0 ;Carry Flag of Status Register zflag equ 2 ;Zero Flag of Status Register cs equ 2 ;Port pin tied to CS on 93CX din equ 1 ;Port pin tied to DI on 93CX6. 3-wire dout equ 1 ;Port pin tied to DO on 93CX6. 3-wire clock equ 3 ;Port pin tied to CLK on 93CX ;******************************************************************** 1999 icrochip Technology Inc. DS00530F-page 5

6 00123 ;* General Assignments * ;******************************************************************** no_err equ err1 equ tries equ 20 ;After issuing a WRITE, ERASE, ERAL, or WRAL ;command, the approimate number of machine ;cycles X 256 to wait for the RDY status ;This value must be adjusted for operating ;frequencies other than 4 Hz read equ b ;read command op code write equ b ;write command op code C erase equ b ;erase command op code ewen equ b ;erase enable command op code ewds equ b ;erase disable command op code eral equ b ;erase all command op code wral equ b ;write all command op code ;******************************************************************** ;* acro Definitions * ;******************************************************************** sel ACRO ;Selects the 93CX6 device bsf serial,cs ;Chip Select (CS) = 1 to select END ;the device dsel ACRO ;De-select the 93CX6 device bcf serial,cs ;Chip Select (CS) = 0 to de-select ;the device END strtbt ACRO ;Issue the Start Bit to the 93CX bsf serial,din ;Start Bit = clkit ;Clock it out END clkit ACRO ;Clocks a serial data bit into or out ;of the 93CX6 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = END ; PAGE ;******************************************************************** ;* DOUT * ;******************************************************************** ;dout, outputs up to 11 bits of op code/data, depending on whether ;a 46/56/66 serial eeprom is being used. The number of bits over 8 are ;saved in the cmd register and the rest in the addr register. Before ;calling this routine the cmd and the addr registers should be loaded ;as follows: ;cmd reg.bits ; ; X X X X X X X Y --> not used ; X X X X X X Y X --> mot used ; X X X X X Y X X --> not used ; X X X X Y X X X --> 9th bit of address if necessary ; X X X Y X X X X --> lsb of command op code DS00530F-page icrochip Technology Inc.

7 00189 ; X X Y X X X X X --> 3rd bit of command op code ; X Y X X X X X X --> 2nd bit of command op code ; Y X X X X X X X --> msb of command op code ; ;addr reg. 6/7/8 bits of address if necessary IF H dout bcf serial,din rlf indir ;rotate thru carry btfsc status,carry ;set? bsf serial,din ;yes, set output to clkit ;clk data ENDIF IF H16+H dout rlf indir, F ;rotate thru carry bcf serial,din ;set output to btfsc status,carry ;set? bsf serial,din ;else set output to clkit ;clk data ;of the 93CX6 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = ENDIF IF H8+H16+LC dout rlf indir, F ;rotate thru carry bcf serial,din ;set output to 0 000A btfsc status,carry ;set? 000B bsf serial,din ;else set output to clkit ;clk data ;of the 93CX6 device. 000C 0565 bsf serial,clock ;Clock (CLK) = D 0000 nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period. 000E 0465 bcf serial,clock ;Clock (CLK) = F 02A incf fsr, F ;inc pointer ENDIF dout C movlw 8 ;Initialize loop counter F movwf cnt ; d_o_8 bcf serial,din ;Assume that the bit to be transfered ;is a 0. Hence, de-assert DI rlf indir, F ;Rotate the actual bit to be ;transferred into the carry bit btfsc status,carry ;Test the carry, if our assumption was ;correct, skip the net instruction bsf serial,din ;No, actual bit was a 1. Assert DI clkit ;Clock the 93CX6. ;of the 93CX6 device bsf serial,clock ;Clock (CLK) = icrochip Technology Inc. DS00530F-page 7

8 nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = FF decfsz cnt, F ;Repeat until cnt = A 0A goto d_o_8 ;Cnt still > B rlf indir, F ;Restore register to its original condition. 001C bcf serial,din ;make sure din is low 001D retlw no_err ;Eit with good status ;******************************************************************** ;* DIN8 * ;******************************************************************** ;Din8 will input 8 bits of data from the ;93CX6. Before calling this routine, ;the FSR must point to the register ;being used to hold the incomming data. 001E din IF wire ;set up the RA1 as a input before proceeding 001E 0C movlw b ;set up porta 001F tris serial ; ENDIF C movlw 8 ;Initialize loop counter F movwf cnt ; d_i_ rlf indir, F ;ake room for the incomming bit in the ;destination register bcf indir,0 ;Assume that the incomming bit is a 0 and ;clear the LSB of the destination register clkit ;Clock a bit in the 93CX6. ;of the 93CX6 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = btfsc serial,dout ;Test the incomming bit, if our assumption ;was correct, skip the net instruction bsf indir,0 ;No, actual bit is a 1. Set the LSB of ;the destination register FF decfsz cnt, F ;Repeat until cnt = A 0A goto d_i_8 ;Cnt still > IF wire ;setup RA1 back to output 002B 0C movlw 0 ;set RA1 as output 002C tris serial ; / ENDIF 002D retlw no_err ;Eit with good status ;******************************************************************** ;* RDYCHK * ;******************************************************************** ;Rdychk will read the 93CX6 READY/BUSY status ;and wait for RDY status within the alloted ;number of processor cycles. If RDY status ;is not present after this set period, the ;routine will return with an error status. DS00530F-page icrochip Technology Inc.

9 E rdychk IF wire ;set up RA1 as a input before proceeding 002E 0C movlw b ;set up porta 002F tris serial ; ENDIF C movlw tries ;Initialize time-out counter E movwf cnthi ; F clrf cnt ; dsel ;De-select the 93CX bcf serial,cs ;Chip Select (CS) = 0 to de-select ;the device ; nop ;NOTE: Check the 93CX6 data sheet for ;minimum CS low time. Depending upon ;processor frequency, a nop(s) may be ;between the assertion and de-assertion of ;Chip Select sel ;Re-select the 93CX bsf serial,cs ;Chip Select (CS) = 1 to select notrdy btfsc serial,dout ;If DO is a 0, 93CX6 has yet to completed ;the last operation (still busy) A3E goto rdynoerr ;skip to no error FF decfsz cnt, F ;No, not yet ready. Decrement the LSB of ;our 16 bit timer and check for epiration A goto notrdy ;Still some time left. Try again FE decfsz cnthi, F ;Least significant byte epired - decrement ;and check for epiration of the SB. 003A 0A goto notrdy ;Still some time left. Try again IF wire ;setup RA1 back to output 003B 0C movlw 0 ;set RA1 as output 003C tris serial ; / ENDIF 003D retlw err1 ;RDY status was not present in the alloted ;time, return with error status. 003E rdynoerr IF wire ;setup RA1 back to output 003E 0C movlw 0 ;set porta as output 003F tris serial ; / ENDIF retlw no_err ;******************************************************************** ;* SEE * ;******************************************************************** ;See will control the entire operation of a ;93CX6 device. Prior to calling the routine, ;load a valid command/memory address into ;location cmd, and for WRITE or WRAL ;commands, load registers highb and lowb with ;16 bits of write data. Upon eit, the W ;register will contain the completion status ;Only 93CX6 instructions which require a ;status check can return with an error as the ;completion status. The values that denote ;the completion status are defined as ;variables error and no_err in the ;general assignments section see A movf cmd,w ;save cmd 1999 icrochip Technology Inc. DS00530F-page 9

10 E movwf temp_cmd B movf addr,w ;save addr F movwf temp_addr ; C1A movlw cmd ;Load W with the location of the cmd ;register movwf fsr ;Transfer that information into the ;File Select Register. The fsr now ;points to location cmd sel ;Select the 93CX bsf serial,cs ;Chip Select (CS) = 1 to select strtbt ;Send a start bit bsf serial,din ;Start Bit = 1. clkit ;Clock it out. ;of the 93CX6 device bsf serial,clock ;Clock (CLK) = A 0000 nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93CX6 data for the ;minimum CLK period. 004B 0465 bcf serial,clock ;Clock (CLK) = ; 004C 06FA btfsc cmd,7 ;bit 7 = 0? IF XC goto sca8 ;fer 8 bit cmd/adr ENDIF IF LC goto sca9 ;fer 9 bit cmd/adr ENDIF IF H16 004D 0A goto sca10 ;fer 10 bit cmd/adr ENDIF IF H goto sca11 ;fer 11 bit cmd/adr ENDIF ; goto set_cmd_addr ;no then set cmd/addr 004E 07DA btfss cmd,6 ;bit 6 = 0? IF XC goto sc8 ;fer 8 bit cmd/adr ENDIF IF LC goto sc9 ;fer 9 bit cmd/adr ENDIF IF H16 004F 0A goto sc10 ;fer 10 bit cmd/adr ENDIF IF H goto sc11 ;fer 11 bit cmd/adr ENDIF ; goto set_cmd ;yes then set cmd IF XC goto sca8 ;fer 8 bit cmd/adr ENDIF IF LC goto sca9 ;fer 9 bit cmd/adr ENDIF IF H A goto sca10 ;fer 10 bit cmd/adr ENDIF IF H goto sca11 ;fer 11 bit cmd/adr ENDIF DS00530F-page icrochip Technology Inc.

11 00397 ; goto set_cmd_addr ;else set cmd/addr see E movf temp_cmd,w ;retore cmd A movwf cmd ; / F movf temp_addr,w ;restore addr B movwf addr ; / DA btfsc cmd,6 ;Check for a WRITE or ERASE command A5F goto see2 ;Yes, parse the command further FA btfsc cmd,7 ;Check for a READ command A goto read_ ;Yes, process READ command BA btfsc cmd,5 ;Check for a EWEN or ERAL command. 005A 0A goto see3 ;Yes, parse the command further. 005B 069A btfsc cmd,4 ;Check for a WRAL command. 005C 0A6E goto write_ ;Yes, process WRITE/WRAL command eit_ dsel ;No further processing required; 93CX6 005D 0445 bcf serial,cs ;Chip Select (CS) = 0 to de-select ;the device ;command completed ; 005E retlw no_err ;Return with good completion status F 07FA see2 btfss cmd,7 ;Check for a ERASE command A6E goto write_ ;No, process WRITE command E eit2_ call rdychk ;ERASE command requires a status check dsel ;De-select the 93CX bcf serial,cs ;Chip Select (CS) = 0 to de-select ;the device E addwf pc, F ;Compute completion status from ;results of status check retlw no_err ;Return with good completion status retlw err1 ;Return with bad completion status A see3 btfsc cmd,4 ;Check for a EWEN command A5D goto eit_ ;Yes, no further processing required, ;eit now A goto eit2_ ;No, ERAL command which requires a ;status check A read_ incf fsr, F ;Increment the File Select Register to ;point to the register receiving the upper ;byte of the incomming 93CX6 data word. 006A 091E call din8 ;Input the upper byte IF org ELSE 006B 02A incf fsr, F ;Increment the File Select Register to point ;to the register receiving the lower byte. 006C 091E call din8 ;Input 8 more bits ENDIF 006D 0A5D goto eit_ ;No further processing required, eit now E 02A write_ incf fsr, F ;Increment the File Select Register to point ;to the upper byte of the 16 bit 93CX6 data ;word to be transmitted. 006F call dout8 ;Output that byte IF org ELSE A incf fsr, F ;Increment the File Select Register to point ;to the lower byte call dout8 ;Output the lower byte of the 16 bit 93CX ;data word ENDIF A goto eit2_ ;Eit with a status check ; ; 1999 icrochip Technology Inc. DS00530F-page 11

12 00459 IF XC sca movlw b ;clr all but hi andwf cmd,w ;save in w iorwf addr ;mask in addr incf fsr ;inc FSR call dout8 ;output goto see1 ;return ENDIF IF LC ; sca bcf addr,7 ;clr hi of addr btfsc cmd,6 ;fer cmd s bit bsf addr,7 ;to addr s bit call dout9 ;output goto see1 ;return ENDIF IF H ; sca call dout10 ;output cmd reg A goto see1 ;return ENDIF ; IF H sca bcf cmd,5 ;fer cmd s bit 3 to btfsc cmd,3 ;cmd s bit bsf cmd,5 ; / call dout11 ;output goto see1 ;return ; ENDIF ; ; ; IF XC sc movf cmd,w ;get command movwf addr ;save in addr incf fsr ;inc pointer call dout8 ;output goto see1 ;return ; ENDIF IF LC sc rlf cmd,w ;rotate cmd left movwf addr ;save in addr call dout9 ;fer 9 bits goto see1 ;return ENDIF IF H ; sc A rlf cmd, F ;rotate cmd A rlf cmd,w ;left twice B movwf addr ;save in addr A clrf cmd ;clear command call dout10 ;fer 10 bits 007A 0A goto see1 ;return ENDIF ; IF H sc11 DS00530F-page icrochip Technology Inc.

13 00525 bcf addr,7 ;fer cmd s bit btfsc cmd,4 ;to addr s bit bsf addr,7 ; / call dout11 ;fer 11 bits goto see1 ;return ENDIF ;******************************************************************** ;* Test Program * ;******************************************************************** ; 007B main ;We ve include a sample program to ;eercise the PIC to 93C66 interface ;using a simple erase, write and verify ;routine.8 bit organization has been ;used with a 3 wire interface B clrf serial ;Clear the port tied to the 93C66 device. 007C 0CF movlw b ;Intialize the data direction register 007D tris serial ;for that port E 0C movlw ewen ;Load W with the Erase/Write Enable command. 007F 003A movwf cmd ;Transfer W into cmd register call see ;Enable the 93C66 device C movlw eral ;Load W with the Erase All command A movwf cmd ;Transfer W into cmd register call see ;Erase the 93C F orlw err1 ;Check completion status btfsc status, zflag ;Test for error condition AA goto errloop ;Yes, bad completion status, error-out ;Write loop: AA tstptrn equ 0AA ;Define the test pattern to be written C movlw write ;Load W with the Write command A movwf cmd ;Transfer W into cmd register CAA movlw tstptrn ;Intialize the 93C66 data registers with ;write data. 008A 003C movwf highb ;load in high byte only ;since 8 bit low byte is ignored 008B 007B clrf addr ;start at addr 0 008C test1 call see ;Write data word into 93C66 device. 008D 0F orlw err1 ;Check completion status. 008E btfsc status,zflag ;Test for error condition. 008F 0AA goto errloop ;Yes, bad completion status, error-out FB incfsz addr, F ;No, increment the 8 bit memory address ;field A8C goto test1 ;write another location A btfss cmd,3 ;see if all done A goto wrt_nt_pg ;no then write net page A goto read_tst ;read written data wrt_nt_pg A bsf cmd,3 ;set page bit A8C goto test1 ;No, write another location ;Read loop: read_tst C movlw read ;Load W with the Read command A movwf cmd ;Transfer W into cmd register test2 call see ;Read addressed data word from 93C66 device. 009A 0CAA movlw tstptrn ;Load W with the pattern written. 009B 009C subwf highb,w ;Verify the data read against what was ;written. 009C btfss status,zflag ;Same? 009D 0AA goto errloop ;No, error-out. 009E 03FB incfsz addr, F ;Yes, both byte correct, increment the 8 bit 1999 icrochip Technology Inc. DS00530F-page 13

14 00591 ;memory address field. 009F 0A goto test2 ;do net byte 00A0 077A btfss cmd,3 ;check page bit 00A1 0AA goto rd_nt_pg ;no then chk net page 00A2 0AA goto allok ;all done!!! 00A rd_nt_pg 00A3 057A bsf cmd,3 ;set page bit 00A4 0A goto test2 ;No, read another location A5 0AA allok goto allok ;Home safe! ; ; 00A errloop 00A6 0AA goto errloop ; ; ; ;KEY DEFINITIONS ; 01FF ORG PIC54 01FF SYS_RESET 01FF 0A GOTO START ; END EORY USAGE AP ( X = Used, - = Unused) 0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXX C0 : X All other memory blocks unused. Program emory Words Used: 168 Program emory Words Free: 344 Errors : 0 Warnings : 0 reported, 0 suppressed essages : 0 reported, 0 suppressed DS00530F-page icrochip Technology Inc.

15 Please check the icrochip Worldwide Website at for the latest version of the source code. APPENDIX B: 93C46.AS PAS Released 93C46.AS :13:14 PAGE 1 LOC OBJECT CODE VALUE LINE SOURCE TEXT ;******************************************************************** ;* PICALC Directives Section * ;******************************************************************** SUBTITL 93C46 3 WIRE INTERFACE ROUTINE LIST P=16C54,N=40,C= ;************************************************************************ ; ; ; Program: 93C46.AS ; Revision Date: ; Compatibility with PASWIN ; ;************************************************************************ ; ;******************************************************************** ;* Register Assignments * ;******************************************************************** indir equ 000 ;Use this register as source/destination for ;indirect addressing pc equ 002 ;PIC Program Counter status equ 003 ;PIC Status Register fsr equ 004 ;File Select Register serial equ 005 ;Port used for 93C46 control. Port A is ;4 bits wide, we ll use 3 or 4 of Port A F EQU ;The following three registers must be ;located consecutively in memory cmd equ 010 ;This register contains the 2 bit 93C ;command is the upper 2 bit positions and ;memory address in the lower highb equ 011 ;Used in read/write routines to store the ;upper byte of a 16 bit 93C46 data word lowb equ 012 ;Used in read/write routines to store the ;lower byte of a 16 bit 93C46 data word cnthi equ 013 ;Used as the upper byte of a siteen bit loop ;counter in RDYCHK routine cnt equ 014 ;Used as the lower byte of a siteen bit loop ;counter in RDYCHK routine, and elsewhere as ;an eight bit counter ;******************************************************************** ;* Bit Assignments: The following assignment is for 3-wire setup ;* For 4-wire setup assign din and dout to seperate pins carry equ 0 ;Carry Flag of Status Register zflag equ 2 ;Zero Flag of Status Register ;For the 3 wire interface, connect the din and dout to the same ;i/o line of the PIC16C5X cs equ 0 ;Port pin tied to CS on 93C din equ 1 ;Port pin tied to DI on 93C46. 3-wire 1999 icrochip Technology Inc. DS00530F-page 15

16 dout equ 1 ;Port pin tied to DO on 93C46. 3-wire clock equ 2 ;Port pin tied to CLK on 93C ;******************************************************************** ;* General Assignments * ;******************************************************************** no_err equ 0 ; err1 equ 1 ; tries equ 004 ;After issuing a WRITE, ERASE, ERAL, or WRAL ;command, the approimate number of machine ;cycles X 256 to wait for the RDY status ;This value must be adjusted for operating ;frequencies other than 4 Hz read equ 080 ;93C46 Read command write equ 040 ;93C46 Write command C erase equ 0C0 ;93C46 Erase command ewen equ 030 ;93C46 Erase/Write Enable command ewds equ 000 ;93C46 Erase/Write Disable command eral equ 020 ;92CXX Erase All command wral equ 010 ;92CXX Write All command ;******************************************************************** ;* acro Definitions * ;******************************************************************** sel ACRO ;Selects the 93C46 device bsf serial,cs ;Chip Select (CS) = 1 to select the device END dsel ACRO ;De-select the 93C46 device bcf serial,cs ;Chip Select (CS) = 0 to de-select the ;device END strtbt ACRO ;Issue the Start Bit to the 93C bsf serial,din ;Start Bit = clkit ;Clock it out END clkit ACRO ;Clocks a serial data bit into or out of the ;93C46 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93C46 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = END ;******************************************************************** ;* Power-On/Reset Entry Point * ;******************************************************************** FF reset_ org 01FF 01FF 0A goto main ;******************************************************************** ;* 93C46 Routines * ;******************************************************************** org 0000 ;Locate all subroutines in the lower half of ;a Program emory Page. DS00530F-page icrochip Technology Inc.

17 ;******************************************************************** ;* DOUT8 * ;******************************************************************** ;Dout8 will output 8 bits of data to the ;93C46. Before calling this routine, the FSR ;must point to the byte being transmitted C dout8 movlw 008 ;Initialize loop counter movwf cnt ; d_o_8 bcf serial,din ;Assume that the bit to be transfered is a ; 0. Hence, de-assert DI rlf indir, F ;Rotate the actual bit to be transferred into ;the carry bit btfsc status,carry ;Test the carry, if our assumption was ;correct, skip the net instruction bsf serial,din ;No, actual bit was a 1. Assert DI clkit ;Clock the 93C46. ;93C46 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93C46 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = F decfsz cnt, F ;Repeat until cnt = A 0A goto d_o_8 ;Cnt still > B rlf indir, F ;Restore register to its original condition. 000C retlw no_err ;Eit with good status ;******************************************************************** ;* DIN8 * ;******************************************************************** ;Din8 will input 8 bits of data from the ;93C46. Before calling this routine, the FSR ;must point to the register being used to ;hold the incomming data. 000D 0C din8 movlw 008 ;Initialize loop counter. 000E movwf cnt ; ;for the 3 wire interface the direction of the i/o line connected to ;din and dout has to converted from an output to an input. 000F 0C movlw b ;convert RA1 to an input tris serial ; / d_i_8 clkit ;Clock a bit out of the 93C46. ;93C46 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93C46 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = rlf indir, F ;ake room for the incomming bit in the ;destination register bcf indir,0 ;Assume that the incomming bit is a 0 and ;clear the LSB of the destination register btfsc serial,dout ;Test the incomming bit, if our assumption ;was correct, skip the net instruction bsf indir,0 ;No, actual bit is a 1. Set the LSB of the 1999 icrochip Technology Inc. DS00530F-page 17

18 00169 ;destination register F decfsz cnt, F ;Repeat until cnt = A goto d_i_8 ;Cnt still > ;for a 3 wire interface, convert the RA1 line back to an output 001A 0C movlw 0 ;make RA1 to an output 001B tris serial ; / 001C retlw no_err ;Eit with good status ;******************************************************************** ;* RDYCHK * ;******************************************************************** ;Rdychk will read the 93C46 READY/BUSY status ;and wait for RDY status within the alloted ;number of processor cycles. If RDY status ;is not present after this set period, the ;routine will return with an error status D 0C rdychk movlw tries ;Initialize time-out counter. 001E movwf cnthi ; 001F clrf cnt ; ;for a 3 wire interface, make the RA1 line an input C movlw b ; tris serial dsel ;De-select the 93C bcf serial,cs ;Chip Select (CS) = 0 to de-select the ;device ; nop ;NOTE: Check the 93C46 data sheet for ;minimum CS low time. Depending upon ;processor frequency, a nop(s) may be ;between the assertion and de-assertion of ;Chip Select sel ;Re-select the 93C bsf serial,cs ;Chip Select (CS) = 1 to select the device notrdy btfsc serial,dout ;If DO is a 0, 93C46 has yet to completed ;the last operation (still busy) A2D goto no_error ;Otherwise RDY status is present within the ;alloted time, and return with good status F decfsz cnt, F ;No, not yet ready. Decrement the LSB of our ;16 bit timer and check for epiration A goto notrdy ;Still some time left. Try again F decfsz cnthi, F ;Least significant byte epired - decrement ;and check for epiration of the SB A goto notrdy ;Still some time left. Try again ;for a 3 wire interface, convert RA1 line back to an ouput 002A 0C movlw 0 ;convert RA1 to an output 002B tris serial ; / 002C retlw err1 ;RDY status was not present in the alloted ;time, return with error status. 002D no_error ;for a 3 wire interface, convert RA1 line back to an ouput 002D 0C movlw 0 ;convert RA1 to an output 002E tris serial ; / 002F retlw no_err ;******************************************************************** ;* SEE * ;******************************************************************** ;See will control the entire operation of a ;93C46 device. Prior to calling the routine, ;load a valid command/memory address into ;location cmd, and for WRITE or WRAL ;commands, load registers highb and lowb with DS00530F-page icrochip Technology Inc.

19 00232 ;16 bits of write data. Upon eit, the W ;register will contain the completion status ;Only 93C46 instructions which require a ;status check can return with an error as the ;completion status. The values that denote ;the completion status are defined as ;variables error and no_err in the ;general assignments section C see movlw cmd ;Load W with the location of the cmd ;register movwf fsr ;Transfer that information into the File ;Select Register. The fsr now points to ;location cmd sel ;Select the 93C bsf serial,cs ;Chip Select (CS) = 1 to select the device strtbt ;Send a start bit bsf serial,din ;Start Bit = 1. clkit ;Clock it out. ;93C46 device bsf serial,clock ;Clock (CLK) = nop ;Adjust the number of nop instructions ;between the assertion and de-assertion of ;CLK in proportion to the PIC operating ;frequency. Refer to the 93C46 data for the ;minimum CLK period bcf serial,clock ;Clock (CLK) = call dout8 ;Transmit the 2 bit command and si bit ;address D btfsc cmd,6 ;Check for a WRITE or ERASE command A goto see2 ;Yes, parse the command further. 003A 06F btfsc cmd,7 ;Check for a READ command. 003B 0A4C goto read_ ;Yes, process READ command. 003C 06B btfsc cmd,5 ;Check for a EWEN or ERAL command. 003D 0A goto see3 ;Yes, parse the command further. 003E btfsc cmd,4 ;Check for a WRAL command. 003F 0A goto write_ ;Yes, process WRITE/WRAL command eit_ dsel ;No further processing required; 93C bcf serial,cs ;Chip Select (CS) = 0 to de-select the ;device ;command completed retlw no_err ;Return with good completion status F see2 btfss cmd,7 ;Check for a ERASE command A goto write_ ;No, process WRITE command D eit2_ call rdychk ;ERASE command requires a status check dsel ;De-select the 93C bcf serial,cs ;Chip Select (CS) = 0 to de-select the ;device E addwf pc, F ;Compute completion status from results of ;status check retlw no_err ;Return with good completion status retlw err1 ;Return with bad completion status see3 btfsc cmd,4 ;Check for a EWEN command. 004A 0A goto eit_ ;Yes, no further processing required, eit ;now. 004B 0A goto eit2_ ;No, ERAL command which requires a status ;check C 02A read_ incf fsr, F ;Increment the File Select Register to point ;to the register receiving the upper byte of ;the incomming 93C46 data word icrochip Technology Inc. DS00530F-page 19

20 004D 090D call din8 ;Input the upper byte. 004E 02A incf fsr, F ;Increment the File Select Register to point ;to the register receiving the lower byte. 004F 090D call din8 ;Input 8 more bits A goto eit_ ;No further processing required, eit now A write_ incf fsr, F ;Increment the File Select Register to point ;to the upper byte of the 16 bit 93C46 data ;word to be transmitted call dout8 ;Output that byte A incf fsr, F ;Increment the File Select Register to point ;to the lower byte call dout8 ;Output the lower byte of the 16 bit 93C ;data word A goto eit2_ ;Eit with a status check ;******************************************************************** ;* Test Program * ;******************************************************************** ; main ;We ve include a sample program to eercise ;the PIC to 93C46 interface using a simple ;erase, write and varify routine clrf serial ;Clear the port tied to the 93C46 device CF movlw b ;Intialize the data direction register for tris serial ;that port C movlw ewen ;Load W with the Erase/Write Enable command. 005A movwf cmd ;Transfer W into cmd register. 005B call see ;Enable the 93C46 device C 0C movlw eral ;Load W with the Erase All command. 005D movwf cmd ;Transfer W into cmd register. 005E call see ;Erase the 93C F 0F orlw err1 ;Check completion status btfsc status, zflag ;Test for error condition A goto errloop ;Yes, bad completion status, error-out ;Write loop: F loopcnt equ 01F ;Define an unused location for our test ;program loop counter AA tstptrn equ 0AA ;Define the test pattern to be written C movlw.64 ;Initialize that counter F movwf loopcnt ; C movlw write ;Load W with the Write command movwf cmd ;Transfer W into cmd register CAA movlw tstptrn ;Intialize the 93C46 data registers with ;write data movwf highb ; movwf lowb ; test1 call see ;Write data word into 93C46 device. 006A 0F orlw err1 ;Check completion status. 006B btfsc status,zflag ;Test for error condition. 006C 0A goto errloop ;Yes, bad completion status, error-out. 006D 02B incf cmd, F ;No, increment the 6 bit memory address ;field. 006E 02FF decfsz loopcnt, F ;Have we written all 64 locations? 006F 0A goto test1 ;No, write another location ;Read loop: C movlw.64 ;Initialize loop counter F movwf loopcnt ; C movlw read ;Load W with the Read command. DS00530F-page icrochip Technology Inc.

21 movwf cmd ;Transfer W into cmd register test2 call see ;Read addressed data word from 93C46 device CAA movlw tstptrn ;Load W with the pattern written subwf highb,0 ;Verify the data read against what was ;written btfss status,zflag ;Same? A goto errloop ;No, error-out CAA movlw tstptrn ;Repeat with the lower byte read. 007A subwf lowb,0 ; 007B btfss status,zflag ;Same? 007C 0A goto errloop ;No, error-out. 007D 02B incf cmd, F ;Yes, both byte correct, increment the 6 bit ;memory address field. 007E 02FF decfsz loopcnt, F ;Have we read all 64 locations? 007F 0A goto test2 ;No, read another location A allok goto allok ;Home safe! A errloop goto errloop ;Bad news! END ;Thats all folks! EORY USAGE AP ( X = Used, - = Unused) 0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX 0080 : XX C46 3 WIRE INTERFACE ROUTINE EORY USAGE AP ( X = Used, - = Unused) 01C0 : X All other memory blocks unused. Program emory Words Used: 131 Program emory Words Free: 381 Errors : 0 Warnings : 0 reported, 0 suppressed essages : 0 reported, 0 suppressed 1999 icrochip Technology Inc. DS00530F-page 21

22 NOTES: DS00530F-page icrochip Technology Inc.

23 NOTES: 1999 icrochip Technology Inc. DS00530F-page 23

24 Note the following details of the code protection feature on PICmicro CUs. The PICmicro family meets the specifications contained in the icrochip Data Sheet. icrochip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet. The person doing so may be engaged in theft of intellectual property. icrochip is willing to work with the customer who is concerned about the integrity of their code. Neither icrochip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable. Code protection is constantly evolving. We at icrochip are committed to continuously improving the code protection features of our product. If you have any further questions about this matter, please contact the local sales office nearest to you. Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by icrochip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of icrochip s products as critical components in life support systems is not authorized ecept with epress written approval by icrochip. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. Trademarks The icrochip name and logo, the icrochip logo, FilterLab, KEELOQ, microid, PLAB, PIC, PICmicro, PICASTER, PICSTART, PRO ATE, SEEVAL and The Embedded Control Solutions Company are registered trademarks of icrochip Technology Incorporated in the U.S.A. and other countries. dspic, ECONOONITOR, FanSense, FleRO, fuzzylab, In-Circuit Serial Programming, ICSP, ICEPIC, microport, igratable emory, PAS, PLIB, PLINK, PSI, XDEV, PICC, PICDE, PICDE.net, rfpic, Select ode and Total Endurance are trademarks of icrochip Technology Incorporated in the U.S.A. Serialized Quick Turn Programming (SQTP) is a service mark of icrochip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. 2002, icrochip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. icrochip received QS-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July The Company s quality system processes and procedures are QS-9000 compliant for its PICmicro 8-bit CUs, KEELOQ code hopping devices, Serial EEPROs and microperipheral products. In addition, icrochip s quality system for the design and manufacture of development systems is ISO 9001 certified icrochip Technology Inc.

AN530. Interfacing 93 Series Serial EEPROMs. Interfacing 93CX6 Serial EEPROMs to PIC16C5X Microcontrollers INTRODUCTION THE HARDWARE CONNECTION

AN530. Interfacing 93 Series Serial EEPROMs. Interfacing 93CX6 Serial EEPROMs to PIC16C5X Microcontrollers INTRODUCTION THE HARDWARE CONNECTION AN530 Interfacing 93CX6 Serial EEPROMs to PIC16C5X Microcontrollers INTRODUCTION Microchip Technology Inc. s popular 93C46/56/66 and 93LC46/56/66 Serial EEPROMs feature a three/four wire serial interface

More information

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester

Embedded Systems. PIC16F84A Sample Programs. Eng. Anis Nazer First Semester Embedded Systems PIC16F84A Sample Programs Eng. Anis Nazer First Semester 2017-2018 Development cycle (1) Write code (2) Assemble / compile (3) Simulate (4) Download to MCU (5) Test Inputs / Outputs PIC16F84A

More information

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar

Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Starting to Program Chapter 4 Sections 1 4, 10 Dr. Iyad Jafar Outline Introduction Program Development Process The PIC 16F84A Instruction Set Examples The PIC 16F84A Instruction Encoding Assembler Details

More information

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2006 Recitation 01 21.02.2006 CEng336 1 OUTLINE LAB & Recitation Program PIC Architecture Overview PIC Instruction Set PIC Assembly Code Structure 21.02.2006

More information

Assembly Language Instructions

Assembly Language Instructions Assembly Language Instructions Content: Assembly language instructions of PIC16F887. Programming by assembly language. Prepared By- Mohammed Abdul kader Assistant Professor, EEE, IIUC Assembly Language

More information

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Lesson 14 Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27) Name and affiliation of the author: N W K Jayatissa Department of Physics,

More information

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010

TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE. E4160 Microprocessor & Microcontroller System. Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 TOPIC 3 INTRODUCTION TO PIC ASSEMBLY LANGUAGE Prepared by : Puziah Yahaya JKE, POLISAS / DEC 2010 E4160 Microprocessor & Microcontroller System Learning Outcomes 2 At the end of this topic, students should

More information

Chapter 5 Sections 1 6 Dr. Iyad Jafar

Chapter 5 Sections 1 6 Dr. Iyad Jafar Building Assembler Programs Chapter 5 Sections 1 6 Dr. Iyad Jafar Outline Building Structured Programs Conditional Branching Subroutines Generating Time Delays Dealing with Data Example Programs 2 Building

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design Year: IV DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 Microcontroller based system design Semester : VII UNIT I Introduction to PIC Microcontroller

More information

Instuction set

Instuction set Instuction set http://www.piclist.com/images/www/hobby_elec/e_pic3_1.htm#1 In PIC16 series, RISC(Reduced Instruction Set Computer) is adopted and the number of the instructions to use is 35 kinds. When

More information

SOLUTIONS!! DO NOT DISTRIBUTE!!

SOLUTIONS!! DO NOT DISTRIBUTE!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF FEBRUARY MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: Date and Time: Duration: One Hour INSTRUCTIONS TO CANDIDATES:

More information

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution

16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 16.317: Microprocessor Systems Design I Fall 2013 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

A Better Mouse Trap. Consumer Appliance, Widget, Gadget APPLICATION OPERATION: Ontario, Canada

A Better Mouse Trap. Consumer Appliance, Widget, Gadget APPLICATION OPERATION: Ontario, Canada A Better Mouse Trap Author: APPLICATION OPERATION: My application uses a PIC12C508 to produce realistic sounding mouse-like coos that all mice are sure to find seductive. The entire circuit should be imbedded

More information

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution

EECE.3170: Microprocessor Systems Design I Summer 2017 Homework 5 Solution For each of the following complex operations, write a sequence of PIC 16F1829 instructions that performs an equivalent operation. Assume that X, Y, and Z are 16-bit values split into individual bytes as

More information

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PIC6F87X 3.0 INSTRUCTION SET SUMMARY Each PIC6F87X instruction is a 4bit word, divided into an OPCODE which specifies the instruction type and one or more operands which further specify the operation of

More information

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017

Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Philadelphia University Faculty of Engineering Course Title: Embedded Systems (630414) Instructor: Eng. Anis Nazer Dept. of Computer Engineering Final Exam, First Semester: 2016/2017 Student Name: Student

More information

PIC 16F84A programming (II)

PIC 16F84A programming (II) Lecture (05) PIC 16F84A programming (II) Dr. Ahmed M. ElShafee ١ Introduction to 16F84 ٣ PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Program memory (FLASH) EEPROM RAM PORTA

More information

Lecture (04) PIC16F84A (3)

Lecture (04) PIC16F84A (3) Lecture (04) PIC16F84A (3) By: Dr. Ahmed ElShafee ١ Central Processing Unit Central processing unit (CPU) is the brain of a microcontroller responsible for finding and fetching the right instruction which

More information

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work

LAB WORK 2. 1) Debugger-Select Tool-MPLAB SIM View-Program Memory Trace the program by F7 button. Lab Work LAB WORK 1 We are studying with PIC16F84A Microcontroller. We are responsible for writing assembly codes for the microcontroller. For the code, we are using MPLAB IDE software. After opening the software,

More information

EEE111A/B Microprocessors

EEE111A/B Microprocessors EEE111A/B Microprocessors Revision Notes Lecture 1: What s it all About? Covers the basic principles of digital signals. The intelligence of virtually all communications, control and electronic devices

More information

AN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS

AN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS Interfacing to an LCD Module AN587 INTRODUCTION TABLE 1: CONTROL SIGNAL FUNCTIONS This application note interfaces a PIC16CXX device to the Hitachi LM02L LCD character display module. This module is a

More information

16.317: Microprocessor-Based Systems I Spring 2012

16.317: Microprocessor-Based Systems I Spring 2012 16.317: Microprocessor-Based Systems I Spring 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 Semester 2 Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J2 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

AN812. Paralleling the TC1121 to Reduce Output Resistance for Driving Higher Load Currents INTRODUCTION SUMMARY SINGLE TC1121 APPLICATION CIRCUIT

AN812. Paralleling the TC1121 to Reduce Output Resistance for Driving Higher Load Currents INTRODUCTION SUMMARY SINGLE TC1121 APPLICATION CIRCUIT Paralleling the TC1121 to Reduce Output Resistance for Driving Higher Load Currents Author: INTRODUCTION Patrick Maresca, Microchip Technology, Inc. Microchip Technology's TC1121 is a charge pump voltage

More information

Chapter 13. PIC Family Microcontroller

Chapter 13. PIC Family Microcontroller Chapter 13 PIC Family Microcontroller Lesson 15 Instruction Set Most instructions execution Time One instruction cycle If XTAL frequency = 20 MHz, then instruction cycle time is 0.2 s or 200 ns (= 4/20

More information

Flow Charts and Assembler Programs

Flow Charts and Assembler Programs Flow Charts and Assembler Programs Flow Charts: A flow chart is a graphical way to display how a program works (i.e. the algorithm). The purpose of a flow chart is to make the program easier to understand.

More information

ECE Test #1: Name

ECE Test #1: Name ECE 376 - Test #1: Name Closed Book, Closed Notes. Calculators Permitted. September 23, 2016 20 15 10 5 0

More information

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 6 Experiment 6:Timers Objectives To become familiar with hardware timing

More information

When JP1 is cut, baud rate is Otherwise, baud rate is Factory default is that JP1 is shorted. (JP1 is jumper type in some model)

When JP1 is cut, baud rate is Otherwise, baud rate is Factory default is that JP1 is shorted. (JP1 is jumper type in some model) ELCD SERIES INTRODUCTION ALCD is Serial LCD module which is controlled through Serial communication. Most of existing LCD adopts Parallel communication which needs lots of control lines and complicated

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J1 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF APRIL MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: MidTerm Date and Time: Thursday April 14th 2005 8AM Duration:

More information

AN586. Macros for Page and Bank Switching INTRODUCTION

AN586. Macros for Page and Bank Switching INTRODUCTION Macros for Page and Bank Switching Author: Mark Palmer Microchip Technology Inc. Contributions: Mike Morse Sr. Field Applications Engineer (Dallas) INTRODUCTION This application note discusses the use

More information

AN511. PLD Replacement INTRODUCTION IMPLEMENTING A PLA. Microchip Technology, Inc.

AN511. PLD Replacement INTRODUCTION IMPLEMENTING A PLA. Microchip Technology, Inc. AN5 PLD Replacement Author: INTRODUCTION Sumit itra icrochip Technology, Inc. PIC6C5X microcontrollers are ideal for implementing low cost combinational and sequential logic circuits that traditionally

More information

ME 515 Mechatronics. A microprocessor

ME 515 Mechatronics. A microprocessor ME 515 Mechatronics Microcontroller Based Control of Mechanical Systems Asanga Ratnaweera Department of Faculty of Engineering University of Peradeniya Tel: 081239 (3627) Email: asangar@pdn.ac.lk A microprocessor

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE Microcontroller Based System Design

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE Microcontroller Based System Design DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 - Microcontroller Based System Design UNIT III PERIPHERALS AND INTERFACING PART A 1. What is an

More information

PTK8756B 8 Bit Micro-controller Data Sheet

PTK8756B 8 Bit Micro-controller Data Sheet PTK8756B 8 Bit Micro-controller DEC 15, 2008 Ver1.1 普泰半導體股份有限公司 PORTEK Technology Corporation 公司地址 : 臺北縣新店市寶橋路 235 巷 120 號 4 樓 聯絡電話 : 886-2-89121055 傳真號碼 : 886-2-89121473 公司網址 : www.portek.com.tw Page1

More information

Designed to GO... Universal Battery Monitor Using the bq2018 Power Minder IC. Typical Applications. Features. Figure 1. bq2018 Circuit Connection

Designed to GO... Universal Battery Monitor Using the bq2018 Power Minder IC. Typical Applications. Features. Figure 1. bq2018 Circuit Connection Designed to GO... Practical and Cost-Effective Battery Management Design Examples by Benchmarq Series 2018, Number One Universal Battery Monitor Using the bq2018 Power Minder IC Features Counts charge

More information

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1.

Fortune. Semiconductor Corporation 富晶半導體股份有限公司. 8-bit MCU with 1k program ROM, 64-byte RAM, 1 R2F module and 3 13 LCD driver. TD Rev. 1. Fortune 1 R2F module and 3 13 LCD driver. Data Sheet TD-0410001 Rev. 1.2 This manual contains new product information. Fortune reserves the rights to modify the product specification without further notice.

More information

D:\PICstuff\PartCounter\PartCounter.asm

D:\PICstuff\PartCounter\PartCounter.asm 1 ;********************************************************************** 2 ; This file is a basic code template for assembly code generation * 3 ; on the PICmicro PIC16F84A. This file contains the basic

More information

Discrete Logic Replacement A Keypad Controller for Bi-directional Key Matrix

Discrete Logic Replacement A Keypad Controller for Bi-directional Key Matrix A Keypad Controller for Bi-directional Key Matrix Author: Vladimir Velchev AVEX - Vladimir Velchev Sofia, Bulgaria email:avex@iname.com APPLICATION OPERATION: The PIC microcontroller can replace the traditional

More information

Wireless Model Rocket Igniter, William Grill, Riverhead Systems

Wireless Model Rocket Igniter, William Grill, Riverhead Systems Wireless Model Rocket Igniter, William Grill, Riverhead Systems Modified from an earlier Gadget, Gadget Freak Case #124: Controlling the Rocket Fire, the simple controller based igniter monitor published

More information

Micro II and Embedded Systems

Micro II and Embedded Systems 16.480/552 Micro II and Embedded Systems Introduction to PIC Microcontroller Revised based on slides from WPI ECE2801 Moving Towards Embedded Hardware Typical components of a PC: x86 family microprocessor

More information

HT93LC56. CMOS 2K 3-Wire Serial EEPROM. Features. General Description. Block Diagram. Pin Assignment

HT93LC56. CMOS 2K 3-Wire Serial EEPROM. Features. General Description. Block Diagram. Pin Assignment CMOS 2K 3-Wire Serial EEPROM Features Operating voltage V CC Read: 2.0V~5.5V Write: 2.4V~5.5V Low power consumption Operating: 5mA max. Standby: 10A max. User selectable internal organization 2K(HT93LC56):

More information

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller

APPLICATION NOTE Wire Communication with a Microchip PICmicro Microcontroller Maxim > App Notes > 1-Wire DEVICES BATTERY MANAGEMENT Keywords: 1-wire, PICmicro, Microchip PIC, 1-Wire communication, PIC microcontroller, PICmicro microcontroller, 1 wire communication, PICs, micros,

More information

PIC Discussion. By Eng. Tamar Jomaa

PIC Discussion. By Eng. Tamar Jomaa PIC Discussion By Eng. Tamar Jomaa Chapter#2 Programming Microcontroller Using Assembly Language Quiz#1 : Time: 10 minutes Marks: 10 Fill in spaces: 1) PIC is abbreviation for 2) Microcontroller with..architecture

More information

Embedded System Design

Embedded System Design ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design : Microcontroller 1. Introduction to PIC microcontroller 2. PIC16F84 3. PIC16F877

More information

INTRODUCTION HARDWARE INTERFACE

INTRODUCTION HARDWARE INTERFACE Order this document by AN1241 Interfacing the MC68HC705J1A to 9356/9366 EEPROMs By Mark Glenewinkel CSIC Applications INTRODUCTION This application note describes the hardware and software interface used

More information

Discrete Logic Replacement Message Dispatch Engine

Discrete Logic Replacement Message Dispatch Engine Message Dispatch Engine Author: OVERVIEW As we all know, the 8-pin PICmicro has limited resources. A nice way of using interrupts is for queuing events, prioritizing them, or even buffering them. This

More information

ECE 354 Introduction to Lab 2. February 23 rd, 2003

ECE 354 Introduction to Lab 2. February 23 rd, 2003 ECE 354 Introduction to Lab 2 February 23 rd, 2003 Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system supervisors

More information

Beacon Keyers Using PIC s. Dave Powis, DL/G4HUP

Beacon Keyers Using PIC s. Dave Powis, DL/G4HUP Beacon Keyers Using PIC s Dave Powis, DL/G4HUP What are PIC s PIC s (Programmable Intelligent Controllers?) are the range of embedded microcontroller parts manufactured by Arizona Microchip [1]. Similar

More information

SX Device In-System Programming Specifications

SX Device In-System Programming Specifications SX Device In-System Programming Specifications. SX Device Programming Specifications Rev 2.0 1999 Scenix Semiconductor, Inc. All rights reserved. Revision History REVISION RELEASE DATE SUMMARY OF CHANGES

More information

Interfacing PIC Microcontrollers. ADC8BIT2 Schematic. This application demonstrates analogue input sampling

Interfacing PIC Microcontrollers. ADC8BIT2 Schematic. This application demonstrates analogue input sampling Interfacing PIC Microcontrollers ADC8BIT2 Schematic This application demonstrates analogue input sampling A manually adjusted test voltage 0-5V is provided at AN0 input A reference voltage of 2.56V is

More information

16.317: Microprocessor-Based Systems I Summer 2012

16.317: Microprocessor-Based Systems I Summer 2012 16.317: Microprocessor-Based Systems I Summer 2012 Exam 3 Solution 1. (20 points, 5 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

TB079. Programming Baseline Flash Devices with PICkit 1 PIC12F508/509 AND PIC16F505 PROGRAMMING INTRODUCTION. PICkit 1 FIRMWARE VERSION 2.0.

TB079. Programming Baseline Flash Devices with PICkit 1 PIC12F508/509 AND PIC16F505 PROGRAMMING INTRODUCTION. PICkit 1 FIRMWARE VERSION 2.0. TB079 Baseline Flash Devices with PICkit 1 Author: INTRODUCTION The PICkit 1 Baseline Flash Programmer PC application together with the PICkit 1 Flash Starter Kit firmware version 2.0.0 or later can program

More information

R&E International A Subsidiary of Microchip Technology Inc.

R&E International A Subsidiary of Microchip Technology Inc. RE46C104 General Description The RE46C104 is a piezoelectric horn driver with voltage converter to provide maximum audibility in low voltage applications. The feedback control pin is designed for use with

More information

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller Maxim/Dallas > App Notes > REAL-TIME CLOCKS Keywords: DS1305, SPI, PIC, real time clock, RTC, spi interface, pic microcontroller Aug 20, 2003 APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with

More information

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F84A 7.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PI6F84A 7.0 INSTRUTION SET SUMMARY Each PI6XX instruction is a 4bit word, divided into an OPODE which specifies the instruction type and one or more operands which further specify the operation of the

More information

Application Note - PIC Source Code v1.1.doc

Application Note - PIC Source Code v1.1.doc Programmable, RGB-backlit LCD Keyswitches APPLICATION NOTE PIC SOURCE CODE 2004-2006 copyright [E³] Engstler Elektronik Entwicklung GmbH. All rights reserved. PIC Source Code The following Assembler source

More information

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh

Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Work Completed: Weekly Report: Interactive Wheel of Fortune Week 4 02/014/07-02/22/07 Written by: Yadverinder Singh Last week started with the goal to complete writing the overall program for the game.

More information

GUIDE TO USE OF PIC 16F690 EEProm. The 16F690 PIC has a 256 byte EEProm (mapped to 0x x21FF).

GUIDE TO USE OF PIC 16F690 EEProm. The 16F690 PIC has a 256 byte EEProm (mapped to 0x x21FF). GUIDE TO USE OF PIC 16F690 EEProm The 16F690 PIC has a 256 byte EEProm (mapped to 0x2100..0x21FF). PRESET DATA (WITH PROGRAM CODE) Data can be preset by use of the de operator: Org 0x21XX de de etc. 0x01,0x02

More information

TB082. Understanding Reset Events On The PIC10F20X INTRODUCTION WATCHDOG TIMER OR WDT POWER-ON RESET (POR)

TB082. Understanding Reset Events On The PIC10F20X INTRODUCTION WATCHDOG TIMER OR WDT POWER-ON RESET (POR) Understanding Reset Events On The PIC10F20X Author: INTRODUCTION The PIC10F20X family of microcontrollers utilizes the baseline 12-bit microcontroller core from Microchip. Because this core does not support

More information

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses ECE 354 Computer Systems Lab II Interrupts, Strings, and Busses Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system

More information

DERTS Design Requirements (1): Microcontroller Architecture & Programming

DERTS Design Requirements (1): Microcontroller Architecture & Programming Lecture (5) DERTS Design Requirements (1): Microcontroller Architecture & Programming Prof. Kasim M. Al-Aubidy Philadelphia University 1 Lecture Outline: Features of microcomputers and microcontrollers.

More information

Week1. EEE305 Microcontroller Key Points

Week1. EEE305 Microcontroller Key Points Week1 Harvard Architecture Fig. 3.2 Separate Program store and Data (File) stores with separate Data and Address buses. Program store Has a 14-bit Data bus and 13-bit Address bus. Thus up to 2 13 (8K)

More information

CONNECT TO THE PIC. A Simple Development Board

CONNECT TO THE PIC. A Simple Development Board CONNECT TO THE PIC A Simple Development Board Ok, so you have now got your programmer, and you have a PIC or two. It is all very well knowing how to program the PIC in theory, but the real learning comes

More information

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

EE6008-Microcontroller Based System Design Department Of EEE/ DCE UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE

More information

S w e d i s h c r. w e e b l y. c o m j a l i l a h m e l i v e. c o m Page 1

S w e d i s h c r. w e e b l y. c o m j a l i l a h m e l i v e. c o m Page 1 ********************************************************************** This file is a basic code template for assembly code generation * on the PICmicro PIC12C508. This file contains the basic code * building

More information

R&E International A Subsidiary of Microchip Technology Inc.

R&E International A Subsidiary of Microchip Technology Inc. RE46C112 General Description The RE46C112 is an ionization type smoke detector IC. It is intended for applications using ionization type chambers to detect smoke. When enabled, VOUT is ¼ of either the

More information

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER

SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER SOLAR TRACKING SYSTEM USING PIC16F84A STEPPER MOTOR AND 555TIMER Amey Arvind Madgaonkar 1, Sumit Dhere 2 & Rupesh Ratnakar Kadam 3 1. Block diagram International Journal of Latest Trends in Engineering

More information

Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code.

Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. Chapter 5. Problems All programming problems should include design pseudo code either as a separate design document on embedded comments in the code. 1S. Prior to execution of the following code segment,

More information

Using the C18 Compiler to Interface Microwire Serial EEPROMs to PIC18 Devices CIRCUIT FOR PIC18F1220 AND 93 SERIES (MICROWIRE) DEVICE PIC18F1220

Using the C18 Compiler to Interface Microwire Serial EEPROMs to PIC18 Devices CIRCUIT FOR PIC18F1220 AND 93 SERIES (MICROWIRE) DEVICE PIC18F1220 Using the C18 Compiler to Interface Microwire Serial EEPROMs to PIC18 Devices Author: INTRODUCTION Chris Parris Microchip Technology Inc. There are many different microcontrollers on the market today that

More information

16.317: Microprocessor Systems Design I Fall 2015

16.317: Microprocessor Systems Design I Fall 2015 16.317: Microprocessor Systems Design I Fall 2015 Exam 2 Solution 1. (16 points, 4 points per part) Multiple choice For each of the multiple choice questions below, clearly indicate your response by circling

More information

Section 31. Instruction Set

Section 31. Instruction Set 31 HIGHLIGHTS Section 31. Instruction Set Instruction Set This section of the manual contains the following major topics: 31.1 Introduction... 31-2 31.2 Data Memory Map... 31-3 31.3 Instruction Formats...

More information

Done 1 NVB THF TLF T/R POL 1SHOT. Figure 1: Status register

Done 1 NVB THF TLF T/R POL 1SHOT. Figure 1: Status register Introduction to Microprocessors Feisal Mohammed 12th January 2001 Mini-project This project is to implement a temperature monitor using the PicStic4, the DS1821 temperature sensor and a LCD display. The

More information

FIGURE 1 - TABLE READ

FIGURE 1 - TABLE READ Implementing Table Read and Table Write AN548 INTRODUCTION This application brief discusses how to read data from program memory to data memory and write data from data memory to program memory. RETLW

More information

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL NH-67, TRICHY MAIN ROAD, PULIYUR, C.F. 639 114, KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL Subject Name : Embedded System Class/Sem : BE (ECE) / VII Subject Code

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's

More information

Application Note. Interfacing the CS5525/6/9 to the 68HC05. By Keith Coffey MOSI (PD3) SDO MISO (PD2) SCLK. Figure 1. 3-Wire and 4-Wire Interfaces

Application Note. Interfacing the CS5525/6/9 to the 68HC05. By Keith Coffey MOSI (PD3) SDO MISO (PD2) SCLK. Figure 1. 3-Wire and 4-Wire Interfaces Application Note Interfacing the CS5525/6/9 to the 68HC05 By Keith Coffey INTRODUCTION This application note details the interface of Crystal Semiconductor s CS5525/6/9 Analog-to-Digital Converter (ADC)

More information

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics: M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using

More information

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features This document was created with FrameMaker 404 PIC16C52 EPROM-Based 8-Bit CMOS Microcontroller Feature Highlights Pin Diagrams Program Memory Data Memory I/O PDIP, SOIC 384 25 12 High-Performance RISC CPU

More information

HT93LC46 CMOS 1K 3-Wire Serial EEPROM

HT93LC46 CMOS 1K 3-Wire Serial EEPROM CMOS 1K 3-Wire Serial EEPROM Features Operating voltage: 1.8V~5.5V Low power consumption Operating: 5mA max. Standby: 2µA max. User selectable internal organization 1K: 128 8 or 64 16 3-wire Serial Interface

More information

FM4428 8KBits Memory Card Chip

FM4428 8KBits Memory Card Chip FM4428 8KBits Memory Card Chip May. 2008 FM4428 8K Bits Memory card chip ver 2.1 1 INFORMATION IN THIS DOCUMENT IS INTENDED AS A REFERENCE TO ASSIST OUR CUSTOMERS IN THE SELECTION OF SHANGHAI FUDAN MICROELECTRONICS

More information

AN1006. Interfacing SPI Serial EEPROMs to PIC18 Devices INTRODUCTION CIRCUIT FOR PIC18F1220 AND 25 SERIES (SPI) DEVICE

AN1006. Interfacing SPI Serial EEPROMs to PIC18 Devices INTRODUCTION CIRCUIT FOR PIC18F1220 AND 25 SERIES (SPI) DEVICE Interfacing SPI Serial EEPROMs to PIC18 Devices Author: INTRODUCTION Martin Kvasnicka Microchip Technology Inc. There are many different microcontrollers on the market today that are being used in embedded

More information

Input/Output Ports and Interfacing

Input/Output Ports and Interfacing Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning Basic I/O Concepts Peripherals such as LEDs and keypads are essential

More information

PIC12CE5XX. 8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory. Devices Included in this Data Sheet: Pin Diagram: High-Performance RISC CPU:

PIC12CE5XX. 8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory. Devices Included in this Data Sheet: Pin Diagram: High-Performance RISC CPU: Devices Included in this Data Sheet: PIC12CE518 PIC12CE519 High-Performance RISC CPU: Only 33 single word instructions to learn All instructions are single cycle (1 µs) except for program branches which

More information

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK 134 CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK 6.1 CONCLUSION Many industrial processes such as assembly lines have to operate at different speeds for different products. Process control may demand

More information

LPTCOM. Bruce Misner Lakehead University h d3 RD2 pin 21. RD3 pin h d4. RD4 pin 27 RD5 pin h d5. RD6 pin 29 RD7 pin H d6

LPTCOM. Bruce Misner Lakehead University h d3 RD2 pin 21. RD3 pin h d4. RD4 pin 27 RD5 pin h d5. RD6 pin 29 RD7 pin H d6 LPTCOM By Bruce Misner Lakehead University LPTCOM is a demonstration of a robust bi-directional communcation between the PIC microcontroller and the printer port of your PC. Incorporating more handshaking

More information

3-wire Serial EEPROMs AT93C46 AT93C56 AT93C57 AT93C66

3-wire Serial EEPROMs AT93C46 AT93C56 AT93C57 AT93C66 Features Low-voltage and Standard-voltage Operation 5.0 (V CC = 4.5V to 5.5V) 2.7 (V CC = 2.7V to 5.5V) 2.5 (V CC = 2.5V to 5.5V) 1.8 (V CC = 1.8V to 5.5V) User-selectable Internal Organization 1K: 128

More information

Product Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later

Product Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later Product Update Errata to Z8 Encore! 8K Series Silicon Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later The errata listed in Table 1 are found in the Z8 Encore! 8K Series devices with date codes

More information

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller

More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller 1 von 8 24.02.2010 21:53 More (up a level)... Connecting the Nokia 3510i LCD to a Microchip PIC16F84 microcontroller As with the FPGA board previously, the connections are made by soldering standard IDC

More information

MPLAB IDE, SIMULATOR, EDITOR USER S GUIDE

MPLAB IDE, SIMULATOR, EDITOR USER S GUIDE MPLAB IDE, SIMULATOR, EDITOR USER S GUIDE 2001 Microchip Technology Inc. DS51025E All rights reserved. Copyright 2001, Microchip Technology Incorporated, USA. Information contained in this publication

More information

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: HCMIU - DEE Subject: ERTS RISC MCU Architecture PIC16F877 Hardware 1 Outline Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware: Program Memory Data memory organization: banks,

More information

ECE 354 Computer Systems Lab II. Memory and Indirect Addressing

ECE 354 Computer Systems Lab II. Memory and Indirect Addressing ECE 354 Computer Systems Lab II Memory and Indirect Addressing Lab report for lab 1 Schematics Lab 2 Comments Label pins used on all chips Use standard chip names/numbers (DB25,SP-233) from the datasheet

More information

White Paper Using the MAX II altufm Megafunction I 2 C Interface

White Paper Using the MAX II altufm Megafunction I 2 C Interface White Paper Using the MAX II altufm Megafunction I 2 C Interface Introduction Inter-Integrated Circuit (I 2 C) is a bidirectional two-wire interface protocol, requiring only two bus lines; a serial data/address

More information

Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP

Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 3022: Embedded Systems Discussion Chapter 3 BRANCH, CALL, AND TIME DELAY LOOP Eng. Eman R. Habib February, 2014 2 Embedded

More information

FM24C02A 2-Wire Serial EEPROM

FM24C02A 2-Wire Serial EEPROM FM24C02A 2-Wire Serial EEPROM Apr. 2010 FM24C02A 2-wrie Serial EEPROM Ver 1.3 1 INFORMATION IN THIS DOCUMENT IS INTENDED AS A REFERENCE TO ASSIST OUR CUSTOMERS IN THE SELECTION OF SHANGHAI FUDAN MICROELECTRONICS

More information

Section 30. In-Circuit Serial Programming (ICSP )

Section 30. In-Circuit Serial Programming (ICSP ) Section 30. In-Circuit Serial Programming (ICSP ) HIGHLIGHTS This section of the manual contains the following major topics: 30. Introduction... 30-2 30.2 Entering In-Circuit Serial Programming Mode...

More information

Microchip AN528 产品用户参考手册 单片机集成方案全方位解决服务商 优质智能电子产品 芯 方案解决商 深圳市英锐恩科技有限公司 深圳市英锐恩科技有限公司 ENROO-TECH(SHENZHEN)CO.,LTD 中国 深圳市福田区福华路嘉汇新城汇商中心 27 楼 2701

Microchip AN528 产品用户参考手册 单片机集成方案全方位解决服务商 优质智能电子产品 芯 方案解决商 深圳市英锐恩科技有限公司 深圳市英锐恩科技有限公司 ENROO-TECH(SHENZHEN)CO.,LTD 中国 深圳市福田区福华路嘉汇新城汇商中心 27 楼 2701 深圳市英锐恩科技有限公司 单片机集成方案全方位解决服务商 优质智能电子产品 芯 方案解决商 Microchip AN528 产品用户参考手册 深圳市英锐恩科技有限公司 ENROO-TECH(SHENZHEN)CO.,LTD 中国 深圳市福田区福华路嘉汇新城汇商中心 27 楼 2701 Enroo-Tech Technologies CO., Limited Light-Tech International

More information

Performance & Applications

Performance & Applications EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 15th March 2002 CLR Part VI Performance & Applications It is possible to predict the execution time of code, on the basis

More information

Binary Outputs and Timing

Binary Outputs and Timing Binary Outputs and Timing Each of the I/O pins on a PIC can be inputs or ourputs As an input, the pin is high impedance (meaning it is passive and draws very little current). If you apply 0V to that pin,

More information