USBDemo, something to learn USB a little bit - Page 3


Closed Thread
Page 3 of 7 FirstFirst 1234567 LastLast
Results 81 to 120 of 279
  1. #81
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Josuetas View Post

    1. Any problem with it being the 2550? someone said "Thank god you didn´t choose the 2550" before.
    Don't be put off by my comments. As Steve mentioned it was a "toung in cheek" jibe as poor old Steve and I spent days trying to get an 18F2550 programmed with some bit of code using my cheap JDM programmer and some freeware loaders !

  2. #82
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Momboz View Post
    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.
    Yes and no, it have been discussed before, it's down to your MPASM version. The latest version use FCMEN, while older use FCMEM
    http://www.picbasic.co.uk/forum/show...t=3251&page=30 Post 149 and +

    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.
    Yes, you are right, but it's usual to comment the default one. At least, i always do it. see bellow..
    http://www.picbasic.co.uk/forum/showthread.php?t=543 Post 5 and +++
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #83
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Mister E,
    the code work,
    but AN0 and AN1 not stable
    leds not stable off....same time is on or off....+- 5 seconds...push-buttons is off
    than push-button = on, led stable ......on...off

    i use 18F4550
    470 nf in Vusb / Vss
    .1 uf ceramic in Vcc/Vss
    4k7 in MCLR / Vcc
    resonator 4mhz


    * pardom for my english

  4. #84
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mpardinho View Post
    Mister E,
    the code work,
    but AN0 and AN1 not stable
    leds not stable off....same time is on or off....+- 5 seconds...push-buttons is off
    than push-button = on, led stable ......on...off

    i use 18F4550
    470 nf in Vusb / Vss
    .1 uf ceramic in Vcc/Vss
    4k7 in MCLR / Vcc
    resonator 4mhz


    * pardom for my english
    You unstable just like the other post in the Communications->USB section?

  5. #85
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    yes, but i make the mr.e code and circuit to test
    ....and ...not stable too...i think my 5v from pc is not good

    pardon for the same question.
    Last edited by mpardinho; - 10th April 2007 at 18:48.

  6. #86
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Squibcakes View Post
    Yep got mine working today too!!! Woo Hoo!!
    See photo attached.
    I just ordered and received the wrong USB connector...AGAIN!!! (insert Mr_E's headbanging against desk picture here)...

    Could ya take a look at www.digikey.com and match up a part number if you get a chance?

  7. #87
    Join Date
    Feb 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mpardinho View Post
    i use 18F4550
    470 nf in Vusb / Vss
    .1 uf ceramic in Vcc/Vss
    4k7 in MCLR / Vcc
    resonator 4mhz
    I've used
    220nF Vusb / Vss
    .1 uF ceramic too
    10k MCLR/Vcc
    USB B type Connector
    and it works fine now ;-)

  8. #88
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Out of curiosity... Anyone tried USBDemo with Windows Vista? Working?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #89
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    No, but I'll give it a go this weekend I can feel a backup coming on....

    BTW,

    I need a decent way to debounce a number of switch's connected to my pic.
    I'm using a dirty PAUSE 50 to do just that, but finding unless I put USBSERVICE everywhere (ie after checking the status of each switch), the switch's arent being sent to the pc (via usb).

    I borrowed the ASM timer interrupts from the usbdemo code, but that doesnt help either. I'm thinking that TMR interrupts aren't independent of PAUSE statements. Is this true?

    I don't want to use the BUTTON command.

    cheers
    Squib

  10. #90
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you're using ON INTERRUPT... yes PAUSE will screw up things. Using Darrel's interrupt + it's USBDemo code modification ( AKA POST 148), should solve it.
    http://www.picbasic.co.uk/forum/show...&postcount=148

    Depending how you implemented the interrupt debounce/read plah plah, it may work as well with ON INTERRUPT..
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #91
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Ok Great I'll have to try it. Good to know there could be a work around.

    BTW I tried running usbdemo on Vista, but I need the mchid.dll, which I have on floppy disk but can't get it on to the laptop running vista.

    Don't supose you can upload it on to the website so I can download it straight onto my laptop eh?

    Cheers
    squib

  12. #92
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    That DLL came with Mecanique EasyHID. I'm not sure if David allow to link the DLL even if the software is 100% free.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #93
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    If you're using ON INTERRUPT... yes PAUSE will screw up things. Using Darrel's interrupt + it's USBDemo code modification ( AKA POST 148), should solve it.
    http://www.picbasic.co.uk/forum/show...&postcount=148

    Depending how you implemented the interrupt debounce/read plah plah, it may work as well with ON INTERRUPT..
    Hi Steve,

    Thanks for the tip, it works a treat!

    I rekkon melabs should incorporate DTs instant interrupts into their next version of pbp and do away with ON INTERRUPT altogether......

    Cheers buddy.

    Squib

  14. #94
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Squibcakes View Post
    I rekkon melabs should incorporate DTs instant interrupts into their next version of pbp and do away with ON INTERRUPT altogether......
    Of course that would assume they do anything at all.......
    Come On MELABS...you're falling behind!!!

  15. #95
    Join Date
    Jan 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default 18F2550 Config

    What would the __CONFIG lines look like using the ECIO mode with a 48MHz half size oscillator on pin 9?

  16. #96
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i would guess...
    Code:
    asm
        __CONFIG    _CONFIG1L, _PLLDIV_12_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]
                                ; Divide by 12 (48 MHz oscillator input)
    
    
        __CONFIG    _CONFIG1H, _FOSC_ECPLLIO_EC_1H & _FCMEN_OFF_1H & _IESO_OFF_1H 
                                ;                  ;               ; Oscillator Switchover mode disabled
                                ;                  ; Fail-Safe Clock Monitor disabled
                                ; External clock, PLL enabled, port function on RA6, EC used by USB
                                
        ;
        ;   other __Config
        ;
    endasm
    Look table 2-3 in the data sheet. there's few other setting available. Not sure the divide by 12 is the best option when you can feed it directly.
    Last edited by mister_e; - 14th May 2007 at 12:49.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  17. #97
    Join Date
    Jan 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Thanks for the quick reply

  18. #98
    Join Date
    Jan 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Same problem with a 18F2550

    Quote Originally Posted by Momboz View Post
    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.

    I have the same problem as above but I am using a 18F2550. What am I missing or where did I go wrong?

    I am configured for a 18F2550 but the USBDEMO.MAC file is overwritten without the needed macros each time I try to compile.

  19. #99
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    O.K. the original code was for a 4550. You need to rebuild the project in EasyHid for a 2550. There's a load of needed files.

    I've uploaded the 2455 and 2550 stuff here. let me know what happen now. The 2550 have been tested... but i don't have any handy 2455.

    I've also uploaded the schematic, if some need it.

    NOTE: If your going to use LONG variables, you MUST copy the PIC18Xxxxx.BAL file in your source directory as well, unless you'll receive some compilation errors.

    The .BAL file is located in \PBP\USB18 directory.
    Attached Images Attached Images
    Attached Files Attached Files
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  20. #100
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OK i received those 2455 today, the files i sent work as suppose to.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  21. #101


    Did you find this post helpful? Yes | No

    Smile

    I downloaded the 2550 zip, then the 4550 zip.

    compiled the 2550 example, blew it, plugged it in, nothing, then remembered the crystal speed (I'm on a 16) so went into programmer software and changed div from none to 4, nothing.

    changed all fuse setting in programmer software to what I usually have, worked first time!

    Ran the VB demo, picked it up and worked a treat!

    I was going to update one of my toys with the fake comport CDC but this, well, so much better!

    Thanks a million for showing me it can be done without expensive development kit, this thread should be tagged as a sticky at the top of the forum!

    (yes I had it working in about 20 minutes, this from me that usually has all kinds of problems!) (And I dont even have a proper dev board, just a homebrew with leds etc)

  22. #102
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default



    Welcome in the USB world

    Glad to hear you like it.

    Enjoy!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  23. #103


    Did you find this post helpful? Yes | No

    Default

    Like it I love it!


    just about to start a little project with it now, or at least block one out, so I have a quick question.....

    If I was to use hserin to receive a string of long slow bytes, say 160chars at 1200, would it cause a problem with the USB not being serviced while hserin recieved the bytes, especially if say the incoming data was short, say only 10 chars sent, hserin would have a timeout but if it sat there for 2 seconds, would it drop the USB?

  24. #104
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    yes or not, i would recommend to use the POST 148 version with Darrel Taylor instant interrupt instead of ON INTERRUPT.

    See that link...
    http://www.picbasic.co.uk/forum/show...&postcount=148
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  25. #105
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    Can i use this demo with DasyLab Or Labview ? I using both software from long time for DAQ.
    Thanks

    .

  26. #106
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    I am looking for this trough hole plcc socket, could anyone help which type , or digikey/mouser part number

    Thanks



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


    Did you find this post helpful? Yes | No

  28. #108
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel, but I need the PLCC socket only, not the whole adapter, what make/ type is it ?

    It is smaller than normal PLCC44 socket

    Johan

  29. #109
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by precision View Post
    Can i use this demo with DasyLab Or Labview ? I using both software from long time for DAQ.
    Thanks

    .
    Sorry, i don't use them

    Johan, it's really a trough hole PLCC44 socket
    Digikey:
    A-CCS44-Z-R


    OR
    940-44-044-24-000000

    OR
    8444-11B1-RK-TP
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  30. #110
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Steve

    Yes, it is indeed just a plain PLCC socket,

    I was mistaking it as something else , I thought it was a " mini" plcc44,that fits inside DIP 40 socket, but after I look more closer, it is bigger than the DIP

    I never use PLCC44 socket before, will it fit to QFN 8x8 type PIC 18F4431 ?

  31. #111
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Nope, it's really 2 different animal. Even if possible, good luck with home made soldering for QFN packages

    the easiest home made soldering would be DIP or TQFP packages.

    But yes you can buy some QFN adapter.. make sure you're wallet is ready for that talking about those no solder type... kind of ZIFF for QFN... see those

    http://www.ironwoodelectronics.com/c...-P-Z-01Dwg.pdf
    http://qfp-adapter.com/Site/QFN-MLF-...cket-TOPs.htm#
    Last edited by mister_e; - 14th July 2007 at 15:15.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  32. #112
    Join Date
    Sep 2006
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Error

    hi,

    getting these errors: PBP 2.47, Microcode Studio 3.0.0.0 and MPASM 7.31

    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


    Thank you,

    Regards..
    Last edited by naga; - 22nd August 2007 at 12:10.

  33. #113
    Join Date
    Sep 2006
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Momboz View Post
    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.

    Hi.
    Momboz..

    Iam getting exactly same errors dear,

    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.

    How did you solve this problem?

    Plz Help me...

    Regards...

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


    Did you find this post helpful? Yes | No

    Default

    Which PIC are you using?

    You probably need a modified .bas file for that chip.

    If you are using a 2455, 2550 or 4550 then Steve has already provided the files. (see post 99)

    You may also need to modify the PBPUSB18.LIB file if your PBP installation is not in the default c:\PBP folder. As was the case with Momboz.
    <br>
    DT

  35. #115
    Join Date
    Sep 2006
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Which PIC are you using?

    You probably need a modified .bas file for that chip.

    If you are using a 2455, 2550 or 4550 then Steve has already provided the files. (see post 99)

    You may also need to modify the PBPUSB18.LIB file if your PBP installation is not in the default c:\PBP folder. As was the case with Momboz.
    <br>
    Hi,

    Thanks for your reply.
    Errors for both 2550 and 4550;(using steve's files)
    there are 2 folders in c:\PBP, one is MCSP-3.0 2ND one is PBP247,
    Now different errors when iam trying to compile Steve's file from C:\PBP.
    No errors from the sample folder files(pbp247)i tried with its own compiller and mpasm..

    Regards,

    plaese find attached image..
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    There may be several things going on here. Let's see if we can fix a couple of them.

    First, since PBP wasn't installed in the default folder, you have to change the path to one of the files.
    In your c:\mcsp\pbp247\ folder, there is a PBPUSB18.LIB file.
    Open it with notepad, and change the first include line to...

    &nbsp; include "c:\mcsp\pbp247\PBPPIC18.LIB"
    ----------

    Next, edit the c:\mcsp\pbp247\18F2550.INC file with notepad.
    Comment out ALL of the __CONFIG lines with a semicolan ;
    ----------

    Then in the USBdemo program, change _FCMEN_OFF_1H to _FCMEM_OFF_1H

    That will need to be changed again after the next time you upgrade MPASM.
    ----------

    Those should fix several of the errors.
    Compile it like that and let me know whats left.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Oh, and 1 more.

    In Microcode studio, goto

    View | Compile and Program options | Compiler tab

    And select the INHX8M radio button.
    <br>
    DT

  38. #118
    Join Date
    Sep 2006
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Oh, and 1 more.

    In Microcode studio, goto

    View | Compile and Program options | Compiler tab

    And select the INHX8M radio button.
    <br>
    Dear Darrel Taylor,

    Thank you very much..compilled succesfully but few warnings..
    commented like this :
    ALL ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ALL ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
    ALL ; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    ALL ; __CONFIG _CONFIG3H, _PBADEN_OFF_3H
    ALL ; __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L

    i selected only INHX8M radio button in View | Compile and Program options | Compiler tab
    and disabled rest..

    I'll let you know its behavior after programming the IC tonight ..

    Thanks again..

    Warm Regards...
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Ha Ha Ha
    That's funny.

    Very close,
    but no cigar.

    should be...
    Code:
     &nbsp; ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L 
     &nbsp; ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H 
     &nbsp; ; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H 
     &nbsp; ; __CONFIG _CONFIG3H, _PBADEN_OFF_3H 
     &nbsp; ; __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    DT

  40. #120
    Join Date
    Sep 2006
    Posts
    42


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by Darrel Taylor View Post
    Ha Ha Ha
    That's funny.

    Very close,
    but no cigar.

    should be...
    Code:
     &nbsp; ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L 
     &nbsp; ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H 
     &nbsp; ; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H 
     &nbsp; ; __CONFIG _CONFIG3H, _PBADEN_OFF_3H 
     &nbsp; ; __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    Opearation Success...

    Thank you again, and i look forward to your continued support.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 10:38
  3. Replies: 9
    Last Post: - 31st July 2008, 08:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 3

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

Tags for this Thread

Posting Permissions

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