USB Pics, ICD2, pic basic pro


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    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

  2. #2
    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

  3. #3
    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

  4. #4
    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...

  5. #5
    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)

  6. #6
    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

  7. #7
    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

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 : 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