Strange LED Result!!


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84

    Default Strange LED Result!!

    I hope I am not doing something silly. But when I use the program below only the Green LED (RA0) will flash. But if I comment out both lines 'LedG = ' then the Yellow LED will flash (RA1).

    Using a PIC18F2525, PBP247 and MPASM 5.03
    ********************************************
    DEFINE OSC 20
    INCLUDE "MODEDEFS.BAS"

    ADCON1 = 7
    CMCON = 7
    TRISA = $00
    TRISB = $FF
    TRISC = %11010000

    LedG VAR PORTA.0
    LedY VAR PORTA.1

    start:
    LedY = 1
    LedG = 0
    pause 500
    LedY = 0
    LedG = 1
    pause 500
    goto start

    end
    *********************************************

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    ADCON1 = $F 'page 248 of the datasheet.
    Yes, on other PICs the value is 7, on this one it's $F.

  3. #3
    Join Date
    Mar 2004
    Location
    UK-Midlands
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thanks Skimask,

    I just took the information from the table shown as example 10-1 on setting up the ports on page 105. It uses $07 but my mistake as you said it shoud be $0F.

    That will teach me to double check the correct register pages!

    Many thanks for your help.

    Bob

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Strugling without floating point
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 27th March 2011, 06:29
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 13:27

Members who have read this thread : 1

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