Has anybody worked with these PICs:
18F2455, 18F4455, 18F2550, 18F4550
and EaysHID yet?
Do you have any experience (or code) to share?
I have received my ICD2 today and started playing with a 18F4550.
(PICSTART+ doesn't suport the 18F4550!)
Has anybody worked with these PICs:
18F2455, 18F4455, 18F2550, 18F4550
and EaysHID yet?
Do you have any experience (or code) to share?
I have received my ICD2 today and started playing with a 18F4550.
(PICSTART+ doesn't suport the 18F4550!)
Last edited by NavMicroSystems; - 29th June 2005 at 16:18.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
I've used it, and if you're looking to get started with USB, then Dave's new
EasyHID & the PIC18F4550 are definitely the way to go.
Download & install EasyHID.
http://www.mecanique.co.uk/products/usb/easyhid.html
I have several projects for USB coming shortly, but in the mean time, I've
loaded the files for a complete USB project on our website.
The zip file contains PBP source code for a PIC18F4550, and VB source for a
USB analog data-logger. Should be fun for anyone interested in tinkering with
EasyHID and the new full-speed 18F USB parts.
Here are the files: http://www.rentron.com/mcstudio/EasyHIDPrj.zip
You'll need VB6 & SoftWire. You can download SoftWire from here. It's free.
http://www.softwire.com/swdownload/softwiredownload.htm
I used the activx controls in SoftWire for the analog meter interface. Really
nice stuff.
You'll also need PBP version 2.46 since this is the version offering support for
the newer 18F USB parts.
If anyone's looking for an excellent book on USB, then grab a copy of Jan
Axelson's new 3rd edition of USB Complete. We just got them in. I spent the
last few days reading mine, and it's awesome.
Jan has done an outstanding job on her 3rd edition of this book. Even "I" can
understand it now...;o]
I'm also in the middle of trying to use EasyHID. I'm just not sure where the USB18.ASM file fits in the grand scheme of things.
I used the PIC18F4550, PBP and VB. The file is in the project PBP folder.
I also got USB Complete as well as USB Design By Example. It's too bad they chose to use EZ-USB chips from Cypress or else I could have used their examples directly. Unfortunately I don't know enough about MPASM Assembler, let alone Cypress' version to convert things around.
Robert
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Is it complicated to get the generated code to be compatible with the slower USB speed? I'd like to be able to connect to PCs that do not yet have USB 2.0.
Robert
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bruce,
I get a LOT more files generated on the PIC side?
It's that large Assembler file with all the VERY important USB routines that I don't know where that fits in. It doesn't seem to be linked with the PBP base program at all, or I missed something?
Robert
?
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bruce,
Don't forget to add a README that mentions mcHID.dll and where the user can get it. Your PC-side code won't work without it.
Robert
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Hi Robert,
You should have 8 (PBP) files total generated by EasyHID. All this stuff is required, and included when you compile for the 18F USB part.
Look in your PBP\USB18 directory for USB.TXT. This explains what most of
the files are.
Sorry. These files are no longer available since the support applications you would need to install to use them have been discontinued.
Mecanique dropped the free version of EasyHID, and the VB6 version of Softwire is no longer available. Without these two applications, the .zip file would be useless.
See Mr E's USB example here: http://www.picbasic.co.uk/forum/showthread.php?t=5418
problem now will be the .dll. Not sure if we are allowed to distribute it
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
So basically now it's part of microcode studio right?
This confused me too for a bit till i saw it in Microcode studio's "view" menu.
I've just started on this, having been encouraged by EasyHID.
I noticed that the interrupt check box is disabled if PBP is the device code genrator selected. Does this mean that PBP programs have to jump to service the USB every 10ms? That's surely not very practical.
Do ME Labs have a fix in the pipeline for this or do I feel an upgrade to my neglected Proton+ coming on?
I can't see me investing the time in making USB work with PBP if the USB connection cannot be maintained in the background.
Any advice greatly welcomed.
Brian Walsh
Glasgow
Scotland
I haven't started on the USB aspect yet, but offhand I would say that's the function of the "USBservice" command.
An easy way to manage this? I have absolutely no idea yet.
Robert
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Please somebody shoot me if i'm wrong, didn't find time to play enough with USB, BUT none of both compiler will do the refresh for you.. sorry. Timer interrupt one of the way to go or keep track of your code and sprinkle few USBSERVICE. No big deal
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Originally Posted by NavMicroSystems
You have try this circuit from this project
http://www.sixca.com/eng/articles/usbdaq.php
Hi,
I've built the simple piece of hardware using the 18F2550, it has been programmed as per the files generated by the EasyHID application.
Having plugged the hardware into the USB port, it states the device is not recognised. I was expecting it to come up with the device name as i stated in the EasyHID compilation.
I was expecting a .ini file or similar to be generated for the installation of the device.
Can anyone help why this might be.
Many thanks.
OK, seem to have that issue sorted now, it actually was something to do with the programming fuses.
Although it now connects OK, when i look at the device manager, it only shows up as a 'USB Human Interface Device' and HID-Compliant Device' and not as i set in the EasyHID maker.
Also, can anyone help with what is required at the VB and PIC end to light a simple LED. ie when i click a 'button' in the VB code, it turns an LED on one of the ports, ie PORTB.1.
Many thanks,
Steve
Can anybody help with the above request or point me in a direction of who / where might?
Many thanks,
Steve
Hi Steve,
If you have the PIC being recognized as an HID device, try this. It's real simple, but will allow you to control an LED from VB6 (should also work with VB5) but I don't have that to test it with.
Create your VB code with EasyHID. Open the project, and drop two command buttons on your form. Add this code for your buttons --
Private Sub Command1_Click()
BufferOut(8) = 0 ' LED on
hidWriteEx VendorID, ProductID, BufferOut(0)
End Sub
Private Sub Command2_Click()
BufferOut(8) = 1 ' LED off
hidWriteEx VendorID, ProductID, BufferOut(0)
End Sub
Modify the PBP code created by EasyHID something like this --
PORTB = 0
TRISB = 0
usbinit ' initialise USB...
ProgramStart:
gosub DoUSBIn
PORTB = USBBuffer[7]
goto ProgramStart
Note this doesn't send data, it's just a sit & spin simple app reading USB input, and placing the value received in USBBuffer(7) on RB.
Hi everybody,
I am new in this forum. I use PBP compiler and VB6 for my application.
The problem are:
. When I used USBOUT to send the data via EndPoint #1 from PIC to PC, I can send only
the spead upto 64kbit/s (I use oscilloscope to measure the time of sending
one packet from PIC to PC, an the time is about 8ms for 64 Bytes).
. If I use EndPoint #3 (virtual COM port), I can send data upto 115200 bit/s but it still
so slow for my application because I need to send data about 10 Byte at 100 ksample/s
My question is:
How can I used PBP to send the data in hight speed mode or full speed
mode? Normally, I used EasyHID from MicrocodeStudio to generate the
template for PBP and VB.
Hope to hear from you all soon.
Last edited by lengcallrobot; - 14th July 2008 at 21:12.
Hi Lengcallrobot and welcome to the forums!
This is taken from the EasyHID help file contained in the EasyHID folder:
"What is a HID Device?
...... One of the major advantages of HID is that you do not need to supply a custom driver, as one is already supplied with the operating system. A limitation of HID is that its data transfer rate is limited to a maximum of 64KB per second. However, this is still significantly faster than RS-232 (115200 baud is approximately 12KB per second)......"
You should be able to send 64kBytes/sec in Full-speed mode as shown above.
It looks to me as though you are sending data in Low-speed mode 64kbits/sec (or 8kBytes/sec) from what you have shown.
Are you using a 48MHz clock source for the USB and have you set bit 2 of the UCFG register to enable Full-speed?
I could be leading you up the garden path about the speeds but this is my understanding
Hope this helps
Rob
Last edited by Rob; - 15th July 2008 at 09:09. Reason: Really should proof read before posting!
Thank Rob, however, I cannot set UCFG.2=1 or FSEN=1 in my program. When I do this, I get error message . the below is my source code in pbp
================================================== =================
DEFINE OSC 48
DEFINE LOADER_USED 1
USBBufferSizeMax con 64 ' maximum buffer size
USBBufferSizeTX con 64
USBBufferSizeRX con 64
' the USB buffer...
USBBuffer Var Byte[USBBufferSizeMax]
USBBufferCount Var Byte
'Variables -----------------
I var byte
Ana var word
' Define ports
SP1 VAR PORTC.0
' ************************************************** **********
' * main program loop - remember, you must keep the USB *
' * connection alive with a call to USBService every couple *
' * of milliseconds or so... *
' ************************************************** **********
TRISD = %11110000 'Set PORTD 0-3 to output, 4-7 to input
'UCFG.2 = 1
usbinit ' initialise USB...
ProgramStart: 'Just want to test the USB speed
high sp1
gosub DoUSBIn
low sp1
gosub DoUSBOut
goto ProgramStart
' ************************************************** **********
' * receive data from the USB bus *
' ************************************************** **********
DoUSBIn:
USBBufferCount = USBBufferSizeRX ' RX buffer size
USBService ' keep connection alive (executed at least every 10ms)
USBIn 1, USBBuffer, USBBufferCount, DoNext ' read data, if available
PORTD = usbbuffer[2]
Ana = (usbbuffer[0] << 7) | usbbuffer[1]
freqout sp1,500,ana
DoNext:
return
' ************************************************** **********
' * wait for USB interface to attach *
' ************************************************** **********
DoUSBOut:
USBBufferCount = USBBufferSizeTX ' TX buffer size
USBService ' keep connection alive (executed at least every 10ms)
USBOut 1, USBBuffer, USBBufferCount, DoUSBOut ' if bus available, transmit data
return
================================================== =================
Do you know other way to get Full-Speed mode with pbp ?
Thank you in advance.
I want to use EasyHID, so purchased Microcode Studio about one week ago. Since then, Mecanique has not responded to two emails, I cannot find where to download EasyHID, and am at a loss. Have since sent a complaint to WorldPay and have requested a refund... just in case.
Where can one get hold of a copy of EasyHID? Or, are there other solutions out there, so I don't have to beg for the software from some vendor?
Is Mecanique going out of business? Why doesn't anybody respond?
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
EASY ....
Down boy, down ... That's better.
David is a busy man.
With MicroCode Studio, the PROTON IDE, Swordfish Basic, and others, the poor guys got his hands full.
Please don't report him to Internet squeelers.
Be nice, ask real questions ... he'll get back to you.
<br>
DT
Thanks again Darrel. Okay, I can understand that situation very well, since I tend to be a one-man band. However, it seems like with that much going on, he'd hire a spare geek or two to handle the front end.
Getting back to the subject....
I am building a proof-of-concept prototype (aren't we all!!) that will sit between the keyboard and host. When the end-user types in a certain character string or key combination, the microcontroller will send a control signal to another receiving device to start and stop a motor. Should I make this a keyboard HID, a generic device HID, or none at all and somehow pull information off the wire?
Regards,
Kirt
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Robert,
Thank you.
I'm using an 18F2550, since it's only 28 pins. Yes, I understand that it cannot be a USB host, which is why I am at a loss. What I am doing right now with somewhat positive results is programming for a keyboard device, then plugging the straight-wiring the keyboard to the host, then pulling power and data taps to the PIC. All is recognizing fine, except am working on finding the right host driver for this funky keyboard.
Going to catch a train to Akihabara in a few minutes to pickup a generic USB keyboard and some other stuff.
I should mention that EasyHID comes with MicroCode Studio.
It's located in the "C:\Program Files\Mecanique\MCSP\EasyHID" folder. (assuming default installation).
In that folder, there is a file EasyHID.chm.
Should answer most of your questions.
DT
Right. And after reading a bunch of posts on these forums (many by you) about it... I want it even more! Or, do I? I am thinking that things may work out with just a generic keyboard HID for the time being, but not sure.
Bookmarks