Page 1 of 1
Usb on Miac not connecting
Posted: Thu Feb 18, 2010 3:34 pm
by kdoney34711
I have programmed the miac with a usbhid which works in the simulator but I don't get any response on a real pc. I can use the miac usb port as a usb port for production, right?
Re: Usb on Miac not connecting
Posted: Thu Feb 18, 2010 4:11 pm
by Benj
Hello
Yes the Flowcode USB components should work fine on the MIAC. Please can you attach your program or send to me via a PM if it is private and I will look into this for you.
Re: Usb on Miac not connecting
Posted: Thu Feb 18, 2010 4:16 pm
by kdoney34711
The code compiles and links fine through flowcode and sourceboost's ide. I then program the chip and take it to another machine and plug it in expecting a new device message but nothing happens.
Re: Usb on Miac not connecting
Posted: Thu Feb 18, 2010 4:24 pm
by kdoney34711
Here's the flowcode.
Re: Usb on Miac not connecting
Posted: Thu Feb 18, 2010 5:21 pm
by Benj
Hello
Ok I have tried the Flowcode program here on a MIAC and it correctly compiled and the MIAC then appeared on the PC as a USB Human Interface Device.

- untitled.JPG (34.61 KiB) Viewed 6255 times
I then compared the C code from my copy of Flowcode with the C code file you sent to me and they were identical.
The MIAC will try to go into bootloader mode whenever it is plugged into a PC via USB and then powered on. If there is no driver present for the MIAC bootloader then the MIAC will sit and wait for the driver to be installed. Therefore your program will not be allowed to run. The USB LED will flash when the MIAC is in bootloader mode.
On the other hand if your first power up the MIAC and then connect the USB then your program will be allowed to run straight away.
My first comment about your program is that you do not call the DisplayStart component macro that allows the MIACs LCD to start up.
Second comment is that you cannot simply transmit the ASCII values to the USB to represent a keyboard keypress. Have a look at the HID keyboard example and you will see it has an array of data that is being manipulated to correspond with keyboard scan codes.
A complete list of these codes can be found here.
http://www.quadibloc.com/comp/scan.htm
Let me know how you get on.