16f684 Porta.2 Instability


Results 1 to 11 of 11

Threaded View

  1. #8
    JDM160's Avatar
    JDM160 Guest


    Did you find this post helpful? Yes | No

    Unhappy

    I am still having problems with my program. If I don't tie my inputs to ground, my program wont run properly! The problem is that I'm trying to sense a ground or "low" condition at that pin and using internal pullups.

    My basic circuit is as follows: I am running 4 LEDs off of PORTC through NPN transistors. I am also running a PWM output.

    I have 3 digital inputs that read a switch state as on or off. Pins are tied to ground through a 10k resistor. Press switch 1 on input 1 and LED1 on output 1 goes on (input pin drivin to +5V when switch closed). Nothing fancy, very simple logic.

    My problem lies when I enable an input that is normally "high" through the weak pullups. The program does not run at all. If I configure that pin as an output, program runs fine.... There is no routines in the code that reference that pin either! So I'm pretty sure it's not my code...

    What am I missing!!!

    Here is my configuration:

    OSCCON = %01100001 '4 Mhz
    INTCON = %00000000 'disable interrupts
    PIE1 = %00000000
    CMCON0 = %00000111
    ANSEL = %00000000 ' all digital I/O
    TRISA = %11111111 ' input pins
    TRISC = %11011111 ' input pins except pwm port
    IOCA = %00000000

    T2CON = %00000100 ' enable timer 2 for PWM and set prescaler to 0

    CCPR1L = %00000000 'zero duty cycle
    CCP1CON = %00001100 'enable PWM, active high

    PR2 = 24 '0-100 duty cycle
    Last edited by JDM160; - 4th November 2006 at 03:27.

Similar Threads

  1. 16F684 Basic Functionality
    By munromh in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 30th September 2009, 20:28
  2. 16F684 and RA2
    By GoldStar in forum General
    Replies: 1
    Last Post: - 21st May 2009, 07:29
  3. ICSP and 16F684
    By onaclov2000 in forum Schematics
    Replies: 4
    Last Post: - 5th March 2009, 17:31
  4. help with HPWM on 16f684
    By kimvellore in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd May 2006, 08:05
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 03:46

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