ciao,
domanda facile per molti, mi serve un chip minimale, deve solo inviare dei messaggi fissi via seriale (poche decine di byte e un timeout), vorrei potesse farlo in HW così da avere un pò di spazio in più se volessi rendere la cosa un poco più seria.
requisiti: formato DIP, straeconomico, programmabile con l'arduino, magari usando le librerie arduino. Pensavo agli attiny ma non saprei QUALE delle millemila versioni..
ricordo vagamante una tabella delle feature, se avete il link mi fa piacere
domanda: con ATtiny2313 / 4313 + softserial quanto spazio lasciano a sketch e variabili varie?
vero che devo inviare delle stringhe da qualche centinaio di byte al massimo, però..
Il 2313/4313 hanno la seriale Hardware.
Per usarli con l'IDE devi aggiungere il core Tiny. Trovi le istruzioni sul sito di Leo sia per la versione 1.0.5 che per la 1.5.7.
L'esempio ASCIItable dell'IDE, compilato col core tiny su 2313 occupa 2024 byte su 2048.
/*
ASCII table
Prints out byte values in all possible formats:
* as raw binary values
* as ASCII-encoded decimal, hex, octal, and binary values
For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII
The circuit: No external hardware needed.
created 2006
by Nicholas Zambetti
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
<http://www.zambetti.com>
*/
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// prints title with ending line break
Serial.println("ASCII Table ~ Character Map");
}
// first visible ASCIIcharacter '!' is number 33:
int thisByte = 33;
// you can also write ASCII characters in single quotes.
// for example. '!' is the same as 33, so you could also use this:
//int thisByte = '!';
void loop() {
// prints value unaltered, i.e. the raw binary version of the
// byte. The serial monitor interprets all bytes as
// ASCII, so 33, the first number, will show up as '!'
Serial.write(thisByte);
Serial.print(", dec: ");
// prints value as string as an ASCII-encoded decimal (base 10).
// Decimal is the default format for Serial.print() and Serial.println(),
// so no modifier is needed:
Serial.print(thisByte);
// But you can declare the modifier for decimal if you want to.
//this also works if you uncomment it:
// Serial.print(thisByte, DEC);
Serial.print(", hex: ");
// prints value as string in hexadecimal (base 16):
Serial.print(thisByte, HEX);
Serial.print(", oct: ");
// prints value as string in octal (base 8);
Serial.print(thisByte, OCT);
Serial.print(", bin: ");
// prints value as string in binary (base 2)
// also prints ending line break:
Serial.println(thisByte, BIN);
// if printed last visible character '~' or 126, stop:
if(thisByte == 126) { // you could also use if (thisByte == '~') {
// This loop loops forever and does nothing
while(true) {
continue;
}
}
// go on to the next character
thisByte++;
}
L'esempio ASCIItable dell'IDE, compilato col core tiny su 2313 occupa 2024 byte su 2048.
ecco, mi immaginavo qualcosa del genere. Certo, scrivendo il codice ad hoc blablabla (anche se credo esistano vari esmpi pre-cotti), ma per 0.05€ al pezzo (su mouser) direi che non mi ci metto neanche!
quello che mi preoccupa di più btw è l'uso ram, che è più complesso da mappare, ma se mi assicurate che funziona ci credo xD