Steve's USBDemo with PBP 2.60 and MPLAB 8.33


Closed Thread
Results 1 to 15 of 15
  1. #1
    Join Date
    Feb 2007
    Posts
    37

    Default Steve's USBDemo with PBP 2.60 and MPLAB 8.33

    Hi,

    I have preferred to open a new tread about the USBDemo of Mister_E in order to have a clear start condition using the last release of PBP and the MPLAB.

    I have downloaded from

    D:\PIC\MEL\18F4550\USBDemo\MisterE_forum\1 USBDemo, something to learn USB a little bit - MEL PICBASIC Forum.mht

    the USBDemo.zip, followed all indication about PIC18Xxxxx.BAL file, read the entire tread, and after I'm a little confused.

    I have installed a fresh update of the PBP 2.60 and the latest MPLAB 8.33 with the obiective to learn USB.

    Thanks to the better works and explanation of Steve and Darrel I'm confident at the end, I will be able to manage correctly the USB on 18F4550, but now I'm locked on a "simple" compiler error.

    In the attached screen shot are visible the compiling errors, and the involved directory.

    My WIN XP SP3 path is:

    PATH=C:\Programmi\PC Connectivity olution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WIN
    DOWS\System32\Wbem;C:\Programmi\QuickTime\QTSystem \;D:\Programmi\Intel\WiFi\bin\
    ;D:\Programmi\Microchip\MPLAB IDE\VDI;D:\Programmi\Microchip\MPASM Suite;c:\pbp;

    There are someting that I have made wrong?

    Leo
    Attached Images Attached Images  

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default

    Hi Leo,
    I'm not familiar with that piece of Steve's work, so I do not have the code to look at, but I can say, include files must be in the same directory as your source code, also apparently you need to comment out the config in the .inc file for that chip.
    EDIT: OK I Found it : http://www.picbasic.co.uk/forum/showthread.php?t=5418
    Last edited by Archangel; - 18th August 2009 at 12:26.
    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.

  3. #3
    Join Date
    Feb 2007
    Posts
    37

    Default

    Hi Joe,

    the "D" is a partition of the main hard disk. No CD are used.

    I have copied into the source directory the following file:

    pbppic18.lib
    18F4550.bal
    PBPUSB18.LIB

    but the compiling errors remain the same.

    Leo

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

    Default

    The first error in the image is from the PBPUSB18.LIB file in your PBP folder, which is installed with this default path to the Library ...

    include "\PBP\PBPPIC18.LIB"

    But if you didn't install it in the default folder C:\PBP, you have to change it to point to the correct location.

    If using PBPL then that line is in PBPUS18L.LIB

    You should not need to copy those files to the project directory.

    However, the way USB works with PBP 2.60 has been changed considerably.
    I really like the new way. Smaller code, leaves more RAM available for the user, don't have to mess with all those .inc and .bas/.bal files. It's much simpler now.

    But anything from EasyHID no longer compiles for me, which includes mister-e's USBDemo.
    That's not to say it can't be done, meLabs kept all the old USB files in the installation so there must be some way. I just haven't figured it out.

    And since the new way works so well I'll probably not even try.

    Take a look at the USB.TXT file in the USB18 folder, which is in the PBP folder.
    DT

  5. #5
    Join Date
    Feb 2007
    Posts
    37

    Question

    Hi Darrel

    many thanks for your answer, but now I'm a little bit confused.

    If I have correctly understand, USBdemo cannot be compiled vith PBP 2.60?

    Also I do not know if I'm using the PBL or PBP. Which is the difference?

    On my previous screenshot you have seen an improper location of files, because, reading on different posts, someone says to copy those files on the source directory.

    I have received from Crownhill the update CD to PBP 2.60 and I suppose on that CD there are all the necessary to build a correctly working enviroment for PBP 2.60.

    I have followed all default proposed by the installer on my new notebook with XP SP3.

    Do you know if there is somewhere a complete working example in PBP 2.60 / VB6?

    Ciao

    Leo
    Last edited by Wirecut; - 20th August 2009 at 11:02. Reason: wrong editing

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

    Default

    I got to thinking about it some more and realized it would be easier to make mister-e's USBDemo work with PBP 2.60 than it would be to make PBP 2.60 compile the old USBDemo program.

    This should help you out Leo.

    http://www.picbasic.co.uk/forum/show...&postcount=198

    hth,
    DT

  7. #7
    Join Date
    Feb 2007
    Posts
    37

    Default

    Hi Darrel,

    Many thanks for you help.

    I have followed the indication of yor post at:

    http://www.picbasic.co.uk/forum/show...&postcount=198

    but when i compile, I see errors as for the attached screen shot.

    Any idea about the cause of this errors?

    Leo
    Attached Images Attached Images  

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,517

    Default

    Sounds like you haven't commented out the __Config statements in the include file for your PIC. See this post for more details.

    /Henrik.

  9. #9
    Join Date
    Feb 2007
    Posts
    37

    Talking

    Hi Henrik,

    your suggestion is illuminating.

    I have commented the following statement into the c:\pbp\18F455.inc

    ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    ; __CONFIG _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
    ; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    ; __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    ; __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L

    and now the compilation go on without errors.

    GREATH!

    Ciao

    Leo

  10. #10
    Join Date
    Aug 2008
    Posts
    66

    Default

    Just a question, how do I configure the USB demo to send 550 bytes of data instead of the default 8? I tried setting the PBP code to:

    USBBufferSizeRX con 550 ' output

    USBBufferIn var byte[550]


    and VB code to:

    Private Const BufferOutSize = 550

    and then trx array[549] to PIC. PIC didn't seem to receive this byte.

    Any idea?

  11. #11
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,796

    Default

    Hmm, PBP cannot support that amount of data. The arrays areup to 256 bytes.

    Ioannis

  12. #12
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637

    Default

    Quote Originally Posted by Pic2008 View Post
    Just a question, how do I configure the USB demo to send 550 bytes of data instead of the default 8? I tried setting the PBP code to:

    USBBufferSizeRX con 550 ' output

    USBBufferIn var byte[550]


    and VB code to:

    Private Const BufferOutSize = 550

    and then trx array[549] to PIC. PIC didn't seem to receive this byte.

    Any idea?
    The number of bytes to be sent are set in the HID descriptor file. For PBP 2.50 the allowed values are (if I remember correctly) 8, 16, 24, and 64. Just send 8 bytes at a time until you get the number of bytes that you need.

    I am not familiar with the PBP version 2.60 yet. But, I would guess it is the same.

    Robert

  13. #13
    Join Date
    Aug 2008
    Posts
    66

    Default

    Oh, but sending in multiple packets might result in delay in time sensitive application. But looks like I have no other choice.

    Thanks for the suggestion.

  14. #14
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    637

    Default

    Quote Originally Posted by Pic2008 View Post
    Oh, but sending in multiple packets might result in delay in time sensitive application. But looks like I have no other choice.

    Thanks for the suggestion.
    Use the USBCDC.BAS demo in the USB18 directory for a faster data transfer.

    Robert

  15. #15
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588

    Default Re: Steve's USBDemo with PBP 2.60 and MPLAB 8.33

    Thread moved from Code Examples

    Robert

Similar Threads

  1. MPLab and Picstart plus with PBP...
    By gregcan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th October 2009, 15:36
  2. MPLAB and PBP ...
    By Acetronics2 in forum Off Topic
    Replies: 4
    Last Post: - 28th August 2008, 21:51
  3. pbp --> mplab broken again
    By kenif in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th December 2006, 19:57
  4. PBP in MPLAB
    By zagisrule! in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th December 2005, 02:58
  5. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2005, 00:30

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