12f675_fuse_about_to_blow!


Results 1 to 40 of 929

Threaded View

  1. #23
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    This has taken me ages, it's a modification to Joe's program he posted earlier in the thread (with some of mackrackit's mixed in for good measure) plus some of mine.

    The thing is this: Is this a valid program in that GPIO.4 goes high & low and lights the LED due to the: THEN GPIO.4 = 1 / LET GPIO.4 = 0 program statements? I'm not sure if I've made another little bit of progress here, or just lucked in (the right LED does blink).

    When you guys have a minute could you check it out please.

    GPIO = %00000000 ' set all outputs low
    TRISIO = %11001111 'Set GPIO.4&5 to input
    CMCON0 = %00000111 'Disable analog comparators
    ANSEL = %00000000 'disable analog select so ports work as digital i/o

    main:
    PAUSE 3000
    IF GPIO.5 = 0 THEN GPIO.4 = 1 'turn it on by making pin 4 high +5V
    pause 500
    LET GPIO.4 = 0 'turn it off: Pin 4 goes low 0V
    goto main ' Loop

    end

    Cheersave
    Last edited by LEDave; - 21st February 2010 at 19:37.

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