Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: progamming PCF8574 Kategorie: Programmierung Basic (von rien an harmelen - 23.11.2004 9:25)
 Als Antwort auf Re: progamming PCF8574 von Achim - 22.11.2004 15:27

> > Please, who can help me to program a  PCF8574. What is wrong in the program given below.
>
> What makes you think, there is something wrong? In other words: please describe what you do, what you observe then and what you'd expect instead.
>
> > I like to turn a stepper connnected to P4-P7 (of the PCF8574) when a switch) connected to P3 is depressed. P0/P3 are connected with a pull-up to 5V . By pressing the switch P3 will be connected with a pull-up to 5 V
>
> Shouldn't the switch connect P3 rather with 0V?
>
> > please refer to [1]
> > please refer to [1]
> > please refer to [1]
>
> > [1] Messen, Steueren, Regeln mit dem C-Control/BASIC System von Kainka (page 163 u.w.)
>
> Do you expect everyone to own this book?
>
> Bye
>  Achim

Hallo Achim

Question 1
I think there is someting wrong because by pressing the switch P3 the stepper does not turn, as I have in mind.

Question2
Even connecting the switch to 0V (ground) does not have any result.

Question 3  
#start
SDA=OFF
SCL=OFF
return

#stop
SDA=OFF
SCL=ON
SDA=ON
return

#I2C_write
for n=1 to 8
  SDA=OFF
  if  (DatenW and 128) =128 then SDA=ON
  pulse SCL
  DatenW=DatenW shl 1
next
pulse SCL
return
 
I2C_read
DatenR=0
deact SDA
for n=1 to 8
  DatenR=DatenR shl 1
  SCL=ON
  if SDA then DatenR=DatenR+1
  SCL=OFF
next
return

#Ack
SDA=0
pulse SCL
return

#NoAck
SDA=1
pulse SCL
return

end

I hope you an solve my problem

kind regards rien an harelen


 Antwort schreiben

Bisherige Antworten:

Re: progamming PCF8574 (von Achim - 23.11.2004 11:07)
    Re: progamming PCF8574 (von rien an harmelen - 23.11.2004 17:33)
        Re: progamming PCF8574 (von Achim - 23.11.2004 18:04)