Misterbenn
Active Member
Hi i'm using the 16F88 (with its I2C) serial comunication module to comunicate with a smBus slave. the two are ment to be able to comunicate in this way.
I'm having some problems with the code and wondered if anyone can help.
Firstly the 16F88 is in Master mode, so will be providing the start and stop conditions. As far as i can see i have to create these in programing. would this assumption be corect? and i think i do this via manipulation of the TRISB register.
Also after i've sent the start bit how do i go about sending the 7 bit address, does this automaticaly send when i load data into the SSPBUF register....or do i need to trigger a transmit flag?
and finaly how do i detect the acknolage bit, is this also down to my programing, or will the PIC automaticaly create a flag?
Thanks for any help you can give me.
P.S i know its not the best programing language for this kind of thing but i only really know assembeler, my knowlage of C and C++ is limited .... if you could keep this in mind when offering suggestions. Thanks
I'm having some problems with the code and wondered if anyone can help.
Firstly the 16F88 is in Master mode, so will be providing the start and stop conditions. As far as i can see i have to create these in programing. would this assumption be corect? and i think i do this via manipulation of the TRISB register.
Also after i've sent the start bit how do i go about sending the 7 bit address, does this automaticaly send when i load data into the SSPBUF register....or do i need to trigger a transmit flag?
and finaly how do i detect the acknolage bit, is this also down to my programing, or will the PIC automaticaly create a flag?
Thanks for any help you can give me.
P.S i know its not the best programing language for this kind of thing but i only really know assembeler, my knowlage of C and C++ is limited .... if you could keep this in mind when offering suggestions. Thanks