|
Forum Index : Microcontroller and PC projects : USB problems on a "new" board
| Author | Message | ||||
| raykj Newbie Joined: 06/03/2018 Location: United StatesPosts: 4 |
Hi all, I've been following along for a while and recently took the plunge. I'm amazed at all the hard work thats gone into this (coming from a 70s hard-core TRS-80 owner). But, as usual, I made it hard on myself and attempted to get Micromite Extreme running on a Microchip Explorer 16/32 board outfitted with PIC32MZ2048EFH100 -I/PT PIM module. I'm really excited that the system needs minimal external components (!). Amazing. Hopes are/were high because the Explorer 16/32 board (almost) tries to let you do whatever you want with the ports. I took the time to de-jumper any port that could affect or conflict with the software and am now pleased to see the Micromite Extreme software running with console, PS2 kbd, VGA and SD interfaces (with some jumpers to VGA break-out and SD socket). Happy to share all the config adjustments for anyone who is interested. One quick note for others: The Microchip PIM module does not appear to connect one of the console lines (the PIC32 Uart Rx) between the PIM pin and the chip, despite its schematic (on two PIM modules attempted). A jumper fixed that. After a couple of weeks, I'm still waiting for a call back from Microchip tech support (!). But having trouble with USB Keyboard feature. Btw, I did set the option to US. At first, I thought that I'd just plug in a Keyboard to the USB-A socket (PIC32 would then be a host) but then noticed mention in the Micromite Plus manual that this is supposed to hook up to a PC host running CDC (and therefore PIC32 would be a client). Making PIC32 a client means having to be careful about power. Up until then, I've been using the 9v barrel connector but switched to using USB power. On Explorer 16/32 board, this is possible using the USB-C connector, so got a USB-A (PC side) to USB-C (Explorer 16/32 side) cable. The board powers up fine and all the above functions work. But the PC doesn't even try to enumerate the device. I'm not a wizard with USB, but does the host detect USB devices by pull up/pull downs on the D+ and D- lines? This board doesnt seem to have these, but I was theorizing that such would be inside the PIC owing to the need to remove them in the response cycle. The Microchip Explorer 16/32 board pretty much direct wires the D+ and D- lines to the USB-C (and, in parallel the unconnected USB-A) connector. There is a jumper on the PIM module but its set to USB (not CAN) and I have confirmed connectivity between the USB cable and the PIM board (and even the chip). Any ideas what to try next? On my list: Try to figure out how to run one of the Microchip examples (not yet a wiz at Pic32 and the tools). I have compiled the Extreme software and can hit breakpoints in the code (did this while debugging the VGA that didnt work until I realized there is a command to turn it on!). But the USB stuff is a little complicated and not sure where is a good place to look. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10570 |
Make sure VBUS pin is connected to 5V and USBID pin is grounded. Then check if there is a pin you need to control to output 5V on the USB to power the keyboard |
||||
| isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
I guess you have probably seen it already, - there is more info on the usb jumpers etc buried in here, worth checking through |
||||
| raykj Newbie Joined: 06/03/2018 Location: United StatesPosts: 4 |
Thanks for the reply.. So USB keyboard is attached to the PIC32 therefore PIC32 is acting as a host and providing power to the keyboard? Thats what I originally assumed (it didnt work either) but then got confused by the Micromite Plus manual (Extreme manual only has differences). "MMBasic uses the USB CDC protocol which allows the USB interface to be used as the console with a host computer running a terminal emulator such as Tera Term." This implies host compute is the host and PIC32 is the client. (?) PIC32 would not be supplying power to the host computer... Also, repeated with more detail later in the Plus manual: "Just plug the USB cable from the Micromite Plus into your host computer and MMBasic will automatically create a virtual serial portover USB so that you can communicate with it from a Windows, Linux or Macintosh computer using nothing more than the USB port. Note that the CPU speed must be 20MHz or more. The communications protocol used is the CDC (Communication Device Class) protocol and there is native support for this in Windows 10, Linux (the cdc-acm driver) and Apple OS/X. Macintosh users can refer to the document "Using Serial Over USB on the Macintosh" on http://geoffg.net/maximite.html. If you are using Windows you will need to install the Windows Serial Port Driver (available from http://geoffg.net/maximite.html)." |
||||
| isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
AFAIK the pic32MZ won't act as a client and host at the same time, I guess plugging the USB keyboard in puts it into host mode and then the Micromite software won't act as a client for the PC CDC connection. Try without the USB keyboard connected (?) edit - I think the intent is, to either use a PC as a terminal, or plug in a usb keyboard and then use it with the lcd, without needing a PC. (nifty+) |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10570 |
The latest releases of MMX firmware don't support USB CDC at all. They only support USB HID host - keyboard |
||||
| raykj Newbie Joined: 06/03/2018 Location: United StatesPosts: 4 |
Thank You Matherp (Peter), will try the USB keyboard again. That's actually the preferred use anyway. Is it a known working mode? Dunno why it didnt detect previously though. There is nothing in the circuit. On Explorer 16/32, D+ and D- go direct from the connector to the PIC32 pins (with proper jumper on PIM module). I did check +5v on the cable (with another cable). 5v goes thru a fuse out to the connector. Gnd is Gnd. Thanks also, Chronic (Stuart). Most of the other jumpers are no-ops in host mode, they applied to the fancy USB-C connector. There is one other pair of jumpers that can disconnect part of the D+ D- bus beyond the PIM to help with USB 2 speeds. So I did disconnect that. Reference: http://ww1.microchip.com/downloads/en/DeviceDoc/Explorer_16_32_Schematics_R6_3.pdf So, J25 is open. J26 is open. J33 is open. In the USB-C section, J22, J28 and J29 dont matter for host mode since the keyboard is connecting to the USB-A female connector (J32) and not acting like a device since that mode is not supported it appears. Its a pretty nice board otherwise, although a bit pricey. Most pins can be accessed from 0.1" female headers. They do run a few to that useless (?) LCD display without a jumper, so was considering removing it from the board. I think one of the VGA signals is toggling it like mad. I had to cut a few of their trace jumpers, I think, in order to get all the VGA sync pins tied together safely but that was easy enough and recoverable. Very nice project, thanks all. Technically, I dont need the USB interface but it bugs me that it doesnt work so have to figure it out... Plus USB keyboards are much more common these days except in my basement. -Ray |
||||
| isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
I forgot about the little on-board 16x2 LCD, I was thinking more of Peter's great direct-lcd screens/drivers. They would be a good option, and would save buying the expensive Microchip exp16/32 graphic lcd adapter + module :) Lots of interest there! The MMBasic VGA is a separate console option though, I think (?) |
||||
| raykj Newbie Joined: 06/03/2018 Location: United StatesPosts: 4 |
Here is the debug setup with ps2/vga breakout board and sd card socket. Upper left is bottom of the mmbasic editor in the monitor. Yes, had to enable vga in basic since the pins are conserved on initial startup. ![]() |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |