USB Pics, ICD2, pic basic pro


Closed Thread
Results 1 to 35 of 35
  1. #1
    Join Date
    Jan 2007
    Posts
    70

    Default USB Pics, ICD2, pic basic pro

    Hello everybody. I have some experience with pics, pic basic, etc. but I was hoping someone with much more experience could comment on some stuff... Answer some questions which, I have been googling and stuff, but it isnt becomming totally clear. My questions are pretty easy, I think, for someone else to just say yes\no to. Here we go!

    1. Does an ICD2 device program the USB Pic devices?(18f4550, etc)
    2. Can I use protoboards designed for other 40 pin pics (ec 18f425) for my USB experiments? Just gotta add those extra components?
    3. Does anyone know of protoboards that are specifically designed for the 18f4550? All I can find is boards with an FTDi rs232 chip, or boards just designed for general purpose 40-pin pics.

    Thanks alot everone! I am at work and trying to be productive while brainstorming, cant sit on google searching! I am a new user. Please bear with me!

    -R

  2. #2
    Join Date
    Jan 2007
    Posts
    70

    Default Answered one of my own...

    #1 Yes the USB pics seem to be in the ICD2 device list, which i finally found...

    Now onto figuring out if the 40 pin 18f4550 is compatible with my protoboard from dhmicro.com (40xli)

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Glad you answered #1, since I don't use ICD2.

    2. Can I use protoboards designed for other 40 pin pics (ec 18f425) for my USB experiments? Just gotta add those extra components?
    Hmmm, 18F425, not familiar with that one.
    But the 18F4550 has the same basic pinout as the 18F452. So anything that uses a 452 footprint will work for USB.
    Of course you need a USB connector.

    Here's one that I have several of...
    Prototyping/Experimental Kit W/MINI-USB
    http://cgi.ebay.com/Prototyping-Expe...QQcmdZViewItem

    Or, The B version...
    Prototyping/Experimental kit W/USB Type B Receptacle
    http://cgi.ebay.com/ws/eBayISAPI.dll..._promot_widget

    Or, The A version...
    Prototyping/Experimental Kit W/USB Type A Receptacle
    http://cgi.ebay.com/ws/eBayISAPI.dll..._promot_widget

    And for #3, well, anything for the 452 will work, it doesn't specifically need to be for a 4550. But here's a good one for the price.
    EasyPic 4
    http://www.picbasic.co.uk/forum/show...2&postcount=15
    DT

  4. #4
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Or, The B version...
    Prototyping/Experimental kit W/USB Type B Receptacle
    http://cgi.ebay.com/ws/eBayISAPI.dll..._promot_widget
    Here's an assembled Type B breadboard adapter for an excellent price.

  5. #5
    Join Date
    Jan 2007
    Posts
    70

    Default Further along, Still troubles

    Hey!

    Thanks. I actually just ordered some products from Winford. Fair enough prices on some stuff I need.

    So, I managed to get as far as 'unknown USB device' in win xp pro sp2 when using the microchip bootloader files. I found a compiled .hex for the 18f4550 on the forums here somewhere.

    When I specifiy the correct device driver, it refuses it, prefering to be unknown. Jerk.

    Any insights on this? I should note that Ive got a 10pf cap pulling pin 18(usbv) to ground, not the specified 470nf. 10pf is the smallest ive got!

    Thanks!

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    That capacitor is probably the culprit.

    It's there to stabilize the 3.3V Voltage Regulator for USB.

    10pf is way too small. 0.22uF is recommended, but I've used .1uF once only because I didn't have a bigger one handy at the moment.

    A larger capacitor will work fine, 1uF, 4.7uF whatever you have. It's just there for a filter.

    DT

  7. #7
    Join Date
    Jan 2007
    Posts
    70

    Default question

    as i am about to go grab a bigger cap to try, let me ask, why do the schematics show a 470nf cap here then? isnt that much smaller than .22uf?

    thanks!

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Code:
      .000000470000
         |  |  |  |
    mili-/  |  |  |
    micro---/  |  |
    nano-------/  |
    pico----------/
    470nf = .000000470 F = .47uF = 470,000 pF
    220nf = .000000220 F = .22uF

    .
    DT

  9. #9
    Join Date
    Jan 2007
    Posts
    70

    Default well

    I tried again with a 2.2uf. Sadly, no improvement. It continues to act the same on both available test systems. I am using a 20mhz ceramic resonator, is it possible this is a problem?

    the 20mhx resonator has worked fine for other projects and it also runs the blinky led test on the 18f4550...

    thanks! i really am not a lazy question asking *******... ive probably spent 20 hours on this in the last 4 days...

    -robert

    (p.s. i am trying to usb-ize some of my future projects, wanna see past stuff? the electronics are buried in the list. www.robertguyser.com)

  10. #10
    Join Date
    Jan 2007
    Posts
    70

    Default re: capacitor ratings

    oi!

    those stinking cap ratings and markings are madening!

    thanks for the 101!

    aaand, just in case someone who is also wanting to know about the icd2 and 18f4550 runs into this thread; they do work well together, not sure what debug features will work, but it programs the sucker.

  11. #11
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Quote Originally Posted by vacpress View Post
    I am using a 20mhz ceramic resonator, is it possible this is a problem?
    For 20mhz, what do your CONFIG's look like?

    Here's an example from Bruce.
    http://www.picbasic.co.uk/forum/show...85&postcount=4

    DT

  12. #12
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Quote Originally Posted by vacpress View Post
    wanna see past stuff? the electronics are buried in the list. www.robertguyser.com)
    Ha ha, that Vacuum Former you drew up, looks just like my old Vac-U-Form I had when I was a kid.
    Except it doesn't have a handle on the front to pull down the vacum. And it's a little bigger.

    Vac-U-Form by Mattel
    http://www.spookshows.com/toys/vacuform/vacuform.htm
    DT

  13. #13
    Join Date
    Jan 2007
    Posts
    70

    Default Current progress

    So. I am now attempting to use the code from Mister E's awesome looking USBDemo thread (http://www.picbasic.co.uk/forum/show...hlight=18f4550)

    I cannot get PBP code to compile through microcode studio, i get "Overwriting previous address contents (xxxx)" then it says 'too many errors quitting. I am using mpasm. Grrr

    In the meantime, I have loaded the included .hex file and unfortunately i still get the same results. It is, I suppose that is a good sign... Any idea what it means? I dont have enough experience to troubleshoot this stuff, hence the posts. I gather USB is asking what the device is, and it isnt able to tell it. I know there is also something about enumeration failure, but i do not think this is the same..

    ??

    continued thanks

  14. #14
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    mister_e's example was setup for a 4mhz crystal. You'd have to modify it for 20mhz.

    "Overwriting previous address contents (xxxx)" means that the CONFIG lines in the program are conflicting with the config lines in your 18F4550.inc file.

    Which means you still need to answer post #11
    DT

  15. #15
    Join Date
    Jan 2007
    Posts
    70

    Default

    Quote Originally Posted by Darrel Taylor View Post
    mister_e's example was setup for a 4mhz crystal. You'd have to modify it for 20mhz.

    "Overwriting previous address contents (xxxx)" means that the CONFIG lines in the program are conflicting with the config lines in your 18F4550.inc file.

    Which means you still need to answer post #11
    Ahh. I see. Ok. Well. I actually switched to a 4mhz resonator, just to confirm that it is 'near working', i tried it with the 20mhz one and the pc didnt recognize it, so at least the code seems to be attempting a usb connection. I have turned my suspicions on the cable. Ive got the colors right, but when I try to test them to the usb cable pins as they are listed at (http://www.usbman.com/Guides/BelkinM...e_assembly.htm) using a multimeter, they are all different. Interestingly, connecting the USB power lines into the power bus of my pic proto board powers it fine, i tried it with a non-usb led blinky and it powered it, so i still think the cable is OK...

    Grrr. First timing USB is hard!

    i will check the config conflict issues and see if i can get it to compile

  16. #16
    Join Date
    Jan 2007
    Posts
    70

    Default usb troubles continued

    The _Configs. I looked at them and wasnt exactly sure what to do.. it looks to me like i should change the .inc to match the .pbp? The setting are in fact different. I dont know exactly what they all mean, but I see that the PLL settings are different, as well as most of the others.

    Change the .inc to match?

    How do i put the code in abox like in other posts?


    from 18f4550.inc
    --------------------
    LIST
    LIST p = 18F4550, r = dec, w = -311, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    __CONFIG _CONFIG3H, _PBADEN_OFF_3H
    __CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 32

    from USBDemo.pbp
    -----------------------
    asm
    __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ; ; ; USB clock source comes from the 96 MHz PLL divided by 2
    ; ; [OSC1/OSC2 Src: /1][96 MHz PLL Src: /2]
    ; No prescale (4 MHz oscillator input drives PLL directly)


    __CONFIG _CONFIG1H, _FOSC_XTPLL_XT_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    ; ; ; Oscillator Switchover mode disabled
    ; ; Fail-Safe Clock Monitor disabled
    ; XT oscillator, PLL enabled, XT used by USB
    __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L
    __CONFIG _CONFIG2H, _WDT_OFF_2H
    __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
    endasm
    DEFINE OSC 48
    Attached Files Attached Files

  17. #17
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Thanks,

    The 18F4550.inc file was correctly setup for 20mhz. So it wasn't that.

    To get mister_e's program to compile... Comment out all the CONFIG lines in the 18F4550.inc file with a semicolon ";". This will let the CONFIG lines in the program take effect.

    Stick with the 4mhz osc. I know his program works, so that might help you work out the cable problem.



    How do i put the code in abox like in other posts?
    At the bottom of each page, there's a box that says Posting Rules (scroll down). In that box is a link ... vB code is On.

    That link explains all the post formatting commands. The one to put it in a box is [code]...[/code]

    HTH,
    DT

  18. #18
    Join Date
    Jan 2007
    Posts
    70

    Default

    many thanks... rewiring the thing and commenting out _configs... will assuredly be back!

    thanks for bearing with me... if you ever need solidworks tutoring...

  19. #19
    Join Date
    Jan 2007
    Posts
    70

    Default

    so, having commented out the .inc _configs, I now get far fewer errors, just 1, besides those irritating depreciation warnings... the error is..

    Error[113]: Symbol not previously defined (_FCMEN_OFF_1H)

  20. #20
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Oh yeah, seen that one before.

    For now, just change it to _FCMEM_OFF_1H

    If you upgrade MPLAB in the future, you'll need to change it back.
    Microchip changed it somewhere along the line.

    DT

  21. #21
    Join Date
    Jan 2007
    Posts
    70

    Default fabulous

    at any rate, it compiles without errors now, though i will not be surprised if it continues to refuse to work..

    a question, i am testing this stuff on 2 laptops. one has usb 2, the other dosent..the one without is an old junker that i am using to save my good laptop the risk, any idea if this could be a problem? i dont suspect so, as it acts the same on both.

    i will try the compiled hex..


    also, incidently, what is that config flag, and where do i read about them? in the pic basic manual, or in microchip language manual? i come to this stuff from basic stamps and basicX controllers... this is why the assembler pic stuff is foreign to me yet i am trying a fairly difficult task...

    when you tried this, did it go smoothly? what were your conditions?


    Thanks

  22. #22
    Join Date
    Jan 2007
    Posts
    70

    Default damn

    well, it continues to misbehave. i suppose i might make a schematic of what ive got hooked up, i am working on a prefabricated protoboard so i have to trust their datasheet for some information because traces are hard to .. uhh.. trace, under the components.

    what is a .COD?

  23. #23
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    At best, a PIC can do "Full Speed" USB. Which is compatible with USB 1.1.
    So the old laptop should be fine.
    also, incidently, what is that config flag, and where do i read about them?
    To find out what they do... look in section 25.1 of the datasheet. Under "Special Features of the CPU" / "Configuration Bits".

    To find out what to call them in your program, look at the bottom of the P18F4550.INC file in the same folder as MPASM.

    DT

  24. #24
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    when you tried this, did it go smoothly? what were your conditions?
    I started with mister_e's code. A pluggable Breadboard. And real USB cables.

    From start to first Yahoo! was about an hour and a half.
    Had an FCMEN error...
    Had a problem with the capacitor too...
    Then ... when I saw that little "Unrecognized" window, or actually, didn't see it. I was a very happy little Nerd.



    ... i come to this stuff from basic stamps and basicX controllers...
    DT

  25. #25
    Join Date
    Jan 2007
    Posts
    70

    Default yeah. stomp stamps.

    well. of course this example highlights the benefits of basic stamps. parallax would have put together coherant instructions. i am on like hour 15 of this now(not in a row, of course!). i have read so much about so many topics, and none has really helped, it still does the same thing it did 12 hours ago. very frustrating. unfortunately I cannot give up, combination of stubornness and having too much invested allready (time and money)

    i suppose the next step is to rebuild the entire circuit on breadboard, giving up on my easy to work with protoboard... i suppose i also need to find a 4 and 20mhz crystal...as opposed to these resonators that always have worked fine for me in the past..

    why is this so hard?

  26. #26
    Join Date
    Jan 2007
    Posts
    70

    Default USB Sniffer Results

    So, Ive used the UBB USB Sniffer to see what is going on.. This is the log it makes, any ideas?

    I see that it is getting back alot of 0s.. Just like when i try to verify a pic that isnt in the programmer socket... i will now scour the USB protocol so I can troubleshoot these foreign messages. Damn, this isnt how i like to spend my little spare devlopment time...

    Code:
    000000: PnP Event: Device Connected (UP), 19.01.2007 15:57:30.4977888
    The USB device has just been connected to the system.
    
    000001: PnP Event: Query ID (UP), 19.01.2007 15:57:30.4977888 +0.0
    Device ID: USB\Vid_0000&Pid_0000
    
    000002: PnP Event: Query Device Text (UP), 19.01.2007 15:57:30.4977888 +0.0
    Description: USB Device
    
    000003: PnP Event: Query Device Text (UP), 19.01.2007 15:57:30.4977888 +0.0
    Location: USB Device
    
    000004: PnP Event: Query ID (UP), 19.01.2007 15:57:30.4977888 +0.0
    Instance ID: 3
    
    000005: PnP Event: Query ID (UP), 19.01.2007 15:57:30.4977888 +0.0
    Hardware IDs: USB\UNKNOWN
    
    000006: PnP Event: Query ID (UP), 19.01.2007 15:57:30.4977888 +0.0
    Compatible IDs: USB\UNKNOWN
    this is what the logger reports when i set it to track the next device to be plugged in, and then plug in my project.

    anyone know of any GOOD walkthroughs for this stuff? I am very close to plunking down the $60 for the Microchip.com demo board.this troubles me because i am poor enough as it is, and that is like, half my food money for the next 2 weeks!

    -R
    Last edited by vacpress; - 19th January 2007 at 22:08.

  27. #27
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    > parallax would have put together coherant instructions

    Naaa, they just make you use an FTDI chip, so they don't have to deal with it.

    > ...i suppose i also need to find a 4 and 20mhz crystal...as opposed to these resonators...

    I'm running mine on a 4mhz resonator here. Works just fine.

    DT

  28. #28
    Join Date
    Jan 2007
    Posts
    70

    Default grrrr

    off to the other room with it. i have a whole electronics lab, and ive been working on this in my bedroom for some reason.. i will now go rebuild the entire stupid circuit from scratch testing each section, use different USB cables to cut down the chance one is sketchy, etc... what a pain in the ass...

    any other hints you may have? photos of your project? anything? suggestions?

    thanks.

  29. #29
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    If it will help...

    Click image to enlargeClick image to enlarge
    DT

  30. #30
    Join Date
    Jan 2007
    Posts
    70

    Default Hooray!

    I got it working! The stinking cable had the standard colors, red, black, green, white, but they were all odd configurations... black was NOT ground!

    anyways, now on to the hard stuff.... getting the easyHID code to work in visual basic .net!

    Thanks for all the help I am actually very grateful and dont take it for granted at all that you read pages of my inability to use check my USB cable!

    I build the circuit on breadboard with a different cable, it worked right away! i tried my other cable.. didnt work, rewired it, it worked, tried my protoboard with the correct wiring: BINGO! like 12 hours later!

    glad i went out for those 2 pints in between!

    a shame the easyUSB project has 2 run errors in .net


    any .net know how mr?

  31. #31
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Awesom!

    any (visual basic) .net know how
    Can't help you there, I'm a Delphi guy.

    Please hold for the next available operator......beep...
    DT

  32. #32
    Join Date
    Jan 2007
    Posts
    70

    Default cross platformness?

    one thing i am definiately interested in is cross platformness to linux and mac...

    any idea if the HID driver is available for mac or linux..


    heeelllo google.

  33. #33
    Join Date
    Feb 2003
    Posts
    432

    Default

    Quote Originally Posted by Darrel Taylor View Post
    If it will help...

    Click image to enlargeClick image to enlarge

    Oi! Darrel ....NO!!!!

    Hangs head in shame

    Dont show pictures of extremely neat breadboards. Where is the possibility of accidently shorting stuff out during development.

    Your looks almost like a PCB. The "defining connections" stage of routing a PCB is called a "ratsnest" for one good reason....so it can look like the breadboard that you prototyped on
    Keith

    www.diyha.co.uk
    www.kat5.tv

  34. #34
    Join Date
    Jan 2007
    Posts
    70

    Default

    Quote Originally Posted by keithdoxey View Post
    Oi! Darrel ....NO!!!!

    Hangs head in shame

    Dont show pictures of extremely neat breadboards. Where is the possibility of accidently shorting stuff out during development.

    Your looks almost like a PCB. The "defining connections" stage of routing a PCB is called a "ratsnest" for one good reason....so it can look like the breadboard that you prototyped on
    HA! I eventually used that as inspiration to do an extremely neat breadboarding myself, which worked first time...Imagine!

    Really though, the hard part is this software. There is quite alot going on! It is really much more than I am used to, i thought my neworked BS2s had complex code....

    Thanks guys, you are a real resource in a sea of difficulties(microcontroller development)

    Robert

  35. #35
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    Quote Originally Posted by keithdoxey View Post
    Dont show pictures of extremely neat breadboards....
    ROFL,

    I'll take that as a compliment.

    But really, it's just that you don't want to have anything that correlates to Rats in your proto-board, when you have 2 Evil glowing eye'd monsters in the house.



    They've caused more than a few hours of troubleshooting in the past.
    DT

Similar Threads

  1. AT command using pic basic pro
    By laniboy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th November 2009, 09:39
  2. About timing in pic basic pro
    By din_kt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th October 2007, 03:09
  3. other pic basic pro users in vienna
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th July 2007, 15:23
  4. converting assemble to pic basic pro
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th April 2006, 19:55
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 17:39

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts