Serial debugging is as simple as connecting a USB-Serial (TTL) device to the COM1 serial pins on your Panda, and jumpering MODE.
you can’t just mod a USB cable for this, you need a TTL to USB serial adapter. Modding a cable is all about USB host on the single USB port on the USBizi100 devices.
Alternatively, you can use an RS-232 to TTL level converter, such as Arduino RS232 to TTL Converter with DB9 (MAX202) - DFRobot (cheaper can be found) and connect to your PC’s COM port, if you have one, using a serial cable. I’ve used both Brett’s recommended method and the RS-232 method with great success. The converter is important, as the Panda runs 0V-5V and RS-232 out of your PC runs -12V to 12V.
Incidentally, I am currently using a TTL to convert to RS-232 and then using a dongle to convert the RS-232 to virtual com over USB. Why? Because I have COM1 all wired up for RS-232 on the Panda II, but no available COM ports on this new dev machine.
Also, just out of curiosity, I could ditch the Serial idea and use a USB cable into COM1 correct ? Also, then could I debug over COM1 and then use the Micro USB port to act as a mass storage device?
Ok, so this is what I did. I only had a Serial to UART converter, so from COM1 I ran it into the UART-Serial then the serial line into my RS232-USB converter (since I dont have a RS232 port on my computer.
I have the Mod pin jumped to ground. But I am not getting a response from the device?
You should start by this, keep on using USB for debugging like you always do. Add your TTL to USB converter to COM1 and then open COM1 on code and send data. Make sure this data is actually sent. A terminal software is what you need, like teraterm.
Once that is working and you can send and receive data from terminal, now connect MOD low and try to deploy from serial.
That sounds good, except I don’t have a TTL to USB, just Uart to Serial and Serial to USB.
Is there a way to deploy Mass storage code, then restart the device to boot into mass storage mode? I was reading/following this threads advice, but no luck. http://www.tinyclr.com/forum/topic?id=6935
You may be able to use the UART to Serial and Serial to USB together. See my picture in the post above. I have a UART to Serial converter on the stackable shield connected to the Panda, then a Serial To USB converter (the blue plug) going to a USB cable extender and back to the PC USB port.
As for mass storage, I agree with Gus. Get the debugging over COM1 working first, it will make your coding so much easier in the long run. Don’t give up, you are actually quite close to your goal.
Ok, So I think I have everything setup correct. I am debugging over USB and trying to send data out of the COM1. I followed the UART-PC tutorial using the below code, and I am not seeing anything in my TeraTerm connection. The code bulds successfully, however when I debug, at the end of the output window I see Error: a3000000
using System.Threading;
using System.IO.Ports;
using System.Text;
namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
SerialPort UART = new SerialPort("COM1", 115200);
int counter=0;
UART.Open();
while (true)
{
// create a string
string counter_string = "Count: " + counter.ToString() +
"\r\n";
// convert the string to bytes
byte[] buffer = Encoding.UTF8.GetBytes(counter_string);
// send the bytes on the serial port
UART.Write(buffer, 0, buffer.Length);
// increment the counter;
counter++;
//wait...
Thread.Sleep(100);
}
}
}
}
It is not important that it is the most up to date but it is important to be a match between what you have on your PC and what is on the device. Our free beginner guide ebook details this.