Design-in of LPC11U24 (lqfp48) of mbed as Steppermotor controller with USB control.

Dependencies:   USBDevice mbed

Mbed repository of Stepper Motor Control board. Using mbed LPC11U24 chip with HID USB.

Hardware in copy repo on bitbucket https://bitbucket.org/jeroen3/stepper-motor-board

Committer:
jeroen3
Date:
Wed Oct 30 21:59:32 2013 +0000
Revision:
2:ddae311a4533
Parent:
0:d0306c0cbee6
fix led blink after soft reset

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jeroen3 0:d0306c0cbee6 1 #ifndef USBHIDPROTOCOL_H_
jeroen3 0:d0306c0cbee6 2 #define USBHIDPROTOCOL_H_
jeroen3 0:d0306c0cbee6 3 /* Command list */
jeroen3 0:d0306c0cbee6 4 // Devices verifies with same CMD and optional data
jeroen3 0:d0306c0cbee6 5
jeroen3 0:d0306c0cbee6 6 // System commands
jeroen3 0:d0306c0cbee6 7 #define CMD_SYS_CHECK 0x00 // Args: version
jeroen3 0:d0306c0cbee6 8 #define CMD_SYS_RESET 0xFF // Args: bool softreset
jeroen3 0:d0306c0cbee6 9
jeroen3 0:d0306c0cbee6 10 // Miscellaneous
jeroen3 0:d0306c0cbee6 11 #define CMD_LED_OFF 0x10 // On board led on
jeroen3 0:d0306c0cbee6 12 #define CMD_LED_ON 0x11 // On board led off
jeroen3 0:d0306c0cbee6 13 #define CMD_LED_BLINK 0x12 // On board led blink
jeroen3 0:d0306c0cbee6 14 #define CMD_LED_BREATH 0x13 // Not implemented
jeroen3 0:d0306c0cbee6 15 #define CMD_GET_BUTTON 0x14 // Returns button history word with 20 ms interval per bit
jeroen3 0:d0306c0cbee6 16
jeroen3 0:d0306c0cbee6 17 // SMC commands
jeroen3 0:d0306c0cbee6 18 /* Motor has 3 states :
jeroen3 0:d0306c0cbee6 19 Locked - Current flowing, motor is powered
jeroen3 0:d0306c0cbee6 20 Brake - Motor terminals short circuit
jeroen3 0:d0306c0cbee6 21 Free - Motor terminals open
jeroen3 0:d0306c0cbee6 22 */
jeroen3 0:d0306c0cbee6 23 #define CMD_SMC_STEP 0x20 // Args, int number of steps, bool direction, finish this in .. (ms), bool free motor (or keep locked)
jeroen3 0:d0306c0cbee6 24 #define CMD_SMC_STATE 0x21 // Returns remaining steps, negative if paused
jeroen3 0:d0306c0cbee6 25
jeroen3 0:d0306c0cbee6 26 #define CMD_SMC_STOP 0x22 // Aborts all motor control
jeroen3 0:d0306c0cbee6 27 #define CMD_SMC_PAUSE 0x23 // Pauzes motor control, keeps locked (overheating!)
jeroen3 0:d0306c0cbee6 28 #define CMD_SMC_CONTINUE 0x24 // Continues motor control
jeroen3 0:d0306c0cbee6 29
jeroen3 0:d0306c0cbee6 30 // Motor States (ineffective if stepping)
jeroen3 0:d0306c0cbee6 31 #define CMD_SMC_FREE 0x25 // Free motor
jeroen3 0:d0306c0cbee6 32 #define CMD_SMC_BRAKE 0x26 // Brake motor (different from lock)
jeroen3 0:d0306c0cbee6 33
jeroen3 0:d0306c0cbee6 34 // AUX channel
jeroen3 0:d0306c0cbee6 35 #define CMD_AUX_OFF 0x30 // Auxilary channel ON (discards pwm)
jeroen3 0:d0306c0cbee6 36 #define CMD_AUX_ON 0x31 // Auxilary channel OFF (discards pwm)
jeroen3 0:d0306c0cbee6 37 #define CMD_AUX_PWM 0x32 // Auxilary channel PWM. Args: duty cycle, period, timer prescaler (from 48 MHz)
jeroen3 0:d0306c0cbee6 38
jeroen3 0:d0306c0cbee6 39 #endif //USBHIDPROTOCOL_H_
jeroen3 0:d0306c0cbee6 40