PDA

View Full Version : New Mecanique USB HID maker



mister_e
- 19th June 2005, 10:05
Hi all,

For those who work with USB stuff and loose their hair, you should have a look to the new HID maker of Mecanique

and it's totally free
http://www.mecanique.co.uk/products/usb/easyhid.html

and i didn't see many little character at the bottom of the screen

Demon
- 19th June 2005, 20:45
I've looked around for new commands for PIC BASIC Pro and haven't seen any. I assume that this new feature is to help us with the 'initialization' routines associated with USB communication. It looks like the existing USBIN and USBOUT commands are still used for the I/O operations. I'm just wondering about USBINIT, that would logically be the part facilitated by this wizard.

Does that sound right?

(I haven't used any USB interfacing yet)

Robert
:)

Demon
- 19th June 2005, 21:04
I tried the Generator and got this as a sample PIC program:

USBService is not in the PIC BASIC Pro manual? I wonder how we're supposed to get this instruction? A patch to our compiler?

Robert
:)


DEFINE OSC 48
DEFINE LOADER_USED 1

USBBufferSizeMax con 8 ' maximum buffer size
USBBufferSizeTX con 8 ' input
USBBufferSizeRX con 8 ' output

' the USB buffer...
USBBuffer Var Byte[USBBufferSizeMax]
USBBufferCount Var Byte

' ************************************************** **********
' * main program loop - remember, you must keep the USB *
' * connection alive with a call to USBService every couple *
' * of milliseconds or so... *
' ************************************************** **********
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
gosub DoUSBOut
goto ProgramStart

' ************************************************** **********
' * receive data from the USB bus *
' ************************************************** **********
DoUSBIn:
USBBufferCount = USBBufferSizeRX ' RX buffer size
USBService ' keep connection alive
USBIn 1, USBBuffer, USBBufferCount, DoUSBIn ' read data, if available
return

' ************************************************** **********
' * wait for USB interface to attach *
' ************************************************** **********
DoUSBOut:
USBBufferCount = USBBufferSizeTX ' TX buffer size
USBService ' keep connection alive
USBOut 1, USBBuffer, USBBufferCount, DoUSBOut ' if bus available, transmit data
return

David Barker
- 19th June 2005, 22:51
> USBService is not in the PIC BASIC Pro manual? I wonder
> how we're supposed to get this instruction? A patch to
> our compiler?

USBService is available with the latest version of PBP (2.46)

Brian J Walsh
- 15th July 2005, 18:43
I have downloaded MPASM 4.01 as directed by MELabs.

When I try to program the PIC4550 from MCS+ I get three errors:

Error[173]c:\progra~1\mecani~1\easyhid\test\picbas~1\test.as m77: Source file path exceeds 62 characters (C:\PROGRAMFILES\MECANIQUE\EASYHID\TEST\PICBASICPR O\USBDESC.ASM)

The other two messages are the same but end in \DESCTEST.ASM and \USB18MEM.ASM

Ideas anyone?

I am using XP pro, PBP 2.46, MCS+ 2.1.08.

Bruce
- 15th July 2005, 19:17
MPASM chokes if the file path is too long. Just create a directory like say
C:\PBP\MYUSB and place your USB project files in there to get rid of this error.

Brian J Walsh
- 15th July 2005, 23:15
Thanks for your reply Bruce.

You have confirmed that the error messages were in fact meaningful and I now understand that a shorter path must be acheived to remain within the parameters of MPASM.

As to the suggested fix, you should remember that you are so far ahead of me in all of this that you are almost over the horizon! I can create a folder as you suggest and maybe even put the correct files into it but in doing so I would be stepping out of the cosseted realm of my IDE.

I want to write my code and then click the compile & program button achieving the result with no manual intervention.

The long path that is defeating MPASM comes from my slavish following of instructions. What I now need are some new instructions on how to modify my setup to automatically yield a path of acceptable length.

Thanks again & regards,

Brian.

Bruce
- 15th July 2005, 23:23
Hi Brian,

With EasyHID, on the 4th screen, just edit the location for all files to be deposited in.

I just loaded a complete ready to install software application on our website with all PBP/asm files. I've included the .hex file for folks that may not yet have PBP v2.46 so thay can experiment with it.
http://www.picbasic.co.uk/forum/showthread.php?t=2073

You do not need VB. The software is ready to install & run. Just wire up an 18F4550 as shown in the EasyHID schematic, and hookup a pot to RA0 to use it.