- Tue Oct 26, 2010 5:34 pm
#112187
Hi Guys,
I'm just looking for some validation of my ideas and any code tips that you'd have for the following scenario.
I am working on a project that will have a series of AVR's (most likely ATTiny 2313's) daisy chained together into a long string. I need each of these micro's to be individually addressable, but I want to be able to break the system down into individual pieces which can be re-assembled without regard for the order they were in or are put into.
What I'm considering is the following. Each module will be held in reset by the previous module. A control module will set the reset line high so the first module can start and then proceed to broadcast an id out via a serial connection. The first module will hold the reset of the next module in line low until it has received the id and transmitted a confirmation back to the control unit. Once a module has an id it will let the reset go high for the next module and pass on any serial commands through its second serial port. This process will repeat until all modules are discovered and have id's.
Once all the modules have id's, the master will know how many there are and how to address each individual module. By passing the serial control commands through each micro there won't be any attenuation throughout the system enabling reasonably long chains to be built. The ATTiny has a USART and a USI so I'll be using one hardware serial port and one software serial port.
Does this sound reasonable and likely to work? The main drive to having the automatic addressing system is for ease of assembly on site and so all spares can be common and not have to be programmed specifically for an application.
Sorry for the long post but any hints, tips or example code would be great. I’m not 100% sure how to handle the addressing pickup or the pass-through at this stage so any suggestions would be great.
Cheers
Andrew
I'm just looking for some validation of my ideas and any code tips that you'd have for the following scenario.
I am working on a project that will have a series of AVR's (most likely ATTiny 2313's) daisy chained together into a long string. I need each of these micro's to be individually addressable, but I want to be able to break the system down into individual pieces which can be re-assembled without regard for the order they were in or are put into.
What I'm considering is the following. Each module will be held in reset by the previous module. A control module will set the reset line high so the first module can start and then proceed to broadcast an id out via a serial connection. The first module will hold the reset of the next module in line low until it has received the id and transmitted a confirmation back to the control unit. Once a module has an id it will let the reset go high for the next module and pass on any serial commands through its second serial port. This process will repeat until all modules are discovered and have id's.
Once all the modules have id's, the master will know how many there are and how to address each individual module. By passing the serial control commands through each micro there won't be any attenuation throughout the system enabling reasonably long chains to be built. The ATTiny has a USART and a USI so I'll be using one hardware serial port and one software serial port.
Does this sound reasonable and likely to work? The main drive to having the automatic addressing system is for ease of assembly on site and so all spares can be common and not have to be programmed specifically for an application.
Sorry for the long post but any hints, tips or example code would be great. I’m not 100% sure how to handle the addressing pickup or the pass-through at this stage so any suggestions would be great.
Cheers
Andrew