Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Transmiting 8 channal adc's data through 8051 uart

Status
Not open for further replies.

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
285
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
I have 8 channel multiplexed 8 bit ADC.
connected to 8051.
I need to transfer 8 channel data through UART.

what is the best way to do that ?
 
Last edited:

convert the adc result to string. write the string to uart tx.
 

string terminates with null '\0' char if i grounded the adc input it takes it as null char.
 

First take the ADC reading. This will be 8-bit numerical data. Then transfer this through the UART module. You can send the 8-bit value directly or you can change/modify it as required to give desired output.
 

First take the ADC reading. This will be 8-bit numerical data. Then transfer this through the UART module. You can send the 8-bit value directly or you can change/modify it as required to give desired output.

Mr Tahmid
I'm asking how to transmit 8 channel data. I have already successes in transmitting single channel data.
 

You want to transmit data through 8 UART modules?

You can use software UART. You need to generate the UART timings, pulses, etc on your own through software. Use 8 sets of TX, RX pins on which you'll send/receive the data.
 

You want to transmit data through 8 UART modules?

You can use software UART. You need to generate the UART timings, pulses, etc on your own through software. Use 8 sets of TX, RX pins on which you'll send/receive the data.

8 sets of uart ?
I think you haven't understand my question.
I use only one uart mu adc is 0808 multiplex adc. and PC
8 sensors data on pc and separate them for each corresponding sensor.
 

So, you mean you're going to send data to one UART module, but you will send data from the 8 channels of ADC?
 

So, you mean you're going to send data to one UART module, but you will send data from the 8 channels of ADC?

8 bit adc (0808) ------->8051---->computer
dont you know 8051 has on chip hardware uart ?
 

Yes, I know that 8051 has on chip hardware UART module. I've been referring to it as "UART module".

So, do you want to transfer ADC results (from channel 0 to channel 7) one after the other to the computer? Is this the 8-channel you're referring to?
 

send 8 sets of data the same way you send the data1

if your adc readings are ch1, ch2, ch3..... ch8, then send each channel data one after the other. so you beed 8 uart write instrunctions or you store your adc data in a array like adc_result[8] and send it using a 0 to 7 loop to uart like uart_write(array);
 

You can also send it after each analog-to-digital conversion. So, channel 0 is read. Then, the corresponding value is sent. Then channel 1 is read and its corresponding value is sent. And so on until channel 7 is read and corresponding value is sent. Then go back to channel 0 and restart the process.
 

I have already successes in transmitting single channel data.

As you've already done with single channel data, then what's the problem to do the same with 8 channel data.

You just need to save the data in 8 variables or array, then need to follow the same thing 8 times which you've done with single channel.
or otherwise set your actual question, I mean where exactly you're stuck or what actual confusion you've experienced to do it with 8 channel.
 

@ sagar474, you hav not clearly defined what you want to do....if i may say something, you have the 0808 ADC, 8051 MCU and your design makes use of the multiplexed ADC chip.

now you want to read parameters via this ADC chip via the MCU then send it to the PC via the serial port?...hope it makes sense this way?

then if it so just create a routine in your program that will read the content of each channel then store it in a register, you may repeat this for each channel.
when you are done, all you have to do is simply copy the content of say channel_1 to the SBUF in other to send it out. repeat for channel_2.......channel_n.
....or you can simply read each channel store the content to a register, call a routine that will send out data for you, read the next channel call the same routine till....
 

i sent 8 byte data sequence.
but I stuck at separating them for each corresponding sensor sensor data correctly with out getting wring sensor out put.
example for temperature sensor reading I shouldn't get a voltage sensor reading.
 

Select the appropriate ADC channel. There's no way you can get reading of some other channel when you've specified one channel (unless of course the ADC is damaged).

Is this what you're having problem with? Selecting the appropriate ADC channel?
 

and also are you very sure of your ADC chip?.... i will advice you back check this once again so that you'd be sure of what you are doing...
or better still select each channel then check if the output is inline with what you ought to get. repeat this for all channel.
 

f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12

I get this type of streaming data on term.

now the problem is how to differentiate each sensor data ?

do any one know the best protocol for that ?
 

please try segmenting the data gotten because what you have posted is not properly defined.

you can use this format channel_1 "54", channel_2 "d3", channel_3 "b1", channel_4 "05", channel_5 "64" etc...

- - - Updated - - -

then it will be easy to no how to go about the spacing that has been your problem
 

f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12 f3 f3 a3 c4 dc 33 24 12

I get this type of streaming data on term.

now the problem is how to differentiate each sensor data ?

do any one know the best protocol for that ?

you've already done. what you need is to use additional string to add means... for 1st to 8th channel "_(data)" i = 1 to 8
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top