View previous topic :: View next topic |
Author |
Message |
Dead_Banzay
Joined: 26 Dec 2016 Posts: 1
|
Posted: Mon Dec 26, 2016 5:28 pm Post subject: I2C PCF8574T |
|
|
Help please, run the LCD 16 * 2.
I can not understand what I'm doing wrong (( _________________ Beard does not make you a philosopher |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Mon Dec 26, 2016 6:32 pm Post subject: |
|
|
Hi,
Try an i2cdelay of 10, thats 100KHz bus Speed.
Your missing i2cinit in you code.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
bzijlstra
Joined: 30 Dec 2004 Posts: 1179 Location: Tilburg - Netherlands
|
Posted: Mon Dec 26, 2016 11:01 pm Post subject: Check address |
|
|
PCF8474 has I2c address &h40
Try the i2c scanner for the correct address
Have fun
Ben Zijlstra |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Tue Dec 27, 2016 8:31 am Post subject: |
|
|
Hi,
See if your i2c bus is actually working, with a i2c scanner. Something like this:
Code: |
Dim Adress_loop As Byte
Print "i2c ";
For Adress_loop = 2 To 254 Step 2 'Scan every even address
I2cstart 'setup i2c bus
I2cwbyte Adress_loop 'get result
If Err = 0 Then 'err=hw problem
Print Adress_loop ; "," ; 'no error so device
End If 'exits
I2cstop 'stop bus
Next Adress_loop 'loop through each sensor
Print ""
|
Bascom uses 8 bit addresses so Ben is correct, you should try &H40.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
DJ7DA
Joined: 03 May 2006 Posts: 83 Location: Bavaria
|
Posted: Sat Apr 14, 2018 8:02 pm Post subject: Port assignement ?? |
|
|
... a little late, but still valid:
PORTC.5 = SCL
PORTC.4 = SDA
(not the other way around)
Regards
DJ7DA |
|
Back to top |
|
|
|