Society of Robots - Robot Forum

Software => Software => Topic started by: motobecane on March 04, 2010, 08:51:50 PM

Title: Reeciving Inputs from Laptop while MCU Program is running
Post by: motobecane on March 04, 2010, 08:51:50 PM
I have an Axon controlling some stepper motors.  Is there a technique/software package for having the MCU accept input from the laptop about motor speed and direction?  I know how to bootload from my laptop to my MCU and how to use Hyper-Terminal to receive data from the Axon, but I'm looking for something more dynamic.
Title: Re: Reeciving Inputs from Laptop while MCU Program is running
Post by: Razor Concepts on March 04, 2010, 09:05:27 PM
Use a better terminal program like RealTerm so that you can also send serial data to the Axon and not just receive.
Title: Re: Reeciving Inputs from Laptop while MCU Program is running
Post by: hopslink on March 05, 2010, 03:07:50 AM
Hyperterminal sends any character you type into the main window so you don't need RealTerm (but RealTerm is by far the better tool - recommended). It can also send files.

The problem is that you can't see what you have typed/sent by default. If you go into the properties for your connection, under the Setup tab, ASCII settings, you can set a checkbox to echo typed characters locally, now what you type/send will show on the screen.
Title: Re: Reeciving Inputs from Laptop while MCU Program is running
Post by: waltr on March 05, 2010, 08:16:50 AM
I think the OP is asking about how to have the Axon receive and respond to commands send from the laptop to the Axon while the Axon is busy timing signals to the stepper motors.

This should be able to be done by writing (or using library functions if they exist) an interrupt driven UART receiver. Basically, when the Axon's UART receives a character an interrupt is issued and code execution jumps to the ISR (Interrupt Service Routine) which reads the character from the UART and passes the character on to a parsing routine to be interpreted (say 'stop motors').