hello guys
I'm working on a project which will transmit a sound signal in digital form to another end arduino.
the signal will come from mic thorugh Anlog to Digital Converter ADC.
I want to ask if the Arduino could possibly transmit 80kbps(8 bits,10khz) through a single pin(serial transmission) a long with synchronization bits (possibly using Manchester code) , I have used ICs which will encode the bits into Manchester code and decode it then but unfortunately it doesn't support that much of bitrate.
Have you thought of using asynchronous serial? This adds a start bit and stop bit to your data bytes so you are sending 100 kbps but the hardware supports a bit rate of 115200 so that will work. This will use the serial hardware so you can't use it for stuff like Serial Monitor unless you have an Arduino MEGA with multiple hardware serial ports or the Leonardo which use USB directly for communication with a PC and has a hardware serial port to spare.
Hardware serial port supports 115200, 230400 data rates.
SPI can send data at 8 MHz rate, but that requires 2 pins, clock & data.
The onboard ADC takes 110uS/conversion, so that's really the limiting factor.
You can use an external ADC with SPI interface to sample the Mic a lot faster,
See Figure 6.1
You need to set SPI.divisor to 8 for 2 MHz clock. Then:
PORTB = PORTB & 11111011; // D10 low for chip select
lowByte = SPI.transfer(0);
highByte = SPI.transfer(0);
PORTB = PORTB | 0b00000100; // D10 high
// combine into an int, something like this - always takes a couple tries to
// get casting & stuff done right
combinedData = ( (highByte <<8) | lowByte) >>4;
Whole thing takes about 10-12uS or so.
I already have an ADC IC, and it's connected to Arduino in parallel
I don't know exactly that much about asynchronous serial or the SPI
I have found many way to do it but they are not suitable for my project.
What I need really is only one wire for data and also for clock recovery incase needed!
I will transferred the electrical signal to optical form to be received by the other Arduino.
Onewire, 80 KHz is possible.
That's what this LED drive chip uses.
Adafruit has a library to drive it, you could use that as a starting point.
https://learn.adafruit.com/search?q=ws2811
Not sure what would be involved in recovering the data.
Likely involves interrupts and timing measurements.
WS2811-preliminary.pdf (320 KB)