Chunhee Song wrote: >I would like to hear some advice on what you guys think of my approach to >a project. >I have about 36 digital boards which are all identical and use a 16-bit >microprocessor built in UART. >What I am trying to do is that I write a serial program that sets/resets >all these boards' registers one by one. > >I am thinking of first connecting PC to the first board thru Tx/RX, the >first board to the second board thru Tx/Rx, >the second board to the third board, and so on. So the system looks like >daisy chain configuration. Since I am going to control each >board one by one, I may have to assign an ID for each of them. So when I >want to control the 20th board, since the PC is >connected to the first one, the program checks until it finds #20 board >and sets the register. I've done this before. The packet I send from the PC has source & destination bytes in it. I set the source to 00 and the destination to the board that I want to address when I send the packet from the PC. When the first board gets the message, it knows that it's the first one because the source byte is 00. If the destination is 01 then it uses the message and does nothing else. If the destination doesn't match, it increments the source byte and re- sends the packet to the next board. This way, the packet only travels far enough along the daisy chain as necessary. You don't need an ID for each board. They just automatically assign themselves an address when they get their first packet. You can re-arrange the boards at any time and they will take on the address that corresponds to where they are in the daisy chain. You can get them to all assign themselves an address by sending a dummy packet with the destination set higher than the number of boards in the system. Regards... -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body