blink a single led


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    Thks,
    yes, i did every thing to run but no way
    one of the thing is the led on or off when my hand is getting closer to it (the whole surface p10 led dot matrix)

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    Minhle, A rough schematic would be helpful....
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    TKS
    i attach the schematic drawing from isis.
    the program is similiar to the 1 above
    this is the schematic on the breadboard.
    the internal osc is used 64mhz
    the leds r connected through 100 or 1k ohm resistors
    when simulating on isis: osc is changed to 4mhz



    PORTTEST_18F26K20.doc
    Last edited by MINHLE; - 4th December 2016 at 02:10. Reason: add more information

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,654


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    I would not expect anyone who values their computer's integrity to open a "doc" file from an untrusted source.

    make it a jpg,gig,png or some other safer format



    ps what version of pbp are you using . that config section is way way old hat
    Warning I'm not a teacher

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    Maybe on breadboard the crystal didn’t start to oscillate.
    Try licking your finger and touching one leg, then the other, then both.

    Edit.. whoops.. uses internal osc.. can’t delete post.
    Last edited by Art; - 4th December 2016 at 06:55.

  6. #6
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    tks for all

    now i know how to send by pdf, here is the attachment
    pic18f26k20_porttest.PDF
    i used pbp v 2.6

    i used internal osc 64mhz or 4mhz
    no external capacitors on the osc pins,
    the same program that is programed into the chip ran before but now it does not ( on both pcb and breadboard)
    i attach the program that is slighly changed the pause statement:

    INCLUDE "h:\AllDigital.pbp"
    ASM
    __CONFIG _CONFIG1H, _FOSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    ENDASM
    OSCCON = $70 '$70 Internal oscillator is set to 16MHz $62 ' 8mhz--- '; Primary Clock is selected as system clock.
    OSCTUNE = $40 'HFINTOSC selected; PLL enabled; Factory calibrated frequency
    define OSC 64
    ADCON0 = 0
    CM1CON0.7 = 0
    CM2CON0.7 = 0
    portb = 0
    latb = 0
    trisb = 0
    '------------------------------------------
    i var byte
    m var byte
    main_program:
    gosub blink 'call suroutin to blink a led
    GOTO main_program
    '==============================================
    blink:
    high portb '= $ff ' light the led for acertain amount of time
    for i = 0 to 100 'loop to maintain the led on
    FOR M = 0 TO 10
    pause 1
    NEXT
    NEXT
    low portb '= 0 'tuen off the led for certain amount of time
    for i = 0 to 50 'loop to maintain the led off
    FOR M = 0 TO 10
    pause 1
    NEXT
    NEXT
    return
    '-------------------------------------------
    end

  7. #7
    Join Date
    Apr 2008
    Posts
    85


    Did you find this post helpful? Yes | No

    Default Re: blink a single led

    i do not under stand configuration is old hat and
    internal osc can delete post?
    can you explain clearly,
    tks

Similar Threads

  1. Single PIC to Blink 5 LEDs Independently?
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 68
    Last Post: - 18th July 2015, 16:56
  2. need led blink program
    By asifiqbal in forum General
    Replies: 6
    Last Post: - 4th March 2014, 11:26
  3. blink led 12f683
    By mel4853 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th January 2010, 22:39
  4. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  5. 10f206 Blink led
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th November 2005, 20:01

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts