Tuesday, September 21, 2010

Blinky-blinky!

This entry covers the electrical component over the last several session.

Several sessions ago we had little luck getting the microcontroller to talk to the USB device. The FT232R-based adapter we were using was modified from another in-house project (we'll call it the USBBT adapter). The symptom was that 'dmesg' gave some complaint about the USB device when our adapter was attached. (As you can tell, the exact events from several weeks ago are a bit foggy.) I think one of the connectors on the USBBT to MoBo adapter cable was reversed at one point, so the chip may have been damaged - but there was no confirming smoke or sparks.

I should pause here to point out that the bootloader had previously been successfully installed via the USBtiny. Pressing the reset on the MoBo caused the reset LED to give three short and one long blink. This proved the microcontroller was correctly wired and functioning - at least at some level. But we could not download through the USB channel.

Anyhow, a new USB board was assembled with the extensions for RepRap (adding +V, RTS#). This fresh adapter was correctly recognized by the Linux USB driver and so was deemed ready for the next C-Rap build session.

The next session gave us no joy, but we were able to prove that the USB interface adapter was indeed working properly - it was used to work with a commercial motor controller, and performed flawlessly. So why didn't it work with the RepRap board? Someone suggested downloading the bootloader again - just in case.... Well, we had a heck of time getting that to work (lots of timeouts) but it seemed to succeed in the end.

Last night's session we took it step-by-step and verified that the adapter pins were correct, etc., etc. We tried downloading the bootloader via the USBtiny since none of us were confident with the previous attempt, but we kept running into USB timeout errors. An alternative method (command line, not GUI) was used, and that worked like a champ. (Somesh - can you document exactly what you did?)

So, we made some progress. We knew the bootloader was properly installed, and that the microcontroller was still working. Yay. Back to the USB adapter.

Using an oscilloscope to monitor the RTS#, RXD and TXD lines on the mother board, we tried downloading the Menedl software. The only signal activity observed was one (or two) bytes on the RXD line when (I suppose) the host was trying to wake up the Sanguino. What should have happened was that the RTS# line should have strobed low, which would have triggered the reset on the bootloader. This line was always low (that's suspicious!), so there was never a reset pulse. After noodling over why this line was never high we thought to try a different USB adapter. We had on hand a FTDI adapter cable which was pin compatible with the MoBo header, and so connected that. This still did not work but the RTS# was always high!

It was getting toward the end of the session, and many people had already left, when Michael tried what Somesh had come across earlier (but did not work before): manually pressing the RESET button just before the compiler/downloader started the download stage.

Lo and behold, the red status LED on the MoBo began furiously blinking! A program was being downloaded! And then the download program read back the flash area! The program was verified!

Now, when powered up, our RepRap MoBo has a gently pulsing status LED. Michael tried the RepRap interface program even though we had nothing connected to the MoBo. There were some java exceptions (hey! software people - you're on deck!) but gcode commands were recognized.

The electrical team must figure out why the USBBT adapter did not work. My current hypothesis is that the internal EPROM has incompatible settings. Yes - the FT232RL does have programmable internals that can change the behavior on the various output pins. It is possible that the settings in the USBBT device differ from the default settings in the USB adapter module described on the Mendel site.

No comments:

Post a Comment

Followers