Usb on Miac not connecting

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
kdoney34711
Posts: 25
Joined: Tue Sep 29, 2009 1:07 pm
Has thanked: 1 time
Contact:

Usb on Miac not connecting

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Usb on Miac not connecting

Post 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.

kdoney34711
Posts: 25
Joined: Tue Sep 29, 2009 1:07 pm
Has thanked: 1 time
Contact:

Re: Usb on Miac not connecting

Post 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.
Attachments
usbhid.c
(22.92 KiB) Downloaded 404 times

kdoney34711
Posts: 25
Joined: Tue Sep 29, 2009 1:07 pm
Has thanked: 1 time
Contact:

Re: Usb on Miac not connecting

Post by kdoney34711 »

Here's the flowcode.
Attachments
usbhid.fcf
(10.5 KiB) Downloaded 406 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Usb on Miac not connecting

Post 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
untitled.JPG (34.61 KiB) Viewed 5907 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.

Post Reply