<table><tr><td></td><td>Newbie mistake from me... At least heaven's voice saved the day </td></tr></table>
<table><tr><td></td><td>Newbie mistake from me... At least heaven's voice saved the day </td></tr></table>
Last edited by mister_e; - 22nd February 2007 at 02:41.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
<img src="http://www.pbpgroup.com/files/zombie2.gif" align=middle> Heaven you think?
Goood..., then you won't notice when I come to collect your PBP soul.
<div style="background-color:#000000"; layer-background-color:#000000;></div>
DT
Many thanks!!! Got it working, now I'll proceed to port it for my purposes.
I've change the 2 lines and one thing more
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEM_OFF_1H & _IESO_OFF_1H
Curious,
That means the CPU is running at 24mhz.
Why not run at 48mhz, since it's available.
_CPUDIV_OSC1_PLL2_1L
<br>
DT
Sure it will!
Did you have...
DEFINE OSC 48
I use 48mhz CPU with USB without any problems.
<br>
DT
I can't make it NOT recognize the device when the OSC is 48 with 20mhz crystal.
Did you increase the size of the VUSB cap like mister_e suggested?
The way you have it now, the CPU is running at 24mhz. But, PBP thinks it 48mhz because of the DEFINE OSC 48. Any Time related statements will take twice as long.
If you are going to leave it at 24mhz? You should change to
DEFINE OSC 24
But I'd suggest trying 48 again.
<br>
DT
Yup I've changed the cap to 220nF
I've tried many configurations
20MHz Crystal
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L ;with OSC 48 ; NON-WORKING
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L ;with OSC 24 ; WORKING
4MHz Crystal
__CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L ; with OSC 48 ; NON-WORKING ;Original post
__CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L ; with OSC 24 ; WORKING
I've seeking all the day to find the solution, I thus don't find it now I would continue to use it under 24MHz
But now I am occupied to migrate the code from VB6 towards VB.NET 2005 but I have a problem. I suppose that the post here is not welcome ?
unless you have a faulty PIC, a faulty OSC , or your Vusb cap it too low (or bad), it have to work AS IS.
Windows XP or Vista?
Connected on a USB HUB or not?
For the code conversion i can't help, i still use VB6. Start a new thread, maybe some could give you some tips.
Last edited by mister_e; - 24th February 2007 at 16:45.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi mr_e,
I'm learning how to use Easy HID, and have a question about the PBP output files.
If I copy the files into the same folder as as your demo files (using same names etc) and then run, the push buttons don't have an effect and the 2 var POTS don't work, LEDS and PWM are ok.
After doing a compare with your original files and the easy HID output the difference is in the DESCUSBDemo.asm file.
There are two lines that perhaps you have manually modified?? They are in the **** INPUT OUTPUT REPORT ***** sections, specifically:
Why have you have changed the value from EasyHIDs default of 40 to 8?Code:; report count (number of fields) retlw 0x95 retlw 0x08
Once changing the value from 40 to 8 my EasyHID files work with your VB program.
Cheers
Squib
Great job Steve! I have your program running great on a MELABS LABXUSB board, I just took out your asm section for the config fuses (I'm running a 20 MHz crystal,) since my .inc file was already set up for 20 MHz, and changed portb to portd. The LABXUSB board has some leds on portd already. Works great! Thanks for getting us started with USB.
Jerry.
Last edited by mister_e; - 1st March 2007 at 19:22.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
HI Mr_e
Yep using the 18F4550.
Thats a strange one, because without changing those two lines, It just doesnt work.... which kind of makes me think that easyHID isn't really that "easy" (If you have to make modifications)
I'll have to play with it some more, but to be honest I'm not into VB programming so HID isn't on of my top list of projects....would be nice to know a bit about it to help others one day.
Squib
This message will now be rendered useless. I wanted to delete it, but since I can't, I've put this stupid line here.
Last edited by SterlingY; - 14th March 2007 at 02:20.
Hi,
Having a problem with the MCHID.DLL.
My HID device works well on my development PC - but when I plug it into another PC (both running XP), windows automatically assigns it's own HID.DLL, and thus the device doesnt work. (It appears in devicemanager correctly)
How do I force XP to use the MCHID.DLL when there are no .inf files to use?
Cheers
Squib.
I've always MCHID.DLL in the same dir as the executable :-) that helps
Yeah but... let me clarify,
I've made a USB HID device (rudder pedals for my flight sim to replace my old gameport rudder pedals) and used Easy HID to make the necessary files.
When I plug it into the my Development PC with PBP etc installed, windows detects and it installs them perfectly! The pedals shows up in the game controllers list automatically and I can use them properly, ie calibrate them.
But when I plug the pedals into my Gaming PC, windows detects them and intalls a driver for it (show up in the system device list), but it doesn't show up in the game controllers list, thus I can't use the peddals.
I've tried other pc and the same happens.
I'm not creating any application to go with these pedals, I just want to plug them into any pc and have it work.
I'm not sure if it is a driver issue, or just a blonde moment. LOL.
Cheers
mister e,
Great stuff. A lot of good things to learn in your example.
So I've decided to make my own version, but I have run into a hurdle with EasyHID. Has anyone had trouble installing it? I need to mcHID.dll, but I can't install the software on my XP64 machine. The setup.exe program just seems to hang, without ever bringing up the install screen. And on my win2K machine, I get an error that it can't create the mcHID in the winnt/system32 folder.
Any thoughts?
-Sterling
Last edited by SterlingY; - 15th March 2007 at 04:09.
I was able to just put the mcHID.dll in the Visual Basic project folder where my project files are located. That solved working with VB, but I still don't have the easyHID program at my disposal. Maybe I will just have to slug it out by hand.
-Sterling
OK, got it sussed!
The problem was in my report descriptor section..... originally, I had setup up a "joystick" descriptor, which worked, but then later I changed the descriptor to a "simulator control".
The confusing thing was that windows was happy to use this new descriptor, and I figure the HID PID/VID sections in the registery never got updated (ie windows still recognised the pedals as a joystick).
When I plugged them into another PC for the first time, windows installed the pedals as a simulator control and that is why they didn't show up into the game devices list.
After changing the report descriptor scetion back to a joystick - all is working!
I guess the moral of the story here is that if you use the same VID/PID for different USB applications your USB device may not install properly.
I found that just removing the usb device from the device manager isn't enough, as you may need to delete all keys in the registry that ref. the paticular PID/VID device.
Clear as #*$#@!! mud?
As for installing EasyHID - I haven't had any problems installing (XP Pro 32). I don't suppose you can set compatabillity to XP(32) for the setup file?
Cheers Squib
Of course I took your excellent example and tore it all apart to modify it into something completely useless to me.
I'm not getting data from USBbufferin on the device. I am kind of curious about a line in the VB side:
"hidWriteEx VendorID, ProductID, BufferOut(0) ' send it"
Doesn't that just send the first element of the array? On the device I am trying to read USBbufferin[2] but get nothing. I should point out that my version has this as a normal BYTE, not the LSB of another number or whatever you had.
-Sterling
Last edited by SterlingY; - 16th March 2007 at 02:33.
More info:
In the VB code, if I put the following line "BufferOut(2) = 145" in the WriteSomeData() function, I get "0" when reading on the device, however, If I put that same line in the Form_Load() function, it sends the data, so I think the Form is constantly reloading. How can this be?
-Sterling
I seem to be talking to myself here, but that's okay.
I just wanted to say that I got it working. I don't know how. But, I ran the original USBDEMO.exe, and then everything started working with my modified version.
Crazy, I know!
-Sterling
Here I go again:
The problem was that VB buffer(1) comes into the device as buffer[2]
Thanks for the inspiration Steve. My upgrade is complete, PBP2.47,EasyPic 4, PicFlash 7.03, a new laptop to stuff it all in and some 18f4550 samples.
Thanks to Uncle Sam for a quick tax return also.
Had some trouble with the USB stuff at first but this post solved my problems.
http://www.picbasic.co.uk/forum/show...4&postcount=32
Not sure what to do with the $20 I got left. Dinner at Denny's with my wife maybe?
Then again I could use another USB cable...
Thanks again Steve.
Dear all
I am a newbie who's tying to do his first steps with UBS programming under PIC. My environment is PBP 2.47, Microcode Studio 3.0.0.0 and MPASM 5.03.
I am using microsontroller PIC 18F2450.
The issue is: when trying to compile and assemble the source file USBDemo.PBP from Steeve I get the following error messages:
ERROR: Macro USBINIT? not found in macro file.
ERROR: Macro USBSERVICE? not found in macro file.
ERROR: Macro USBIN?CBBL not found in macro file.
ERROR: Macro USBOUT?CBBL not found in macro file.
I did make any change to the original files as posted on this forum.
Could any one be of help to me?
My file locations are as follows:
MPASM D:\Program Files\PBP\MPASM
PBP D:\Program Files\PBP
When loading the USBDemo.HEX file in my microcontroller (18F4450 and 18F2450) it works fine with the PC application from Steeve.
In advance many thanks for your help.
As far as I know, PBP doesn't support USB on the 2450/4450. Yes, those chips are USB chips. Yes, PBP does support those chips, just not using the USB, at the website doesn't specifically say it supports them that way. The only chips I see that PBP directly supports with USB are the PIC18F2455, 2550, 4455, and 4550, and the 16C745, 765.
Hi, This really is a nice post, I am going to work with it, i will have to use 18f2550 since it is the available part around here.
1. Any problem with it being the 2550? someone said "Thank god you didnīt choose the 2550" before.
2. I guess i`ve read the answer to this but...: Usb Communications require somehow a "master"(host) and a "slave"? if this is so, i would never be able to communicate two pics through USB would I?, where i am going is that i intend to control USB devices but this could never be done if this is true, has anyone figured something without buyign those ugly USB HOST controllers? they really are a pain in the a.. you canīt find them at all(not here).
I have a uC develpment to control by serial (rS232) port some GSM phones, but the newer models dont support serial but USB, what should be done to transfer data between a uc and them?
It seems to me like an step backwards the fact that usb had lost the simplicity of RS232 communications in this matter.
thanks for the hobby time again
Last edited by Josuetas; - 5th April 2007 at 15:01.
1. There's no real problem with the 2550. It was just an inside between me and Malc about a previous thread on some behaviour to program this specific PIC with his PIC programmer. not much. Don't worry.
2. You can't use a PIC to PIC USB comm unless you really want to waste your time to develop a host controller... not something i would do. Hence why there's a few available on the market.
USB is not as simple as RS232 of course, it's another and really different animal.
Good luck!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I lately bought the book of Jan Axelson and this realy helped me. Here the link of Amazon
USB Complete: Everything You Need to Develop Custom USB Peripherals
Good Luck ;-)
Hi skimask.
First, many thanks for your help.
Second, I know from Melabs, that they support 2450/4450 in the USB modes.
My issue again is: I was not trying to use any other PIC, but 4550. I am not that far in the process. What I was trying to do is just to compile the USBDemo.PBP for the 4550 in my environment.
And this doesn't compile because of some missing macros.
Any suggestion?
Thx
Last edited by Momboz; - 5th April 2007 at 17:03.
shouldn't be a problem IF ALL files i've provided are located in the same folder unless i miss something obvious.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ok, so there are plenty USB host controllers, any to recommend? it would be great if it is NOT surface mountable,
Thanks
Many thanks Steeve
I have copied all the files in the folder where I have PBP 2.47 installed and I tried to compile again. The errors are the same.
I have been surprised by the way you did programm your application (the PIC configuration is written in assembler and is in your source code. Why not) and it's the only example that does recognize the USB interface when plugged in. The other examples from Melabs (UBMouse, UBSJadem and USBCDC) do not recognize when plugged in but they compile without errors.
I am not asking what is the best :-)
I will still investigate the issue and try to find out what's wrong with my configuration. I am very very patient and I have plenty of time to spend on the subject. This is just as a hobby. No boss is expecting any results from me in this case.
Thanks again for your help.
Dear Steve
I would like to give you feedback on 3 points:
1st, there is a typing error in your example USBDemo.pbp source file. Line 39 in your file should say "_FCMEM_OFF_1H" and not "_FCMEN_OFF_1H", i.e. the letter N should read M.
2nd, your example compile perfectly if it located in the USB18 folder (or if you copy the UBS18 folder files in yours).
3nd, you are redefining the PIC CONFIG register and this is also done in the so called INC file from Melabs for that PIC. This generates errors and the user has to choose where to configure these registers to avoid duplication of definition.
I take this opportunity to thank you very much for the example first and then for your kind help.
Bye
Bookmarks