In my latest project, I have two components (GSM and GPS devices) that I need to control through serial communication. This means that I need to reserve in my microcontroller at least 4 GPIO pins for that action.
Now, I would like to know are Attiny85 or Attiny84 able to "help me" control my devices ?
I was reading somewhere that these Attinys do not support two serial communications at once.
Is there anyone here having successfully implemented two serial communications in Attiny controllers?
I know that Atmega328P is able to satisfy my needs. This is my last option. However, I don't like to drive a Ferrari in a first gear! I mean, I don't want to waste 20 I/O pins and tens of kBs of the program memory. My code is pretty simple. Two serial communications (one hardware and one software or both software serials) and little data processing is everything I need. In addition, these two Attinys are slightly cheaper than Atmega328P.
As soon as I'm sure Attinys can not give me what I want, I will start with Atmega328.
I know that Atmega328P is able to satisfy my needs. This is my last option. However, I don't like to drive a Ferrari in a first gear! I mean, I don't want to waste 20 I/O pins and tens of kBs of the program memory. My code is pretty simple. Two serial communications (one hardware and one software or both software serials) and little data processing is everything I need. In addition, these two Attinys are slightly cheaper than Atmega328P.
As soon as I'm sure Attinys can not give me what I want, I will start with Atmega328.
Anyways, thanks for your input.
Sincerely,
Bojan.
When the effort and time of trying to use a cheaper piece to its limits exceeds the difference of price of the other option, then one must think about it.
But if you got free time, then its ok.
mart256:
When the effort and time of trying to use a cheaper piece to its limits exceeds the difference of price of the other option, then one must think about it.
But if you got free time, then its ok.
I agree with you Mart!
The life is full of tradeoffs
I believe it is worth of investing some initial time and effort trying to find an optimal solution. Especially if there is a chance for a mass production of a device.
Cool, yeah - I’ve been loving these parts since I got the core working. That second serial gives them a capability you don’t have on the '328p (also, as you probably saw on that page, the core also supports the 1634.
Is there any special setup required to get the serial ports working with UARTs? I'm probably all mixed up and confused here, but I was trying this simple sketch, and only got nonsense back through the USB serial:
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial1.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("ping");
Serial1.println("pong");
Serial.flush();
Serial1.flush();
delay(5000);
}
I get four characters each time, but they're nonsense.
I'm listening with "screen /dev/cu.usbserial-XXXX 15200" and the same thing using tty.usbserial-XXXX, on OS X 10.10.5.
The ATTiny841 is on a breadboard, powered by a Seeed stuidos "UARTSbee", which has worked fine for me in other projects.
Okay, I managed to solve my own problem: I’m using Elecrab’s ATTiny841 breakout with an external 14.7456MHz crystal.
Why did I pick that crystal? I’m not really sure, but it seemed like a good idea at the time. I want to communicate at 115200 baud, and having a crystal that was a multiple of 115200 sounded like the right thing to do. That’s my story and I’m sticking to it.