Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ATTiny45 with I2C on DAC6571

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
nobner

Bascom Member



Joined: 29 Apr 2015
Posts: 24

germany.gif
PostPosted: Fri Apr 28, 2017 5:40 pm    Post subject: ATTiny45 with I2C on DAC6571 Reply with quote

Hello together,
i'm trying to do with I2C and a ATTiny45 a voltage output on an DAC6571. This works only, if i use I2Cdelay.
Now i use I2Cdelay=10.
In the Bascom Helpfile is written, 10 is a Busfrequency at 100KHz "but it depends on the used crystal". I'm using the internal 8MHz oszillator.
If the 100KHz are defined for a 4MHz oszillator, is it then so, that I2Cdelay=10 with a 8MHz oszillator is automatically a Busfreuency of 200KHz?
I didn't found a direct context between oscillator frequency and I2Cdelay-value?
Thanks for a hint,
kind regards
Norbert

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Fri Apr 28, 2017 7:57 pm    Post subject: Reply with quote

you can best use the USI. See samples\USI\
of course soft mode works too.
Delay is using waitus internally. So only the parameter value will make a difference.
Code in lib : @genus(___I2CDELAY)

In earlier versions there was a simple delay loop. Later the clock independent waitus was used.
But when having TWI or USI you can better use that.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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