Is there any function in atmel studio or arduino that would help me send an 8 bit signal oven the B0 pin of atmega328p?
Is there any function in atmel studio or arduino that would help me send an 8 bit signal oven the B0 pin of atmega328p?
Hi,
Serial library only works on pins with dedicated UART, ie in the UNO digital pin 0 and 1.
For sending serial data over other pins you can use the SoftwareSerial library, which emulates the hardware by software, and you can chose the digital pins to act as Rx and Tx.
See this https://www.arduino.cc/en/Reference/softwareSerial.
Hope that helps!!!
Hello Rishi,
if you need to send 8 bit on a single pin as a matter of fact it is a serialised byte. One option is to use the hardware serial, with the limitation of pins 0 and 1 that are connected to the dedicated UART (there is only one) on Arduino. There is the problem too that if your board has a USB connection this two pins are redirected to the serial to USB converter that may generate issues.
The alternate case - if you want a "ready-to eat" solution is the software serial library, that with some interrupt-based trick manages independent timing to make almost any digital Arduino PIN available for the serial transmission. Personally I have used it in past just for experiment and I have found several issues.
Instead, if you send in a single direction 8 bit at a time, you can take inspiration from the Tom Igoe's software serial (I suggest to download the last updated version that has less bugs and limitations than the previous) and starting from this library - that is, a C++ class - create your own class to solve your specific problem.
If you can be more precise instead maybe we can find a more specific solution, as it seems that you need a "serialisation" but not a conventional serial transmission so many parts of the library can be ignored or simplified.
Take also in account the possibility to use the 1-Wire library to manage the serial transmission over a single channel. But also in this case it is again a protocol for a standardised data bus so you should adapt your needs to the 1-Wire specifications.
Let us know what you have really in mind and we try to help you better.
Enrico
Is there a reason you specifically want to use B0 or will any pin do
Have you also considered using the I2C bus as this will also send 8 bts at a time to a destination via a hardwre UART, just a different protocol thats all.