using two ATD channels

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

using two ATD channels

1,625 次查看
bitasobhani
Contributor III
Hi all
I want to convert two analog inputs by ATD (at two port B pins) at the same time and send them to uart.
I know each write on ATDSC will cancel the current conversion and start a new one. So how can I convert the two inputs at the same time?
Can anybody give me an example of setting ATDSC register and reading ATDRH in the case of more than one ATD channel?
THANKS
标签 (1)
0 项奖励
回复
2 回复数

775 次查看
peg
Senior Contributor IV
Hello bitasobhani,

You don't say what device you are using.........
However usually there is only one converter with several multiplexed inputs, so you can't do several at once.
You do this by selecting one input and when you pickup the result you switch to the other (which causes the next conversion to start) then when you pick up this result you switch back to the original input etc.....

0 项奖励
回复

775 次查看
bitasobhani
Contributor III
Thanks for your reply
I am working on zigbee 1321x.
I  disabled countinous conversion mode and also disables ATD interrupt. I started an interval timer just after joining the network. At the end of each interval I start conversion for the first channel, run an empty while loop if CCF is not set yet.Then I read the result register and send it to coordinator.  At this point I start conversion of the second channel, run a while loop for CCF and then read the result and send it to coordinator.

By this way, the coordinator can receive all the samples only if the timer interval is not less than about 100milliseconds. For intervals less than 100ms but more than 1ms, only samples of the first channel is received at the coordinator and for intervals less than 1ms nothing is received.
Does this restriction really exist or there is another way for increasing the data rate.
THANKS

0 项奖励
回复