LAB-XUSB Experimenter Board help


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    This
    cfg = _XT_OSC ; XT oscillator

    Should be
    cfg = _HS_OSC

    Check this syntax

  2. #2
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Well, changing the config did it, but only for the LCD sample program where it just repeats saying Hello World. On this key press program, I am getting mixed results. Sometimes it's a single line of blocks. Other times it's a cursor or 9 characters like arrow symbols and slashes. When I press a button, each one yields a ?. If I hit the reset button, those characters side step off of the lcd.

    At one point, when I played with the power up and watchdog timers, I did get the words "press any key" however, several of the letters were missing.

    The schematic of the board is available at the links provided. Nothing was changed, or requires to be changed on the jumpers. I have JP2 set to USB power instead of a wall wart.

    The chip I have matches the pinout of the 4550 exactly, so the configuration should be the same. I thought buying the completed board and using the sample programs was going to be straight forward. Silly me.

  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Quote Originally Posted by ERMEGM View Post
    Well, changing the config did it, but only for the LCD sample program where it just repeats saying Hello World.
    this is confusing - from what I can see the crystal on the board is 20 Mhz, but the OSC value in the first bit of code is 48 !

    What happens if you change the OSC to 48 or 40 in your code ? - Also, comment out the section of the code that deals with the key pad and make the main loop a simple LCDout "hello world" - once you get that part running then you know you have the config and LCD setting right, and then you can un-comment the switch routines and debug them.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    this is confusing - from what I can see the crystal on the board is 20 Mhz, but the OSC
    value in the first bit of code is 48
    check out the fuses, PLL etc. 48Hhz is needed for USB
    Last edited by towlerg; - 12th May 2015 at 02:09.

  5. #5
    Join Date
    Jan 2010
    Posts
    88


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    It IS confusing. As I said, I made the change to the LCD program that just says Hello World over and over again, but it doesn't work on the keypad program.

    I'm still learning this type of code, so the error could be right in front of me and I won't see it. That's why I'm asking for help deciphering this type of coding.

    Thanks,
    Tony

  6. #6
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Demon hit on an issue that comes up here repeatedly. Writing define osc 20 doesn't do the job but define OSC 20 will. I use his method and write the whole define statement in caps like DEFINE OSC 20. That needs to be addressed first.

  7. #7
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Absolutely.

    From the PBP manual in the "DEFINEs Defined" section.
    For the practical PBP user, there are a couple of fundamental points to consider:
    1) DEFINEs are CASE SENSITIVE!

    All PBP DEFINE parameters are UPPERCASE.

    So when you use "osc"' "Osc" "oSc" "osC" "OSc" "oSC" "OsC", PBP will not recognize these as OSC defines and will use the default OSC setting.

    ONLY "OSC" will actually tell PBP you are setting the OSC speed.

    The correct statement for your program is:
    "DEFINE OSC 20"

    The Microcode Studio UI will change the "DEFINE" keyword to lower case when it is displayed I.e. "define" but that is only what is displayed in the UI. It does not actually change the text in the file to lowercase. More importantly it does not change the "OSC" parameter. It will leave it as you typed it.
    Regards,
    TABSoft

  8. #8
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Quote Originally Posted by towlerg View Post
    check out the fuses, PLL etc. 48Hhz is needed for USB
    But how would you get the timing right with a 20mhz crystal. I thought HS setting means that you run at the crystal speed, and the HS_PLL is typically a multiplier (of 4). IE to get 48 Mhz a 12 Mhz crystal is required, OSC is set to 48 and the fuse set to HS_PLL. - From the pictures of this LAB it's not clear if you can interchange the crystals, which is why I found that confusing.

  9. #9
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Malc,

    ERMEGM is not using a 18F4550 in the board. He is using a 16F874A.
    It's max rate is 20MHz using HS mode.

    The 18F4550 is a bit of a different animal as far as I can tell looking at the DS.

    It can take a 20MHz input in HSPLL mode that then gets divided by 5 to drive a 4MHz input into the PLL to get a 96MHz PLL clock. You can then select to divided down to 48MHz for the MCU clock. This allows the USB and MCU to run from a common source but at different rates.
    Regards,
    TABSoft

  10. #10
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: LAB-XUSB Experimenter Board help

    Quote Originally Posted by Tabsoft View Post
    Malc,

    ERMEGM is not using a 18F4550 in the board. He is using a 16F874A.
    It's max rate is 20MHz using HS mode.

    The 18F4550 is a bit of a different animal as far as I can tell looking at the DS.

    It can take a 20MHz input in HSPLL mode that then gets divided by 5 to drive a 4MHz input into the PLL to get a 96MHz PLL clock. You can then select to divided down to 48MHz for the MCU clock. This allows the USB and MCU to run from a common source but at different rates.
    Thanks for the explanation... learning something new every day

Similar Threads

  1. Lab X USB
    By jimbostlawrence in forum USB
    Replies: 6
    Last Post: - 25th January 2012, 00:32
  2. LAB-X1 Timer2 Clock
    By Bruce in forum Code Examples
    Replies: 0
    Last Post: - 25th July 2010, 02:03
  3. Making the Lab X1 communicate with the Lab X2
    By MatthewM in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th June 2008, 22:26
  4. HELP with LAB-X1 board
    By manwolf in forum Off Topic
    Replies: 1
    Last Post: - 11th June 2008, 19:52
  5. Replies: 2
    Last Post: - 20th December 2007, 06:32

Members who have read this thread : 0

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