I am currently working with the STM8S Discovery using the on board STM8S003K3. At the moment I am attempting to establish the I2C communication using the MCU in master mode.
However, I am having an issue whilst setting up the communication channel. I have chosen to poll at each stage waiting for the corresponding flags to be set but after writing the address to the Data Register (and measuring the correct output via oscilloscope) I am stuck polling the ADDR bit in the SR1 register.
As it stands the MCU is not actually communicating with anything directly (possible acknowledgement error?) but I am presuming that the ADDR bit will be set by hardware regardless, if not, is this bit set on the receipt of an ACK?
Any suggestions would be greatly appreciated!
**P.S:- I am not using the STD Peripheral libraries.
However, I am having an issue whilst setting up the communication channel. I have chosen to poll at each stage waiting for the corresponding flags to be set but after writing the address to the Data Register (and measuring the correct output via oscilloscope) I am stuck polling the ADDR bit in the SR1 register.
As it stands the MCU is not actually communicating with anything directly (possible acknowledgement error?) but I am presuming that the ADDR bit will be set by hardware regardless, if not, is this bit set on the receipt of an ACK?
Any suggestions would be greatly appreciated!
**P.S:- I am not using the STD Peripheral libraries.