18F4550 not running


Closed Thread
Results 1 to 7 of 7
  1. #1

    Default 18F4550 not running

    first off, Merry Christmas and happy new year to everyone on PB forum...

    ok, this seems to be an ongoing problem i keep having with the 18F4550...
    Various programs i've done to do different things... i always seem to have a problem getting the pic to run. I have to keep disconnecting the power and reconnecting untill it does.
    When it doesn't run i seem to get ether intermittent repetitive (the same thing over and over and LED flashing rapidly etc) activity like the pic is resetting after a fraction of a second. or i get a complete lockup.

    And yet, i wrote a program for a friend for the 16F610 and it runs first time without issues. same program (diferent fuse config) recompiled for the 18F4550 refuses to run most of the time.

    But then when i get it to run, it happily runs for days...

    Supply voltage, well, i've ran from 5V regulator (7805CV) and direct from Li-Pol battery (~3.8V)

    Below is the fuse config and the osc setup. have i made a mistake somewhere?
    Any advice appreciated.

    Code:
    @ __CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H & _FCMEN_ON_1H & _IESO_ON_1H
    @ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_OFF_2L
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_256_2H
    @ __CONFIG _CONFIG3H, _MCLRE_OFF_3H & _PBADEN_OFF_3H
    @ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_ON_4L &  _ICPRT_OFF_4L & _XINST_ON_4L & _DEBUG_OFF_4L
    
    Define  OSC				8						' Set clock speed
    
    OSCCON = %01110000
    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Try with XINST off and LVP off.

    Code:
    @ __CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    @ __CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H & _FCMEN_ON_1H & _IESO_ON_1H
    @ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_OFF_2L
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_256_2H
    @ __CONFIG _CONFIG3H, _MCLRE_OFF_3H & _PBADEN_OFF_3H
    @ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L &  _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
    
    Define  OSC     8                        ' Set clock speed
    
    OSCCON = %01110000
    http://www.scalerobotics.com

  3. #3


    Did you find this post helpful? Yes | No

    Default

    ok, that worked first time...

    So, the question is why?
    LVP is low voltage programming, allows the chip to re-program itself without being supplied with 13.6V... i believe?
    Xinst is the extended instruction set... don't know much about this other than what it's name implies...

    I've had LVP turned off befor as i was trying to find out if it was something in the config... never turned off xinst... come to think about it, their is no 'enable' option for it in PBP so, how do you use it... ??? ... ??? lol

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by comwarrior View Post
    ok, that worked first time...

    So, the question is why?
    LVP is low voltage programming, allows the chip to re-program itself without being supplied with 13.6V... i believe?
    Xinst is the extended instruction set... don't know much about this other than what it's name implies...

    I've had LVP turned off befor as i was trying to find out if it was something in the config... never turned off xinst... come to think about it, their is no 'enable' option for it in PBP so, how do you use it... ??? ... ??? lol
    That's great!

    LVP is something I have never used, and always seems to be a problem, so I turn it off. Of course others have better explanations. See http://www.picbasic.co.uk/forum/show...9423#post79423

    XINST is for the extended instruction list. The assembly commands above the normal 49 (or so). PBP is not capable of using the extended set (maybe some day), so we have to turn it off for PBP.

    Walter
    http://www.scalerobotics.com

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote from DT
    But when LVP is enabled ... anytime RB5/PGM goes HIGH ... it's just like taking MCLR/VPP to 13V.
    If it's left floating, the PIC could be constantly entering Program Mode from input noise.
    i have a habit of letting unused pins float...
    Perhaps i should tie all pins to ground with a 100K resistor... thats a lot of resisters though...
    having said that... i have some hardware on order so that i can use ICSP and ICD so perhaps i will do it when i solder up the new sockets...

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Perhaps i should tie all pins to ground with a 100K resistor... thats a lot of resisters though...
    No need to do that. Just make them all outputs, and you're good to go...
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7


    Did you find this post helpful? Yes | No

    Default

    lol, ok, that works too...

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