Cant get it to work


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    May 2004
    Posts
    81


    Did you find this post helpful? Yes | No

    Default

    Hmm. let me double check this:

    Yes I am using 1K. The "Power" LED seems to do just fine with the 1K but I see what your saying about the pic not having a whole lot of current. Just for gits and shiggles I removed the resistor all together comming from the pic and not so much as a blown LED... just a whole lot of nothing...

    However....

    Then show us how you have the *.inc file setup or how you are doing it in code space.

    Please do not say you are setting them with icprog...


    Actually, yes.. that is exactly how I am setting the fuses. Is that wrong?


    Assuming you have wired everything correctly, and not as per your original sketch then it could be that either your JDM programmer isn't programmingn the PICS or IC-Prog is not setting the config correctly.
    That was my original assumtion as well. I have done all kinds of little "tests" though (writing data in EEPROM memory and reading it back, etc). I dont *THINK* its the programmer hardware but I would bet my life it isnt either. For all I know its a bunch of bad chips... though I have had no luck with 16F88 chips either and those I have here are brand new in the tube.
    Last edited by bearpawz; - 8th April 2010 at 00:13. Reason: additional response

  2. #2
    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 bearpawz View Post
    Actually, yes.. that is exactly how I am setting the fuses. Is that wrong?
    EEEH, not really wrong, just not the best way. Find where you can turn this feature off and read this.
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    PBP by default reads the *.inc file for the chip that is in the PBP directory. You can modify the *.inc to the setting you want or modify it so the configs can be set in code space.
    The difference between the two is a personal preference.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    For the 16F88, this is what the beginning of your code should look like if you are setting the configs in code space and want the ADC off, MCLR as an input, internal 4MHz.
    Code:
        DEFINE OSC 4           
        OSCCON = %01100000
        @ __config _CONFIG1, _INTRC_IO & _WDT_OFF & _LVP_OFF & _MCLR_OFF &_CP_OFF
        ANSEL = %00000000
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I don't know, perhaps I'm way late here but your original program reads HIGH 0 and LOW 0 which may work on a BASICStamp but I don't think it works with PBP - even after including the BS1/2 defs - which you don't seem to have done anyway.

    Al, covered it in his program by changing the code to HIGH PORTB.0 etc but then in a later message you say you're using PORTB.4 instead. Did you change the code so it reads HIGH PORTB.4 etc?

    /Henrik.

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    I don't know, perhaps I'm way late here but your original program reads HIGH 0 and LOW 0 which may work on a BASICStamp but I don't think it works with PBP - even after including the BS1/2 defs - which you don't seem to have done anyway.etc?

    /Henrik.
    Good point,

    The original code doesn't even state what to high and low, what port, what variable etc. Barepawz can you post your entire code as it now stands?

    Given the suggestions, it should now set the config bits via the inc file, turn all ports digital, turn off A/D, and flash your LED.

    Oh and it's not advisable to drive a LED without any series resistor, this will allow the LED to draw as much current as it needs, which could be more than the PIC can provide. My EasyPIC5 board uses 1K resistors with "normal" 3mm defuse red LEDS, which work even though they shouldn't according to Al's formula, possibly as the forward current is probably 20ma rather then the 10ma used in the example. If you're using one of the Ultra-bright LEDS then use the formula in Al's post along with the data sheet for the LEDs you are using.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Rt....

    Hi,

    This ( as ARatti finished it ) :

    Code:
    '****************************************************************
    '*  Name    : BPWZ.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 08/04/2010                                        *
    '*  Version : 1.0                                               *
    '*  Notes   : 16F819                                                  *
    '*          :                                                   *
    '****************************************************************
    DEFINE OSC 8                                    ' 8 Mhz Oscillation
    OSCCON = $70                                    ' Oscilator Config reg.
    
    ADCON1 = 7
    
    TRISA = %00000000
    TRISB = %00000000
    
    PortA = 0
    PortB = 0
    
    start:
        High 0
        pause 1000
        low 0
        pause 1000
    goto start
    Makes PortB.0 blink @ 2 Hz ... Only if you use an external 8 Mhz Xtal ... as PBP Defaults to HS Osc for the Config. ( see #14 from Dave )

    you must add :

    Code:
     @ device PIC16F819,INTRC_OSC_NOCLKOUT, WDT_ON, PWRT_ON, MCLR_ON, protect_OFF, LVP_OFF
    to the top of the listing to get INTRC Oscillator work, if MCS using. Then no need to define the options by hand in IC Prog ...

    a look to manual $ 4.11 will show how "numbers only" work as port pins defining ...

    is the great mysterious code problem solved, now ???

    Alain
    Last edited by Acetronics2; - 8th April 2010 at 10:52.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default

    Hmm, I see I've completely missed (or perhaps forgotten) that HIGH 0 valid, you (re)learn something everyday. Still, I'd say it's "better" (not function wise but for readability) to actually say HIGH PORTB.0

    Thanks for pointing mo that Alain, let's hope the OP gets this going now!

    /Henrik.

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