barkerben
- 29th November 2004, 21:18
Hi,
I'm trying to control a camera mount I've built as part of my final year project at Uni. However, I'm quite concerned about this code I've written - especially the section that deals with sending and receiving serial data.
It is used to control a stepper motor driver chip, and the idea is that it receives commands over the serial link, which calls an interrupt. To make sure the interrupt is serviced before a buffer overun, I'm using the hardware timer and timer interrupt rather than pause commands. The serial link can issue commands such as speed, direction, number of steps, and can request motor position. This is returned as the number of steps the motor has taken, which is tracked in a variable.
My code is at:
http://www.srcf.ucam.org/~dbrb2/code/
I realise it is unlikely anyone will be able to give any advice, but it would be very welcome!
Cheers,
Ben
I'm trying to control a camera mount I've built as part of my final year project at Uni. However, I'm quite concerned about this code I've written - especially the section that deals with sending and receiving serial data.
It is used to control a stepper motor driver chip, and the idea is that it receives commands over the serial link, which calls an interrupt. To make sure the interrupt is serviced before a buffer overun, I'm using the hardware timer and timer interrupt rather than pause commands. The serial link can issue commands such as speed, direction, number of steps, and can request motor position. This is returned as the number of steps the motor has taken, which is tracked in a variable.
My code is at:
http://www.srcf.ucam.org/~dbrb2/code/
I realise it is unlikely anyone will be able to give any advice, but it would be very welcome!
Cheers,
Ben