User Tools

Site Tools


en:pfw:i2c_noforth

I2C for noForth on the MSP430

p30(u) - i2c bitbang usci input and output to pcf8574
I2C on the MSP430G2553

All driver files are from the Egel Project, from chapter 30ff. This code example works with all added driver versions of the noForth I2C implementation:

\ Example with clock & 24C32 EEPROM
: {EEADDR   ( a +n -- )                     \ Address EEprom
    50 device!  {i2c-write  b-b bus! bus! ;

\ Read data b from 24C32 EEPROM byte-address addr. 
: EC@       ( addr -- b )
    2 {eeaddr i2c}  1 {i2c-read bus@ i2c} ;

\ Write data b to 24C32 EEPROM byte-address addr.
: EC!       ( b addr -- )
    3 {eeaddr  bus! i2c}  {poll} ;

Files:

  • 24C32 eeprom.f
  • e37 FR5 - i2c bitbang basics at p1 (asm).f
  • e37 FR5 - i2c usci-B0 basics.f
  • e37 G2 - i2c bitbang basics at p1 (asm).f
  • e37um G2 - basics for usci i2c.f
en/pfw/i2c_noforth.txt · Last modified: 2023-09-04 18:16 by uho