Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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
286
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:

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
convert the adc result to string. write the string to uart tx.
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
string terminates with null '\0' char if i grounded the adc input it takes it as null char.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
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.
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
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.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
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.
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
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.
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
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 ?
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
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?
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
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);
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
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.
 

Jigar 4 Electronics

Full Member level 5
Joined
Apr 28, 2011
Messages
313
Helped
40
Reputation
80
Reaction score
38
Trophy points
1,318
Location
Hamilton, ON, Canada
Activity points
3,390
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.
 

sequel

Member level 4
Joined
Oct 27, 2012
Messages
76
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,288
Location
Nigeria
Activity points
1,753
@ 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....
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
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.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
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?
 

sequel

Member level 4
Joined
Oct 27, 2012
Messages
76
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,288
Location
Nigeria
Activity points
1,753
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.
 

sagar474

Full Member level 5
Joined
Oct 18, 2009
Messages
286
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,318
Location
India,kakinada
Activity points
3,122
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 ?
 

sequel

Member level 4
Joined
Oct 27, 2012
Messages
76
Helped
8
Reputation
16
Reaction score
7
Trophy points
1,288
Location
Nigeria
Activity points
1,753
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
 

Jigar 4 Electronics

Full Member level 5
Joined
Apr 28, 2011
Messages
313
Helped
40
Reputation
80
Reaction score
38
Trophy points
1,318
Location
Hamilton, ON, Canada
Activity points
3,390
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

Top