Urgent ADC please!!!

Status
Not open for further replies.

tuanvoi

New Member
Hello all!
My PIC is PIC18F4550.

I use my PIC to convert and audio signal to digital signal and use bluetooth eb301(from A7 - bridging your world ) ) ) which connects to my PIC18F4550 to transfer the converted signal to another bluetooth device.

After the ADC, you will have 10bits parallely which will be impossible to transfer to the other bluetooth device.

My question is how I can I deal with this 8 bit parallel signal so that I can transfer over the bluetooth. I'm thinking to change this signal to serial but I don't know how to do it. I would be very happy if any suggestions or codes.

Thank you all!

Tom
 
hello bro,i actually doing a same thing with you,convert the audio signal from analog to digital. May you post you code up here?
 
After the ADC, you will have 10bits parallely which will be impossible to transfer to the other bluetooth device.


No you don't have a 10 bit parallel, what you got is MSB,LSB"******xx,xxxxxxxx"
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)

Transmit the ADRESH then ADRESL.

Check the datasheet AD section.
 
So what you "csaba911" would do is you will send ADRESH then ADRESL? I want to transmit this data through bluetooth which connects to UART (RS232). Here is my steps:
-I would read the data from ADRESH and ADRESL.
-and I then store it into the pin Tx of UART
by the way, the ADC is continuously processing. Do I have to stop the conversion for some micro seconds so that when the first 10bit data transmitted and then I allow the ADC to continue again?
Thank so much!
Tom
 
The USART will shift out your data one bit at a time. It can signal when the buffer is ready for another byte. The 18F4550 can sample a single A/D channel at a maximum of about 35kHz, the EUSART can convert a byte to serial faster than your bluetooth serial port can sustain.
Say your bluetooth is set for 115k baud, this works out to roughly 11.5k bytes per second or if you want to send two bytes well half that number so 5.75k words per second. So about 5 kHz audio at 10bit. This does not include any oversampling.

You might be able to run at 230k baud serial but your bluetooth adapter will almost certanly need flow control (start / stop) but your mileage may vary.

How fast are you sampling the A/D? How many channels?
 
Hi,
My PIC18F4550 has 13 channels and the fastest sampling rate is 40Mhz.
If possible, could you "blueroomelectronics" please give me the sample pseudo code? Thank you a lot.
Tom
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…