"hello world" with 18f6680


Closed Thread
Results 1 to 40 of 92

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    yeah, it seemed to work until the motors got up to a certain speed, adn then it would just freeze.. i started this "project" just to learn the 18f

  2. #2
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    If you put +5vdc on portd.4 does the LED light? If not then it's a hardware problem, if it does then try something really simple like;

    DEFINE OSC 20
    HIGH PORTD.4
    END

    Did the port go high? I took a quick look at the datasheet for you PIC, and I didn't see that PortD.4 is multiplexed, so it should work fine.

    LAT is not in the manual, it is in the datasheet, it's a memory register, you've probably seen it as LATA, or LATB, etc.

    Usually when I have this problem it's because I put the LED in backwards, even though I checked it three times before I soldered it.

    Merry Christmas!

    Jerry.
    If your oscilloscope costs more than your car...

  3. #3
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    i have actually made d.4 an I/O connection on my board.. there is three pins, ground, + and signal (just like a servo). so i had an LED hooked to it, but since then, i have just hooked up my multimeter, and its not showing any voltage across signal to ground when i put it high. i do get 5V across the + and ground. and i can write code to the PIC, and i can read the same code back off the PIC.. its a double stacked board, and i soldered the headers into both boards, so i may need to try to get them apart to look inside where the PIC is..

  4. #4
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Isn't that always the way? Hopefully you'll see something easy to fix when you get it opened up, it's got to be something simple. The 18F chips are great once you get the hang of them, just keep at it, and remember, we do this for fun right?

    Merry Christmas!

    Jerry.
    If your oscilloscope costs more than your car...

  5. #5
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    i did find one little thing... one pin from my OSC was touching a 5V line... so i fixed that, but im still not getting any voltage on any pins...

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


    Did you find this post helpful? Yes | No

    Default

    How are you programming the fuses? In the code or the *.inc??

    Either way, post the config settings. The 18s are different ...


    This is a snippet of my 18F4320.inc
    Code:
    	
    
    	
    	CONFIG OSC = HS
    
    	CONFIG LVP = OFF
    
    	CONFIG BOR = OFF
    
    	CONFIG MCLRE = OFF
    
      
    
      ;      __CONFIG    _CONFIG1H, _XT_OSC_1H
    
      ;      __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    
      ;      __CONFIG    _CONFIG4L, _LVP_OFF_4L
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    ok... i have tried to get this to work lots since last year, adn it still wont do anything. i have pulled apart both boards and checked all the solder joints with my meter, and have gone over and over the design to make sure everything is wired properly. i have replaced the OSC with another one. there is .1uf caps spead out over the board, and i have a 1M ohm resistor from PGM to ground.

    i can program code into the chip, and i can read it back, it just wont run. i have an LED connected from D4 to a resistor and then to gnd. all the other ports i have put my meter on and watched for voltage changes.

    my code is:

    DEFINE OSC 20
    pause 500
    start:
    High porta.0
    high porta.1
    High porta.2
    high porta.3
    High porta.4
    High porta.5
    High porta.6
    High porta.7

    High portb.0
    high portb.1
    High portb.2
    high portb.3
    High portb.4
    High portb.5
    High portb.6
    High portb.7

    High portc.0
    high portc.1
    High portc.2
    high portc.3
    High portc.4
    High portc.5
    High portc.6
    High portc.7

    High portd.0
    high portd.1
    High portd.2
    high portd.3
    High portd.4
    High portd.5
    High portd.6
    High portd.7

    High porte.0
    high porte.1
    High porte.2
    high porte.3
    High porte.4
    High porte.5
    High porte.6
    High porte.7

    High portf.0
    high portf.1
    High portf.2
    high portf.3
    High portf.4
    High portf.5
    High portf.6
    High portf.7

    High portg.0
    high portg.1
    High portg.2
    high portg.3
    High portg.4
    high portg.5
    High portg.6
    high portg.7

    pause 300

    low porta.0
    low porta.1
    low porta.2
    low porta.3
    low porta.4
    low porta.5
    low porta.6
    low porta.7

    low portb.0
    low portb.1
    low portb.2
    low portb.3
    low portb.4
    low portb.5
    low portb.6
    low portb.7

    low portc.0
    low portc.1
    low portc.2
    low portc.3
    low portc.4
    low portc.5
    low portc.6
    low portc.7

    low portd.0
    low portd.1
    low portd.2
    low portd.3
    low portd.4
    low portd.5
    low portd.6
    low portd.7

    low porte.0
    low porte.1
    low porte.2
    low porte.3
    low porte.4
    low porte.5
    low porte.6
    low porte.7

    low portf.0
    low portf.1
    low portf.2
    low portf.3
    low portf.4
    low portf.5
    low portf.6
    low portf.7

    low portg.0
    low portg.1
    low portg.2
    low portg.3
    low portg.4
    low portg.5
    low portg.6
    low portg.7
    pause 300
    goto start
    end



    and the fuses are set as:

    OSC "HS"
    System clock "disabled"
    power up timer "disabled"
    brown out reset "enabled"
    brown out voltage "2.0V"
    watchdog timer " enabled"
    watchdog postscaler "1:128"
    ccp2 multiplexed with "RC1"
    mclr pin function "reset"
    overflow reset "enabled"
    LVP "disabled"
    boot block "not protected"

    im using microcode studio, mpasm and an epic programmer.

Similar Threads

  1. 18f6680 N/C
    By mackrackit in forum Off Topic
    Replies: 2
    Last Post: - 29th April 2008, 20:21
  2. need help with "hello world" in hyperterm
    By ericmiles in forum Serial
    Replies: 3
    Last Post: - 31st October 2007, 15:08
  3. 18F6680 and portd problems.
    By jkbh in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2005, 10:54

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