-->
Page 1 of 1

ESP8266 I2C PIC16F

PostPosted: Sun Oct 22, 2017 4:32 am
by Ceb
Hi,

I made an interface to connect PIC16F microchip to ESP8266.
It's work fine to write / read byte between ESP and PIC16F1509 but i have some interruptions with unknow source, if you are interrest by this project, plz share your entry to resolve this litle issue :
In my example application, reading 3 byte over i2c make 6 interrupts unknow on pic16F1509 side...
I would like to clean I2C slave protocol to maximize reliability in case of multi slave IC behind ESP master.

I use Sming framework for ESP8266 and MPLABX for pic16f1509.

Hope my example help

Re: ESP8266 I2C PIC16F

PostPosted: Sun Oct 22, 2017 4:47 am
by Ceb
When i read only 0xFF register (error protocol counter) on pic16f side, i have 2 interrupts more that i had handle fine in my interrupt subroutine.

ESP send one byte with [adress + W], one byte [offset register to read], Reset, one byte with [adress + R], then PIC16F reply with a byte [offset register value]. I only lost 2 interrupts that increment my error protocol counter :) The better is a zero value!

I didn't find much documentation about slave I2C so i based my implementation like the sensor BMP180 in sming framework.
I hope put together my pic16F and BMP180 on the same I2C bus...