Help Pic16f628a


Results 1 to 7 of 7

Thread: Help Pic16f628a

Threaded View

  1. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    I found your problem.
    Code:
    @ DEVICE PIC16F628A, INTRC_OSC_NOCLKOUT
    @ DEVICE PIC16F628A, WDT_ON
    @ DEVICE PIC16F628A, PWRT_ON
    @ DEVICE PIC16F628A, MCLR_OFF
    @ DEVICE PIC16F628A, BOD_OFF
    @ DEVICE PIC16F628A, LVP_OFF
    @ DEVICE PIC16F628A, CPD_OFF
    @ DEVICE PIC16F628A, PROTECT_OFF
    
    
    '76543210
    TRISA = %00000000
    TRISB = %00001110
    CMCON = 7
    VRCON = 0
    DEFINE OSC 4
    
    Led1 VAR PORTB.6
    Led2 VAR PORTB.5
    Led3 VAR PORTB.4
    
    
    Main:
    HIGH Led1
    PAUSE 2000
    LOW Led1
    HIGH Led2
    PAUSE 2000
    LOW Led2
    HIGH Led3
    PAUSE 2000
    LOW Led3
    Goto Main
    
    
    END
    Simple mistake on your variables you wrote
    Led1 VAR TRISB.6
    Led2 VAR TRISB.5
    Led3 VAR TRISB.4

    should be :
    Led1 VAR PortB.6
    Led2 VAR PortB.5
    Led3 VAR PortB.4
    Last edited by Archangel; - 26th August 2008 at 23:17.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Do I need a pause?
    By tazntex in forum Serial
    Replies: 21
    Last Post: - 29th August 2008, 04:32
  3. Changing bits in a byte for multiple output
    By tazntex in forum Serial
    Replies: 3
    Last Post: - 11th August 2008, 19:10
  4. Replies: 8
    Last Post: - 22nd July 2008, 20:31
  5. Interrupt & device setup for a PIC16F628A in Microcode Studio Plus
    By wildpikachu in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 3rd May 2008, 16:28

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