Old and beyond help ?


Closed Thread
Results 1 to 40 of 47

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    I tried reducing the start point of the if then that controls the delay from 400 down to 200 delay. The program now runs for 1 min 55 but gets further into the program. In fact it gets part way thru the "flashall" section. The power to the pickit demo board, the three darlington drivers and the opto couplers which operate the power transistors on the 8 positive lines is derived from a "Picaxe board I had lying around which has a7805 voltage reg and is being supplied from a 12volt 700ma power unit.
    The normal output voltage which is going to the PIC is 4.8 I have written a bit of code which swithches on all three ports (and hence all 128 leds) and the current taken is about 220 mA which drops the voltage to about 4.2

    For what it's worth the darlington outputs and the transistor circuits which light the leds are driven fom a car battery charger with an output of about 13.5 volts. Go on tell me I've done something daft !!! (I'll believe you !!)

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How do you have MCLR set?

    I use MPASM so you need to change it a bit, but here is my config line for this chip.
    Code:
    @__config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    starting to reveal my ignorance ! I don't really know how I have MCLR set this is an area I do not understand well. I already had trouble because I initially thought I was using MPASM when in fact i was using the melabs version and find it difficult to translate between the two ! I will have a look at the line you provided and try to work out what it should be on my system. As a point of intertest I have bought god knows how many books on PIC programming and have always felt that the config business is very poorly explained most of the stuff my aged brain has coped with but not that. I'll have another look at Melanies post on config and try to work it out together with exactly what MCLR does !

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    I don't really know how I have MCLR set this is an area I do not understand well.
    Are you talking about the function of the MCLR pin?
    Or the function of the MCLR 'switch' in the config bits?

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Code:
    @ device  pic16F887, intrc_osc_noclkout, mclr_off, lvp_off, protect_off, wdt_off
    Try that.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    k the latter as I do not really know the significance

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    k the latter as I do not really know the significance
    Not sure what "k the latter" is. Does not translate well
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    YESSSSS!

    It's working ! Finally pinned it down to the power supply. If I supply the PIC separately from the optocoupled transistors it all works. very many thanks to all you patient and helpful souls out there without whom this particular star would never have risen in the west (or anywhere else !). When (if ?) I figure ou how to post a picture and/or video I will be happy to do so. Thanks again

    Happy Christmas

  9. #9
    Join Date
    Dec 2007
    Location
    Northants England
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    tried to interpret your config line in pm terms got the @device to work with MCLR and Lvp but didn't recognise CP. None of this made any difference. However after a lot more somewhat uneducated fiddling I find that the piece of code which seems to produce the problem is the expanding multicoloured disc bit if I remove it to the end I can get both the rotating bit and the flashall bit working. I have however just spotted a message when I compile which states:
    Warn Blink.asm599: [102] code crosses boundary @ 800h
    I think I am going to have to settle for what I have got and keep it simple... I am getting in over my head here.. Thought flashing a group of leds would be a doddle !!! although the fact that the flashall bit works would seem to rule out power supply problems as that is switching the whole lot on and off.

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The above post #41 should be the config for PM.

    Read this (post #2)
    http://www.picbasic.co.uk/forum/showthread.php?t=40
    Dave
    Always wear safety glasses while programming.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    I have however just spotted a message when I compile which states:
    Warn Blink.asm599: [102] code crosses boundary @ 800h
    Shouldn't have to worry about that.

    What happens if you use ONLY that chunk of code that is failing and nothing else?

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavidFMarks View Post
    In fact it gets part way thru the "flashall" section.
    Ok, I believe that would rule out the WDT.

    The normal output voltage which is going to the PIC is 4.8 I have written a bit of code which swithches on all three ports (and hence all 128 leds) and the current taken is about 220 mA which drops the voltage to about 4.2
    The brownout reset, if turned on, kicks at 4.0v. Are you measuring voltage at the regulator/source? Or right at the PIC itself? Might have a voltage drop in there somewhere and the brownout is kicking in.

    fom a car battery charger with an output of about 13.5 volts
    Those outputs aren't too clean at all.


    And are your config bits really being set as you want them to actually be set?

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