I was wondering if its possible to send binary data to an Atmega328p. I don't want to send Arduino code or C code just binary. Is it possible to programme the ATmega328p using binary and how?
-
You can send a pre-compiled binary yes. But are you sure you don't mean assembly or HEX? It would be a shame to only use the 0 & 1 of your keyboard for programming. And why would you like to achieve this?aaa– aaa05/20/2016 06:19:14Commented May 20, 2016 at 6:19
-
Voting to close as it is entirely unclear what the goal here is. Binary communication is of course possible, but what does it mean to "programme" ? To author something? To load the flash?? To communicate with a bootloader, and if so which one???Chris Stratton– Chris Stratton05/20/2016 16:31:12Commented May 20, 2016 at 16:31
2 Answers
The serial port is binary data.
Because we humans can read text data easier than binary data we mostly send text. This way we only use a very small amount of the possible band with.
The serial monitor translates your input to binary and the binary input of the arduino to text. If you write a program that uses the serialport directly you can communicate in binary without a prolem.
-
You should rephrase your answer. specifically everything after the 1st sentence. Bytes sent via the serial port are implicitly binary; the interpretation on the receiver's end is a different thing entirely and has nothing to do with bandwidth. The serial monitor displays the ASCII character equivalent to each byte received if it can, else you see gibberish for bytes that don't fall within the printable range, barring a few. Also, I dont think the OP is talking about serial communication but rather how code is burned into the ATmega chip over USB.SoreDakeNoKoto– SoreDakeNoKoto05/15/2016 22:38:26Commented May 15, 2016 at 22:38
When you upload your sketch using the IDE, it has been converted from C++ into "binary". So yes, it is possible. In fact that is the only way it is done.
I don't want to send Arduino code or C code just binary.
The job of the compiler is to convert your C code into binary, and that happens automatically.
You an also use avrdude
to upload a xxx.hex file (a file containing pure machine code).