Joined: 25 May 2004 Posts: 190 Location: Ljubljana, Slovenia
Posted: Sun Aug 17, 2014 6:50 am Post subject: Atmel I2C pins vsv Bascom I2C pins
Hi everybody!
When using I2C chips, mostly RTC and IOEXPANDER i use Bascom genereted SCL and SDA pins, which i define with CONFIG statement.
It works fine.
I noticed in datasheets of AVR Microcontrolers, that AVR itself has SCL and SDA pins. May I address those pins in my CONFIG statemets as SCL and SDA lines ( I suppose, I may) and what diference would that make.
Excuse my ignorance, there is alway time to learn..
Vilko
(BASCOM-AVR version : 1.11.8.7 , Latest : 2.0.7.7 )
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
Posted: Sun Aug 17, 2014 8:08 am Post subject:
Hi,
Have a look in the help text for CONFIG TWI. Using the hardware i2c/twi interface can save a bit of code space but not always. Using software i2c means your free to use whatever pins you want.
I usually try to design my PCB's so that the i2c signals are on the twi pins but usually I end up using the software i2c lib rather than the hardware twi lib.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen.
if the chip has hardware TWI, i would recommend to use these pins. always !
the signals the TWI generates are better than the software generated signals and in some chips you can control some aspects of the signal.
it is a simple rule : if there is a hardware pin to do a task, use that pin ! After all you can always use the/a software implementation if required. _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum