TAILIEUCHUNG - Interfacing PIC Microcontrollers 24

Interfacing PIC Microcontrollers 24. Explore in detail microcontroller interfacing techniques using the popular PIC 16F877 Work through step-by-step examples interactively using circuit simulation software, supplied as assembly source code Gain the knowledge of a wide range of peripheral devices such as keyboards, displays, sensors and drives and serial communication with other processors, memory and more Use interactive simulation software to design and test circuits. | Interfacing PIC Microcontrollers MPB 7-1-06 Test program for 24AA128 I2C 16k byte serial memory with P16F877A 4MHz XT Demonstrates single byte write and read with 10-bit address. Write data from High address Low address Read data back to 0x2 0 0x21 0x22 0x2 3 Version Final PROCESSOR 16F877A CONFIG 3FF1 INCLUDE P16F877A Data address control SenReg EQU 0x20 HiReg EQU 0x21 LoReg EQU 0x22 RecReg EQU 0x23 ConReg EQU 0x24 Temp EQU 0x2 5 ORG 0 CLRF SenReg CLRF HiReg CLRF LoReg GOTO begin . INC registers Send High Low address store Receive data store Control byte store Scratchpad location data store address store Program Zeroise Zeroise Zeroise jump to start address data high address low address main program for send recive done . Wait for interrupt flag SSPIF wint NOP BANKSEL has address BANKSEL PIR1 Select bank BCF PIR1 SSPIF reset interrupt flag win NOP BTFSS PIR1 SSPIF wait for. GOTO win .transmit done RETURN Done send NOP Select. BANKSEL SSPBUF . bank MOVWF SSPBUF Send address data CALL wint Wait until sent RETURN Done Program I2C memory test 216 Serial Communication Routines to send start control address data stop sencon NOP BANKSEL PIR1 GENERATE START BIT BCF PIR1 SSPIF Clear interrupt flag BANKSEL SSPCON2 select register page BSF SSPCON2 ACKSTAT Set acknowledge flag BSF SSPCON2 SEN Generate start bit CALL wint wait till done MOVF ConReg W SEND CONTROL BYTE CALL send Memory ID address RETURN done senadd NOP BANKSEL SSPCON SEND ADDRESS BYTES MOVF HiReg W load address high byte CALL send and send MOVF LoReg W load address low byte CALL RETURN send and send sendat MOVF SenReg W SEND DATA BYTE CALL send and send RETURN done senstop NOP BANKSEL SSPCON2 GENERATE STOP BIT BSF SSPCON2 PEN Generate stop bit CALL wint wait till done RETURN done senack NOP BANKSEL SSPCON2 ACKNOWLEDGE BSF SSPCON2 ACKDT Set ack. bit high BSF SSPCON2 ACKEN Initiate CALL wint Wait for ack. done RETURN done wait NOP BANKSEL TMR0 WAIT FOR WRITE DONE MOVLW d 156 Set .

TỪ KHÓA LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.