advertisement
from the Forum department...
Questions for implementing MODBUS using AVR
Communications systems and equipment. topic
Posted by Javad babaee on 1 November, 2012 - 11:43 am
Hi

I have 8 analog channels in atmega128 to read. I want to read these values and send them to master when requested (using RS485 4-wire and MODBUS protocol)

I think I have to wait for a call from master in my code (I am going to use codevisionAVR); so I'd like to set my ADC settings to work in free running mode and the analog values be ready when ever I need to read them and send to master.

But from datasheet, it seems that the channel ADC is working on, should be set in ADMUX register, so it seems free running mode will convert only 1 channel input, I have 8!
I'm afraid I go for reading analog values and get a call from master at the same time and miss that!
Any comments/suggestions?
This is my first code for USART

How I should get notified the master is sending a request to check if it's sending my address, in C++ for AVR?
Thank you in advance for your help

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2013 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
In Tennessee, it is illegal to shoot any game other than whales from a
moving automobile.
Advertise here
Advertisement
our advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive