[Home]PIC 16F819 IIC/Serial Demo With Debug Of SSPSTAT

HomePage | PIC 16F819 IIC | RecentChanges | Preferences

This page discusses a demo that uses the IIC module on the PIC16F819.

Connect an RS232 via a resistor to a PIC16F819, with SDA and SCL pulled up and you can explore IIC.

Connect other IIC 7 bit devices and send and receive bytes from them.

It is possible to get the chip to talk to itself.

http://www.dougrice.plus.com/dev/iic001/iicrs001.ASM

; Uses PIC16F819
;
; Pull up SDA and SCL pins with 4k7 resistors,
;
; SERIAL PORT CONTROL:
;
;	PORT A0 is Serial input
;	PORT A0 is serial output
;
;	usb gmus-03 USB Serial Adapter
;
;	TX  D9 Pin 3 -[4k7]----+-----PA0
;	RX  D9 Pin 2 ----------/
;
;	GND D9 Pin 5 ---------------- 0V
;
 
;
; Serial Commands:-
;
;   ; w,p,r,g,f,a
;
;
; File Regiters
;	<CR>wAADD;		write DD to register AA
;	<CR>rAA;  		read AA and output to serial port
;
; EEPROM
;	<CR>pAADD;		write DD to EEPROM register AA
;	<CR>gAA;  		read EEPROM register AA and output to serial port
;
; PRIPHERALS
;
; IIC master commands to set to slave and master. 
;    Master is done by code. EEPROM
;
;	<CR>iAA;	IIC  init set Addr = AA
;
;	<CR><AA;	IIC START , ADDR , set lsb for R/W
;	<CR>>;		IIC STOP
;	<CR>/DD;	IIC master writeByte
;	<CR>?;	IIC master readByte & ACK.   If you get ~, SCL is being held low and read has timed out.
;	<CR>~;	IIC master readByte & NACK.  If you get ~, SCL is being held low and read has timed out.
;


HomePage | PIC 16F819 IIC | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited March 7, 2014 6:35 am by dougrice.plus.com
Search:
dougFooter