1k of program space, 64 bytes of RAM. Is 1-wire communication possible?

(If your lazy bottom for TL, DR )

Hello, I plan to create a new (prototype) project dedicated to physical computing. Basically, I have wires. All of these wires must read voltage at the same time. The difference between the readings of each wire will exceed several hundred microseconds. Arduino takes about 114 microseconds. Therefore, I could only read 2 or 3 wires before latency distorted the accuracy of the readings.

So my plan is for Arduino to be the “master” of the ATTinys array. Arduino is quite cramped for space, but it is a massive playground compared to the tines. ATTiny13A has 1k flash memory (software space), 64 bytes of RAM and 64 bytes (not long-lasting and slow) EEPROM. (I choose this both in price and in size)

ATTinys will not do much on my system. In principle, all they will do is wait for the signal from the Master, and then read the voltage of 1 or 2 wires and store it in RAM (or, possibly, EEPROM, if this is crowded). And then send it to Teacher using only 1 wire for data (there is no place for more than!).

So far, all I had to do was implement a trivial voltage sensing code (using the built-in ADC). But this bit is the bit I'm worried about. Do you think that the communication protocol (using only one wire!) Can be implemented in such restrictions?

TL DR: In less than 1k of program space and 64 bytes of RAM (and 64 bytes of EEPROM), do you think you can implement a 1-wire communication protocol? Would I need to upgrade to an assembly to fit?

I know that currently my Arduino library-related wiring programs are over 8k, so I'm a little worried.

+5
source share
8 answers

1k , , , . .

+2

( , ), , , .

- , - 8x14, , , (I2C) EEPROM . 4- . , RS232C I2C . , Modbus (, , , CRC- ) .

128 x 4 1kW, 2kW, 3kW 4kW ROM (10 ). 1100 , . , Assembler.

.

. , , . , . , .

: , , . , , .

+8

, C, , , . , , - C-.

+2

. Borland Turbo C ( ) , , , . , , : C .

, C () . . , C, .

+1

, , , , c.

, , , c, . (, , c- - ..)

+1

ATTiny25. 8- AVR, Atmel. 1- , .

+1

, ?

+1

master-slave , AT90USB646 ATtiny85. , , :

As for your communication protocol, keep in mind that the uncalibrated internal generator on the ATtiny13 has an accuracy of +/- 10%. This means that you cannot use, for example, RS-232 communication.

On my system, I used the Dallas 1 Wire protocol variant. Including full support for slave enumeration, etc., the C Source Code is compiled into 1626 bytes.

Edit: Oops, I didn’t understand that the question is so old. Hope this can still help.

+1
source

All Articles