The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


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

 

 

Communication between ST52x420 EEPROM Authors: Marino, Vinci


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



AN1222 APPLICATION NOTE
Communication between ST52x420 EEPROM
Authors: Marino, Vinci
Introduction
This application note shows example ST52x420 communicate with EEPROM memory with protocol. this example, M24C04 EEPROM bit) taken into account, following considerations applied applications with kind M24CXX memory. software routines proposed, Byte Write Random Address Read, ST52x420 microcontroller configured single master communication.
Communicating Protocol
M24CXX EEPROM supporting protocol. M24CXX communicate with microcontroller, master, only serial data line (SDA) serial clock (SCL). During each data transfer, M24CXX samples signal rising edge clock signal SCL. signal must stable during clock high transition data must change only when line low. Changes data line while clock high interpreted START STOP conditions. START identified high transition line while clock stable high state. START condition must precede data transfer command. After START, ST52x420 sends onto line bits (MSB first): first bits select device, last bit) indicate read high) write low) operation. After sending each bits data stream, master releases bus; during clock pulse period receiver pulls acknowledge receipt data. complete data transfer always terminated STOP, identified high transition line while clock stable high state. Figure Protocol
February 2000
1/22
AN1222 APPLICAT NOTE
Hardware Description
connection scheme between ST52x420 EEPROM shown Figure ST52x420 used transfer data from memory (SDA); data synchronization (SCL). this scheme M24C04 inputs tied (Device Select Code A0h), therefore, being low, only byte memory, part, addressed. address also memory high part (address 1xxxxxxxx), must dynamically driven using another ST52x420. maximum four memories type M24C04 addressed microcontroller same wire buses, setting inputs (00, 11): each device identified Device Select Code will only respond correct selection. used protect contents memory from inadvertent erase/write operations, unconnected, therefore with this scheme, write operations always allowed. allow enabling =VIL) disabling =VIH) write operations, must driven dynamically. Figure ST52x420/EEPROM Schematics
ST52X420
M240C04
Byte Write Mode
WRITE mode, after START condition, ST52x420 sends Device Select Code with `0', shown Figure memory acknowledges reception waits address byte from master, which responds with acknowledge. After acknowledge, ST52x420 sends data byte written defined memory location. ST52x420 terminates transfer generating STOP condition. Figure Byte Write Mode Sequence
START
2/22
STOP
AN1222 APPLICATION NOTE
Random Address Read Mode
order read byte from address memory, ST52x420 performs dummy write load address, shown Figure Then, without sending STOP condition, ST52x420 sends another START condition sends Device Select Code again, with `1'. After acknowledgment, memory provides onto contents addressed byte. master required acknowledge byte output terminates transfer with STOP condition.
Figure Read Mode Sequence
START
START
Software (I2C communication routines between ST52x420 M24C04 EEPROM)
software project ST52x420 communicating with EEPROM M24C04 described followings. routines developed assembler language show perform operations writing reading page memory (256 bytes). Please refer Appendix writing operation Appendix reading operation assembler code. Write Software Routine Chip configuration EPROM data store first part assembler code, Appendix after interrupt request vector definition, "data page addr value" instructions performed. These instructions indicate store data value ST52x420 EPROM, address specified page, order write these data into EEPROM. configuration registers used this program are: REG_CONF0 enable TIMER1 interrupt REG_CONF1 establish interrupt priority REG_CONF8 REG_CONF9 configure TIMER1 REG_CONF13 REG_CONF14 configure PORTB Timer1 peripheral been configured order have timer clock T=0.4µs setting prescaler value supposing that master clock frequency equal Mhz. choice load counting from timer_count register, where user write values ranging from this example), allows communication speed within range [250KHz (fast mode), 9.8KHz (standard mode)]. Main program After initialization used register, START condition performed calling subroutine `start_bit'. Then three byte serially sent (calling `send_data') onto bus, respectively Device Select Code, Address byte Data byte written into memory address location: after each byte sent, ST52X420 waits M24C04 acknowledgment; each receipt (reg30 after `read_ack' subroutine) variable `cont_ack (reg40), initially zero, incremented unit. When `cont_ack' reaches STOP condition (calling `stop_bit' subroutine) sent ST52X420 memory. signal returned from memory (reg30 equal zero) program provides restart communication protocol, jumping label `init'. order write bytes into memory, reg10 (address counter) incremented unit after each `byte write' operation only when whole bytes have moved EEPROM program terminates with `halt' instruction, that stops clock master that peripherals turned-off.
3/22
STOP
AN1222 APPLICAT NOTE
`Start_bit' subroutine This subroutine performs START condition: first, line pulled high state through sending reg21=2=00000010b into port then line pulled high setting high sending reg21=3=00000011b finally low, then also SCL, complete START communication, required from protocol (Figure Time delays among transitions between each block `start_bit' routine managed thanks timer1 peripheral. fact each transition port performed after `waiti' instruction, that allows synchronize signal into port with interrupt generated falling edge Timer1 signal. `Send_data' subroutine This routine been planned sending serially bits byte. first part routine, decide whether Divice Select Code byte (160 this case), address byte data byte must sent, variable `cont_ack' used. byte sent data byte, operation reading from EPROM ST52X420 performed, through instruction `ldre (19) (10)', that loads register pointed reg19 (that reg20) content address memory pointed reg10 (that 256*page+reg10). send each byte, stored reg50, bit, cycle scanned reg23 (decremented from performed. each step cycle, data sent onto (`ldpr 21') clock pulse line performed. determine send `1', simple operation shift reg50 (`asl 50') done. `Read_ack' subroutine routine `read_ack' called main program after routine `send_data' check data sent correctly received EEPROM; variable `ack' (reg30) `zero' procedure continue, otherwise, reg30 `two', error occurred communication restarted. `Stop_bit' subroutine data transfer always terminated STOP condition, that identified high transition line while clock stable high state. This condition performed calling `stop_bit' subroutine. Read Software Routine Main program After initialization used register, START condition performed calling subroutine `start_bit'. Three bytes then sent serially onto (see also `send_data' subroutine). cycle variable `cont_ack' (reg40) used discriminate which byte going sent: Device Select Code (160) reg40 `0', address byte (reg10) `1', Device Select Code again with (i.e. byte corresponding 161), after START condition, reg40 `2'. reg40 `3', data read (with `read_data' subroutine) STOP condition executed. Note that, signal returned from memory (reg30 equal zero) program provides restart communication protocol, jumping label `init'. order read from memory bytes reg10 (address counter) incremented unit after each read operation only when whole bytes have read from EEPROM program terminates with `halt' instruction, that stops clock master that peripherals turned-off.
4/22
AN1222 APPLICATION NOTE
`Read_data' subroutine This subroutine designated read data from memory; data composed eight bits, then, order read cycle scanned counter initially (reg23) realized. convert serial data parallel format, necessary associate every relative weight, (reg23-1) that given calculate weight, cycle `power_of_two' performed. this cycle, register will contain read value among 128, `1'; adding reg20 reg31 every cycle, value read data finally contained reg20. `Send_ack' subroutine accordance with communicating protocol, data byte receipt, ST52X420 puts (SCL line) high, before sending stop condition.
5/22
AN1222 APPLICAT NOTE
Appendix
;*************** ********** ********** *********** ********** **** PURPOSE: communication DATE: 12/1/2000 ;*************** ********** ********** *********** ********** *********** ****** This program writes from address address bytes contained page EPROM ST52X420 ;*************** ********** *****Interrupt vector********************* ***** TIM1 ;*************** ********** ********** *********** ********** *********** ******* ;data store EPROM data data data data data data data data data data data data data ;*************** ********** ********** *********** ********** *********** ******** ;*************** ***Peripherals Chip configurations *************** **** ldrc 00001000b interrupt mask configuration ldcr masked, TM0, TM2, ADC, masked ldrc 00011110b interrupt priority configuration ldcr from lowest: ADC, TM0, TM2, ldrc ldcr ldrc 01000000b 00100010b PWM-Timer configuration Timer mode, int. TM1Out falling edge PWM-Timer configuration
6/22
AN1222 APPLICATION NOTE
ldcr ldrc ldcr ldrc ldcr ldrc ldpr 00000010b 00000000b TM1Out square wave, PRESC1=4 Port direction configuration input, whole other pins output ;Port mode configuration PB7-PB0 digital reg0=80 TIMER_COUNT1=80
;*************** ********** ;*************** ********** ******main program***************** ********** ;*************** ********** ******** ;TM1 manages communication speed ;PB0SCL PB1SDA ;reg10=address ;reg20=data ;reg30=ack ;reg40=cont_ack ;reg50=byte_to_send ;*************** ********** ********** *********** ********** *********** ***** Start: ldrc ;address=0 ldrc ;reg19=20 (this instruction maids indirect ;addressing reg20 through reg19) ldrc ;register support send data into Port ldrc register used bit1 Port init: ldrc call start_bit send: call send_data call read_ack jpnz init ldrc jpnz send send byte into read (result stored reg30) ack=0 procedure goes else restarts increments cont_ack after three acknowledge data transfer terminated STOP condition performed call stop_bit STOP condition routine increments address before this operation reg10<255 flag
7/22
init cont_ack START condition routine
AN1222 APPLICAT NOTE
cleared then write operation performed. Else, reg10=255, this operation causes overflow (flag setted) program jpnc init finishes. halt clock master stopped ;*************** ********** *****end main program******************** *******
;*************** ********** ********** ;this routine performs start communicating protocol start_bit: ldrc ldcr ldrc ldcr waiti 00000000b 01000101b Port direction configuration PB6-PB0 output PWM-Timer configuration Timer start waits Timer1 interrupt
;*************** ********** *******SDAhigh************ *********** ********** reg21=2 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** *********** ********** waiti waits Timer1 interrupt
;*************** ********** ********** SCLhigh**************** *********** **** reg21=3 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** *********** ********** waiti waits Timer1 interrupt ;*************** ********** ********** ***SDAlow****************** ********** reg21=1 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** *********** ********** waiti waits Timer1 interrupt
;*************** ********** **SCLlow****************** ********** *********** **** reg21=0 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** *********** *********
8/22
AN1222 APPLICATION NOTE
waiti ldrc ldcr ldrc ldcr 01000000b 00000010b
waits Timer1 interrupt PWM-Timer configuration Timer reset Port direction configuration input, whole other pins output return from subroutine
;*************** *********** ********** ********** *********** ********** ********* ;*************** *********** send_data: ldrc ldcr 00000000b Port direction configuration PB6-PB0 output
;*************** *********** ********** byte_to_send******************* **** ldrc jpnz ldrc ldrc jpnz ldrr pgset end0 cont_ack==0 then
byte_to_send=160 (Device Select Code)
else cont_ack==1 then
byte_to_send=address
else sets current EPROM page this instruction loads into location, whose address contained reg19 (that into reg20) contents EPROM location address (256*pag_number+reg10) byte_to_send=data
ldre (19) (10)
ldrr end0:
9/22
AN1222 APPLICAT NOTE
;******** *********** ********** *********** ********** ********** ********* ;******** *********** ********** *********** ********** ********** ********** ldrc bit: ;******** *********** ********** **bitto send******************** ldrc bit=0 shift left byte_to_send jpnc high bit=1 (PB1=1) ldpr send data into Port ;******** *********** ********** *********** ********** ********** ***** ;******** *********** *****SCLpulse************* ********** ****** ldrc 01000101b PWM-Timer configuration ldcr Timer start waiti ldpr waiti ldpr waiti waits Timer1 interrupt init counter
high waits Timer1 interrupt
waits Timer1 interrupt
ldrc 01000000b PWM-Timer configuration ldcr Timer reset ;******** *********** ********** *********** ********** ********** ******* ldrc jpnz resets reg21 decrements counter jumps label `bit' data transfer incomplete, goes after bits sent
;******** *********** ********** *********** ********* ldrc ldcr 00000010b Port direction configuration input, whole other pins output
10/22
AN1222 APPLICATION NOTE
return from subroutine
;*************** ********** ********** *********** **********
;***********read_ack routine*********** *********** ******* read_ack: ldrc ldcr waiti 01000101b PWM-Timer configuration Timer start waits Timer1 interrupt
;*************** ********** ********** *********** *****SCL high ****************** ********** *********** ********** **** reg21=1 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** ********** *********** ********** *********** ********** ******* waiti ldri waits Timer1 interrupt read port (XXXXXXBX)b (00000010)b=(000000B
;*************** ********** ********** *********** *****SCL **************** *********** ********** *********** ******** reg21=0 ldpr send reg21 into Port ;*************** ********** ********** *********** ********** ********** *********** ********** waiti ldrc ldcr ldrc 01000000b waits Timer1 interrupt PWM-Timer configuration Timer reset resets reg21
return from subroutine ;*************** ********** ********** *********** ********** ********** *********** ********** *********** ********** ****** ;*************** ********** ********** ****stop_bit routine************ *********** ********** *********** ********** **** stop_bit: ldrc ldcr ldrc ldcr 00000000b 01000101b Port direction configuration PB6-PB0 output PWM-Timer configuration Timer start
11/22
AN1222 APPLICAT NOTE
waiti waits Timer1 interrupt *********** low************ ********** ********** *********** ********** *********** ********** **** ldrc reg21=0 ldpr send reg21 into Port ;*********** *********** ********** ********** *********** ********** ********** *********** ********** waiti waits Timer1 interrupt
*********** high************* ********** *********** ********** ********** *********** ********** reg21=1 ldpr send reg21 into Port *********** *********** ********** ********** *********** ********** *********** ********** ********** waiti waits Timer1 interrupt ;*********** high*************** ********** ***** *********** ********** ********** *********** ****** reg21=3 ldpr send reg21 into Port ;*********** *********** ********** ********** *********************** ********** *********** ********* waiti waits Timer1 interrupt ;*********** low*************** *********** **** ********** ********** ********** *********** ******* reg21=2 ldpr send reg21 into Port ;*********** *********** ********** ********** *********************** ********** *********** ********* waiti ldrc ldcr ldrc 01000000b waits Timer1 interrupt PWM-Timer configuration Timer reset resets reg21
ldrc 00000010b Port direction configuration ldcr input, whole other pins output ;*********** *********** ********** ********** ***INTsSubroutines************* ********** *********** ********** ******** TIM1: reti return from interrupt ;*********** *********** ********** ********** *********** ********** ********** *********** ********** *********** **********
12/22
AN1222 APPLICATION NOTE
Appendix
;*********** *********** ********** *********** ********** ********** *********** PURPOSE: communication DATE: 12/1/2000 ;*********** *********** ********** *********** ********** ********** *********** ;this program reads from byte from address address ;*********** *********** ******interrupt vectors ************* ********** **** TIM1 ;*********** *********** ********** *********** ********** ********** *********** ;******** Peripherals Chip configurations ****************** ********* ldrc ldcr ldrc ldcr ldrc ldcr ldrc ldcr 00001000b 00011110b 00000000b 01000000b interrupt mask configuration masked, TM2, TM0, ADC, masked interrupt priority configuration from lowest: ADC,TM0,TM2,TM1 Port configuration PA7-PA0 output PWM-Timer configuration Timer mode, int. TM1Out falling edge
ldrc ldcr ldrc ldcr ldrc ldcr ldrc ldcr ldrc ldpr
00100010b 00001000b 00000010b 00000000b
PWM-Timer configuration TM1Out square wave, PRESC1=4 Port mode configuration Port bits, pin22-PA3, pin23-PA2, pin24-PA1 Port direction configuration input, whole other pins output Port mode configuration PB7-PB0 digital reg0=80 TIMER_COUNT1=80
;*********** *********** ********** *********** ********** ********** *********** ********** *********** ********** **********
13/22
AN1222 APPLICAT NOTE
;************ **** *************** ********** *********** ********** ;************ ********** *********** ********** *Variables definition*********** ********** *********** ********** ****** ;TM1 manages communication speed ;PB0SCL PB1SDA ;reg10=address ;reg20=data ;reg30=ack ;reg40=cont_ack ;reg50=byte_to_send ;************ ********** *********** ********** ********** *********** ********** ********** *********** ********** *********** start: ldrc ldrc ldrc address=0 register support send data into Port register used bit1 Port
init: ldrc start: call start_bit send: call send_data call read_ack jpnz init send byte into read (result stored reg30) ack=0 procedure goes else restarts START condition routine init cont_ack
ldrc send ldrc start call read_data call send_ack call stop_bit
increments cont_ack cont_ack=1 then jumps label `send' order send another byte into
cont_ack=2 then jumps label `start'in order perform another START condition
read procedure send acknowledgment STOP condition routine
14/22
AN1222 APPLICATION NOTE
ldpr send read data into port increments address before this operation reg10<255 flag cleared then read operation performed. Else, reg10=255, this operation causes overflow (flag set) program finishes. clock master stopped
jpnc halt
init
;****************** ********** ********** **end main ********** **********
;****************** ********** ********** ***start_bitroutine*********** *********** ********** ********** *********** ;this routine performs start communicating protocol start_bit: ldrc ldcr ldrc ldcr waiti 00000000b 01000101b Port direction configuration PB6-PB0 output PWM-Timer configuration Timer start waits Timer1 interrupt
;****************** ********** ********** *********** ********** ********** ********* reg21=2 ldpr send reg21 into Port ;****************** ********** ********** *********** ********** *********** ********** ********** *********** ********** ***** waiti waits Timer1 interrupt
;***********SCL high****************** *************************** ********** *********** ********** ********** ******* reg21=3 ldpr send reg21 into Port ;****************** ********** ********** *********** ********** *********** ********** ********** *********** ********** ***** waiti waits Timer1 interrupt
;***********SDA low***************** *********** ********** ********** *********** ********** ********** *********** **** reg21=1 ldpr send reg21 into Port
15/22
AN1222 APPLICAT NOTE
;**************** ********** *********** ********** ********** *********** ********** *********** ********** ********** *******
waiti
waits Timer1 interrupt
;**************** ********** *********** ********** ****** **************** *********** ********** ********** ***** reg21=0 ldpr send reg21 into Port ;**************** ********** *********** ********** ********** *********** ********** *********** ********** ********** ******* waiti ldrc ldcr ldrc ldcr 01000000b 00000010b waits Timer1 interrupt PWM-Timer configuration Timer reset Port direction configuration input, whole other pins output return from subroutine
;**************** ********** *********** ********** ********** *********** ********** *********** ********** ********** *******
;**************** ********** *********** ********** ******send_data routine******************** *********** ********** send_data: ldrc ldcr 00000000b Port direction configuration PB6-PB0 output
;**************** ********** *********** ********** ****** byte_to_send ***************** ********** *********** ***** ldrc jpnz ldrc end0 ldrc jpnz ldrr cont_ack==0 then
byte_to_send=160 (Device Select Code, RW=0) else cont_ack==1 then
byte_to_send=address
16/22
AN1222 APPLICATION NOTE
end0 else byte_to_send=161 (Device Select Code, RW=1)
ldrc end0: ;*************** *********** ********** ********** *********** ********** *********** ********** ********** *********** ******* ;*************** *********** ********** ********** *********** ********** *********** ********** ********** *********** ******* ldrc init counter bit: ;*************** *********** ********** ********** *********** ********** *********** ********** ********** *********** ******* ldrc bit=0 shift left byte_to_send jpnc high bit=1 (PB1=1) ldpr ;send data into PORT ;*************** *********** ********** ********** *********** ********** *********** ********** ********** *********** *******
;*************** *********** ********** ********** ******* pulse **************** *********** ********** *********** ldrc 01000101b PWM-Timer configuration ldcr Timer start waiti ldpr waiti ldpr waiti waits Timer1 interrupt
high waits Timer1 interrupt
waits Timer1 interrupt
ldrc 01000000b PWM-Timer configuration ldcr Timer reset ;*************** *********** ********** ********** *********** ********** *********** ********** ********** *********** ******* ldrc resets reg21 decrements counter
17/22
AN1222 APPLICAT NOTE
jumps label `bit' data transfer incomplete, goes after bits sent ;********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** ldrc ldcr 00000010b Port direction configuration input, whole other pins output
jpnz
return from subroutine ;********** *********** ********** *********** ********** ********** *********** ********** *********** ********** **********
;********** *********** ********** *********** ********** *********** ********** read_ack: ldrc ldcr waiti 01000101b PWM-Timer configuration Timer start waits Timer1 interrupt
;********** *********** ********** *********** ********** *SCL high ************ ********** *********** ********** ********** reg21=1 ldpr send reg21 into Port ;********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** waiti waits Timer1 interrupt
ldri read port (XXXXXXBX)b (00000010)b=(000000B0)b ;********** *********** ********** *********** ********** *SCL ****************** *********** ********** *********** reg21=0 ldpr send reg21 into Port ;********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** Waiti waits Timer1 interrupt
ldrc 01000000b PWM-Timer configuration ldcr Timer reset ldrc resets reg21 return from subroutine ;********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** ;********** *********** ********** *********** ********** ********** *********** read_data:
18/22
AN1222 APPLICATION NOTE
ldrc ldrc
reg20=0 (reg20 will contain read data) init counter data read
;*********** *********** ********** *********** ********** ********** *********** ********** ********** *********** ********** read_bit: ldrc 01000101b PWM-Timer configuration ldcr Timer start waiti ldpr waiti waits Timer1 interrupt reg21=1 high waits Timer1 interrupt
ldri read port (XXXXXXBX)b (00000010)b=(000000B0)b reg31=(0000000B)b ldrr reg32=counter ;*********** *********** ********** *********** ********** ********** *********** ********** ********** *********** ********** ;*********** *********** ********** *********** ********** ********** *********** ********** ********** *********** ********** power_of_two: power_of_two end1: reg20=b7*2^7 b6*2^6 b0*2^0 ;*********** *********** ********** *********** ********** ********** *********** ********** ********** *********** ********** ldpr waiti ldrc ldcr 01000000b reg21=0 waits Timer1 interrupt PWM-Timer configuration Timer reset decrement counter jump label `read_bit' data transfer incomplete, goes after bits read resets reg21 this loop shifts left reg31 many times much determines weight read (2^(reg32-1))
jpnz read_bit ldrc
19/22
AN1222 APPLICAT NOTE
return from subroutine
;*************** ********** *********** ********** ********** *********** ********** *********** ********** ********** ********
;*************** ********** *********** ********** *********** ********** ***** end_ack: ldrc ldcr ldrc ldcr 00000000b 01000101b Port direction configuration PB6-PB0 output PWM-Timer configuration Timer start
waiti
waits Timer1 interrupt
;*************** ********** *********** ********** ********SDA high************** *********** ********** ********** ******* reg21=2 ldpr send reg21 into Port ;*************** ********** *********** ********** ********** *********** ********** *********** ********** ********** ******** waiti waits Timer1 interrupt ;*************** ********** *********** ********** *******SCL high *************** ********** ********** *********** ******* reg21=3 ldpr send reg21 into Port ;*************** ********** *********** ********** ********** *********** ********** *********** ********** ********** ******** waiti waits Timer1 interrupt
;*************** ********** *********** ********** *******SCL ************* ********** *********** ********** ********** reg21=2 ldpr send reg21 into Port ;*************** ********** *********** ********** ********** *********** ********** *********** ********** ********** ******** waiti ldrc ldcr ldrc ldrc 01000000b 00000010b waits Timer1 interrupt PWM-Timer configuration Timer reset resets reg21 Port direction configuration
20/22
AN1222 APPLICATION NOTE
ldcr
input, whole other pins output return from subroutine
;*********** *********** ********** *********** ********** ********** ***********
;*********** *********** *********** ******** stop_bit: ldrc ldcr 00000000b Port direction configuration PB6-PB0 output
ldrc ldcr waiti
01000101b
PWM-Timer configuration Timer start waits Timer1 interrupt
;*********** *********** ********** *********** ********** *SDA ************** *********** ********** *********** ****** ldrc reg21=0 ldpr send reg21 into Port ;*********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** waiti waits Timer1 interrupt
;*********** *********** ********** *********** ********** high *************** ********** *********** ********** ****** reg21=1 ldpr send reg21 into Port ;*********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** waiti waits Timer1 interrupt
;*********** *********** ********** *********** ********** high ************* ********** *********** ********** ******** reg21=3 ldpr send reg21 into Port ;*********** *********** ********** *********** ********** ********** *********** ********** *********** ********** ********** waiti waits Timer1 interrupt
;*********** *********** ********** *********** **********SCL ************ ********** *********** ********** ********* reg21=2 ldpr send reg21 into Port
21/22
AN1222 APPLICAT NOTE
;******** ********** ********** *********** ********** *********** ********** ********** *********** ********** ********** ****** waiti waits Timer1 interrupt
ldrc ldcr ldrc ldrc ldcr
01000000b 00000010b
PWM-Timer configuration Timer reset resets reg21 Port direction configuration input, whole other pins output
return from subroutine
;******** ********** ********** *********** ********** *********** ********** ********** *********** ********** ********** ******
;******** ********** ********** *********** *****INTs Subroutines ************* ********** *********** ********** ******** TIM1: reti return from interrupt ;******** ********** ********** *********** ********** *********** ********** ********** *********** ********** ********** ******
Information furnished believed accurate reliable. However, STMicroelectronics assumes responsibility consequences such information infringement patents other rights third parties which result from use. license granted implication otherwise under patent patent rights STMicroelectronics. Specification mentioned this publication subject change without notice. This publication supersedes replaces information previously supplied. STMicroelectronics products authorized critical components life support devices systems without express written approval STMicroelectronics. logo trademark STMicroelectronics 2000 STMicroelectronics Printed Italy Rights Reserved FUZZYSTUDIOis registered trademark STMicroelectronics STMicroelectronics GROUP COMPANIES http://www.st.com Australia Brazil China Finland France Germany Hong Kong India Italy Japan Malaysia Malta Morocco Singapore Spain Sweden Switzerland United Kingdom U.S.A.
22/22

Other recent searches


EFA480C-CP083 - EFA480C-CP083   EFA480C-CP083 Datasheet
DIP016-G-0300-3 - DIP016-G-0300-3   DIP016-G-0300-3 Datasheet
AT5231 - AT5231   AT5231 Datasheet
AT5231T - AT5231T   AT5231T Datasheet
APHK1608MBC - APHK1608MBC   APHK1608MBC Datasheet
AD8C211-L - AD8C211-L   AD8C211-L Datasheet
1D1304-10 - 1D1304-10   1D1304-10 Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive