Before popping out for lunch I thought I'd try JTAG/GDB debugging on the MX212. Wow, how easy :) After the shenanigans of getting the right PID setup on the Olimex ARM-USB-TINY JTAG connector XP driver, I wasn't hopefull that the OpenOCD server would be properly working. I came across the config file from VC wiki for the server and sparked it up (link to config file here). OpenOCD server looked like it was running fine in the cmd window (with the ARM-USB-TINY connected first to a USB port of course).
Making sure that JP300 and JP500 (for stack power via USB) were shorted I connected up the MX212 to another USB port on the laptop. The three LEDs on the back of the MX212 were all lit, so ready to go. Also have the VC21MM1 connected to the MX212 in my current default configuration.
Using the 'touch' VC21 example, that I know worked via uMon download, I called up the arm-elf-gdb from Cygwin. Hey-presto GDB kicks into life (thanks to the .gdbinit supplied with this example) and the VC21MM1 becomes active and the 'touch' example is running. Broke into the program in GDB and single stepped the code. All working lovely.
Now just need to go back and setup Eclipse properly for JTAG/GDB work with the MX212... And then on to looking at writing that software driver for the VC21MM1 touchscreen LCD in Irrilicht.
Search This Blog
Sunday, 14 October 2007
Pololu chassis up and running...
Yesterday I had great fun setting up the Pololu chassis and controlling it via serial communication from the laptop :) After trying out my soldering on a test kit from Maplin (two LED flashing unit), I started work on the chassis and breadboard work for this ickle robot.
As recommended I soldered a 0.1uF Cermamic capacitors across the two motors and feed each pair of wires from the motors through the chassis to the breadboard. The USB-RS232 connector fed the four serial lines required through to the breadboard, with a simple transistor (2N2222A, high frequency, low power) and resistor arrangement to bring the RS232 levels down to the levels required by the Pololu micro dual serial motor controller. This could then be sent a serial bit stream that the controller would interpret and drive the internal H-Bridge to control the two chassis motors.
I had some teething trouble at first by making the mistake of driving the motor controller logic levels at too high a voltage. Ending up with a smoking motor controller :S Thankfully I had bought two of them just in case this happened.
To send the control data to the motor controller ended up being very simple. A Win32 console app, built through the free Visual Studio 2005 Express Edition IDE, opened up and setup the appropriate COM port that the USB-RS232 converter had mapped itself too (under WinXP). Configured to 9600bps, no parity, 1 stop bit, DTR/RTS turned off, and FILE_FLAG_WRITE_THROUGH|FILE_FLAG_NO_BUFFERING used in the CreateFile call to make sure device writes were not cached (although I also used FlushFileBuffers after each WriteFile just in case). It was then a simple matter of using WriteFile to send the 4 bytes worth of data to the motor controller to control the motor states. Some additional GetAsyncKeyState monkeyness allowed for forward/back/left/right movement control.
Apart from frying the original controller, and making sure that stalls didn't kick in the motor controller thermal cutoff protection, everything went very smoothly. Although this is just novice entry level experiments to get a chassis built and moving, it's a nice starting point. I can now do some stress testing of the chassis and controller, see how they fair with carrying heavier loads, and work out what improvements/replacements need to be made for the final chassis and motor control. But before that, I'm going to switch back to the JTAG debugging investigation/learning with the COGs, and setting up a decent makefile workspace (either in Eclipse or VS EE, not sure yet).
Subscribe to:
Posts (Atom)