Skip to main content
debruyne.marc
Associate III
Jan 30, 2013 10:34 AM UTC
Question

STM8S I2c

Posted on January 30, 2013 at 11:34

hello,

i try to make a connection between the stm8s207 and an pcf8574.

the problem is with the software, because i can control the pcf8574 with an AARDVARK analyzer.

when i send a start and an adress (40) for pcf8574 then i do not see any pilses on PE1 and PE2

i use a crystal of 14.7456Mhz because of the UART.

please take a look at the attached assembly file.

and ,let me know what i doing wrong.

many thanks

marc debruyne
    This topic has been closed for replies.

    4 replies

    Stm32User
    Associate III
    Feb 8, 2013 12:52 PM UTC
    Posted on February 08, 2013 at 13:52

    Is there any particular reason why you are writing in assembler ?

    Why not write in C ?  You can then use the ST firmware library which has I2C drivers already written and debugged.

    klaasdc
    Associate III
    Feb 8, 2013 2:45 PM UTC
    Andrew Neil
    Super User
    Feb 10, 2013 3:11 PM UTC
    Posted on February 10, 2013 at 16:11

    ''these pins have no internal pull up function. Maybe you have the same problem?''

    That could explain why it works with the Aardvark - perhaps the Aardvark provides pullups...?
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    debruyne.marc
    Associate III
    Feb 11, 2013 10:18 AM UTC
    Posted on February 11, 2013 at 11:18

    hello sir,

    no the aardvark use the 7 bit  and must be set to 20 while the normal addres for a 8574 is 40

    the aardvark people told me that;

    and its working