Usb on Miac not connecting
-
- Posts: 25
- Joined: Tue Sep 29, 2009 1:07 pm
- Has thanked: 1 time
- Contact:
Usb on Miac not connecting
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?
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 25
- Joined: Tue Sep 29, 2009 1:07 pm
- Has thanked: 1 time
- Contact:
Re: Usb on Miac not connecting
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
-
- Posts: 25
- Joined: Tue Sep 29, 2009 1:07 pm
- Has thanked: 1 time
- Contact:
Re: Usb on Miac not connecting
Here's the flowcode.
- Attachments
-
- usbhid.fcf
- (10.5 KiB) Downloaded 406 times
- 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
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.
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.
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel