User Tools

Site Tools


en:pfw:i2c_noforth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:pfw:i2c_noforth [2023-09-04 18:16] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1en:pfw:i2c_noforth [2023-09-04 18:16] (current) – ↷ Seite von pfw:i2c_noforth nach en:pfw:i2c_noforth verschoben uho
Line 1: Line 1:
 +{{pfw:banner.png}}
 +
 +====== I2C for noForth on the MSP430 ======
 +
 +{{https://user-images.githubusercontent.com/11397265/122937875-9ab1ad00-d372-11eb-9eab-5bcbd29c8512.jpg|p30(u) - i2c bitbang usci input and output to pcf8574}}\\
 +**I2C on the MSP430G2553**
 +
 +All driver files are from the [[https://home.hccnet.nl/willem.ouwerkerk/egel-for-msp430/egel%20for%20launchpad.html#e03x|Egel Project, from chapter 30ff]]. This code example works with all added driver versions of the noForth I2C implementation:
 +
 +<code>
 +\ 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} ;
 +</code>
 +
 +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