View Single Post
  #6   Spotlight this post!  
Unread 03-10-2003, 04:28
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Linking two controllers together - the how? part

Quote:
Originally posted by SuperDanman
When do you read in (serin?) info and when do you output info? What are the steps to synchronize the two?
If the new processor in the RC is even remotely decent, it should provide an interrupt when a byte is received by the serial port. Also, if you're transmitting data, it should provide an interrupt when the transmit buffer is empty. I haven't checked the spec sheet on it yet, but I'd be very surprised if this wasn't true.

The way we set up our StangPS last year, the RC was in control of the serial link and would send out a "request" byte to our custom circuit's microcontroller. Our custom controller was just running a loop of code that read various sensors and constantly recalculated its position. When a request byte came in from the RC, it generated an interrupt which caused our microcontroller to jump to the interrupt code where we took care of responding to the request byte. After the interrupt handler was done, it would resume the main loop of checking sensors & updating its position.
Quote:
Say that you'd use the serial port... is there any special data/packet formatting that you have to do?

This would be entirely up to you. I'd recommend you design some sort of protocol that the two use to talk to each other. Again, in our example, the "protocol" was merely a single byte sent from the RC to the custom circuit that requested a certain type of data. When the custom circuit received it, it responded with a predermined number of bytes which the RC was waiting for with a serin statement.