Open MaurinElectroTextile opened 6 years ago
At first glance, I see no reason this couldn't be used on an ATTiny10 since it has the required peripherals and space:
However, it should be noted that the ATTiny10 has a 16-bit counter, while the ATTiny13A only had 8 bits. You will need to recompute the constants ONEWIRE_RESET_TICKS
and ONEWIRE_READ_TICKS
. You may also end up having to either adjust the prescaler or use a initial value in the timer to prevent overflow from taking too long.
Let's look at the schematic. I'm going to assume you've read up on the 1-wire protocol and how it is usually driven. The 1-wire signal will be applied to P1 (ground to pin 2, signal to pin 1).
The input connector P1 has its pins in one of two states:
Now, there is one other issue: Brown-out. This device is designed to brown-out since it runs off a capacitor that is slowly discharging. I could not find any mention of a brown-out detect circuit on the ATTiny10, so you may need to provide your own (please read this application note by Atmel about building an external brownout detection circuit). If you do not provide some way to reset the device when the power dips too low, you will get undefined behavior and the microcontroller will misbehave. The device may not respond to onewire commands or may do something really strange.
Following your advises you will find the code for ATTiny10 on this repository https://github.com/eTextile/Lulu/tree/Lulu-MCU/Firmware I decide to focus on safe solution with three wires. It is still work in progress but any advises are welcome.
Do you think that your code can fit in the ATTiny10? http://www.atmel.com/images/atmel-8127-avr-8-bit-microcontroller-attiny4-attiny5-attiny9-attiny10_datasheet.pdf I'm interested to use it to drive a 60 mA LED. Merci ;-)