mkoval / hax

Hardware Abstraction for VEX is a C hardware abstraction layer for the VEX Robotics PIC18 and ARM Cortex M3 micrcontrollers. See the Wiki for a more detailed overview and for a guide to get started.
http://ieee.rutgers.edu/content/hax
6 stars 8 forks source link

Two-Wire Motor Support #7

Open mkoval opened 14 years ago

mkoval commented 14 years ago

There is no support for two-wire motors on the Cortex.

codyps commented 14 years ago

IFI uses Timer4 for this. CCR{1,2} deal with the first one, CCR{3,4} with the second. See main.c::Set_MotorControl_Sw{1,2}, main.c::Set_MotorControl_To_Neutral(void), and main.c::Setup_timer4 in the original Vex_Default code.

mkoval commented 14 years ago

Nice find. It should be pretty trivial to port this to Hax, although we will need to convert from signed to unsigned motor speeds as normal. Before we do anything, we must settle on a indexing convention that is somewhat intuitive. I'm inclined to make it have the same order as the physical labels (ie. 0 and 8 as high-strength motors).