TinyWire | I2C library for ATtiny25/45/85
kandi X-RAY | TinyWire Summary
kandi X-RAY | TinyWire Summary
This is just a repository to store and share my changes on BroHogan's USIi2c libraries:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TinyWire
TinyWire Key Features
TinyWire Examples and Code Snippets
Community Discussions
Trending Discussions on TinyWire
QUESTION
I am working on attiny85 for I2C communication. I have gone through different libraries already like Wire.h
, TinyWire.h
, tinyWireM.h
, tinyWireS.h
.
In the start I want to send some byte of data through I2C comm and tried to scope the pin with oscilloscope but its not giving me the appropriate results. Looking on the internet about different ways to make attiny85 work with I2c is really heartless and I could not achieve the task. Finally, I tried to make attiny85 as master and arduino Uno as slave as it was spare in my box.
I tried to make attiny85 as master and send data to arduino and looks the output on serial monitor but its showing zero.
For the reference, the master and slave codes are attached and my task is just simple to check on serial.
Attiny85 as Master
...ANSWER
Answered 2018-Dec-20 at 13:25I have used Atiny85 as a slave using TinyWireS lib (https://github.com/nadavmatalon/TinyWireS) some time back and it worked fine. Below were the pin configurations
ATtiny85 pin 5 with Arduino Uno A4 and ATtiny85 pin 7 with Arduino Uno A5
Below are my codes
Atiny.
QUESTION
its my first question here and I hope I'm not stepping on anyone's tows :-)
Currently I'm working on a modular battery management system for my electric scooter, based on a ATtiny85 as a master and multiple ATtiny85 as slaves. Each slave is monitoring one cell (or a array of multiple cells in parallel) and also using this cell to power itself up. For safety it reads the voltage of the battery and reads a temperature sensor of this cell. It sends these two information via a isolated I2C bus to the master, which will analyze it and will send eventual a response if this cell should activate balancing or not.
Therefor I'm using the digispark bootloader and flashing the software using USB. The software itself I'm programming using Arduino IDE.
So far I managed to establish a good connection between the slaves using TinyWireS and the Master using TinyWireM. I'm successfully sending data from multiple slaves to the master and vise versa.
But when I remove one or more slaves from the bus somehow the reading routine will fill the not received data with the previous received data and will not write a empty line or zero.
Here is the relevant routine, where I poll through the slaves addresses and individually ask each slave for a payload of 4 bytes. The slave will separate the measured voltage and the temperature in two bytes each and will send the resulting 4 bytes separately over the I2C bus.
The master will receive the 4 separate bytes and combine them again to voltage and temperature and write them in an array at the position matching its cell-number.
...ANSWER
Answered 2018-Jan-31 at 21:59I narrowed it down a little more... In the following code the function TinyWireM is writing the data from the loop befor to the variables v_high, v_low, T_high and t_low if no new data is received. But the weired thing is, that they are not all equal, they all have the exact same value from the loop befor. So v_high (old) = v_high (new) and so on.
How can this be if they are all set using the same function, which should run 4 times, so once for each variable?
Here is the relevant part:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TinyWire
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page