StartUSB board from MikroE


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187

    Default StartUSB board from MikroE

    Hi

    I have a StartUSB board from MikroE http://www.mikroe.com/startusb/pic/ that I been trying to program with a simple PBP program via the bootloader but there is someting wrong.

    The pauses in the program is much shorter than 1000ms, I have tried to change the config FOSC settings but nothing helps.

    Any idés of what to do next?

    Code:
    DEFINE OSC 8
    
    include "C:\ODIN\PIC\INCLUDES\ALLDIGITAL.pbp"
     asm
                __CONFIG    _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_1_1L
                __CONFIG    _CONFIG1H, _FOSC_XT_XT_1H
                __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
                __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
                __CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L & 0DFh
     
     endasm
    
    Main:
    
    pause 1000
    toggle PORTA.1
    pause 1000
    
    Goto Main

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    You will pause for 2000 if you keep the 2nd PAUSE.

    Robert

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    Yes, but the LED on PORTA.1 is blinking faster than that.

    If I set PAUSE 5000 the LED blinks around every second so there must be something wrong with the speed of the PIC.

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    Then there most likely is something wrong with CONFIG1 settings.

    Robert


    Edit: Last time I used USB on an 18F2550, I think I had to use 48 MHz.

    If you have an 8 MHz oscillator, then CONFIG1 has to be set accordingly.
    Last edited by Demon; - 1st June 2014 at 14:11.

  5. #5
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    I only use the USB for loading the program. so I don´t care if the USB not working in my PBP program.


    EDIT.
    Maybe the bootloader don´t allows me to change Configs from my PBP program?
    I changed the DEFINE OSC 8 to DEFINE OSC 48 and now the pause times is OK and the Serin/Serout also works so I assume that I with this bootloader I can only run my PBP program at 48Mhz?
    Last edited by Fredrick; - 1st June 2014 at 15:00.

  6. #6
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    You are dealing with a PLL chip read this post.

    http://www.picbasic.co.uk/forum/showthread.php?t=18498

    look at your config section and you will find the settings for pll.

    for more info search for pll and if you understand it you can possibly explain it to me.

    Obviously Henrik understands it! amongst others.
    Last edited by EarlyBird2; - 1st June 2014 at 18:11.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    Haven't found a thread with 18F2550 with 8MHz crystal and USB (I'm assuming the end goal is to use USB feature).

    Some reading on PLL:

    http://www.picbasic.co.uk/forum/showthread.php?t=4333

    Robert

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: StartUSB board from MikroE

    Just to clarify, DEFINE OSC setting does not have to match external oscillator. By adjusting CONFIG1 you can use a 8MHz crystal and have the PIC run at 48MHz for USB.

    Robert

Similar Threads

  1. Moving from Basic Stamp and MIKROE basic to PicBasic PRO
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 40
    Last Post: - 6th March 2013, 05:27
  2. RF development board
    By Bruce in forum Adverts
    Replies: 2
    Last Post: - 26th January 2011, 20:57
  3. New an what to know what board is best to start
    By asdhillon86 in forum General
    Replies: 13
    Last Post: - 9th December 2010, 19:10
  4. Sd interface board
    By T_J_W in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th August 2007, 12:00
  5. 5v and 7v on same board - question
    By mark.oswald in forum Schematics
    Replies: 1
    Last Post: - 28th July 2007, 23:03

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