cds on 16f877a


Closed Thread
Results 1 to 3 of 3

Thread: cds on 16f877a

Hybrid View

  1. #1
    chip_1's Avatar
    chip_1 Guest

    Default cds on 16f877a

    Hi all,
    on 16F84A this code works fine.
    -----------------------------------------
    v1 var byte

    main:

    pot portb.0,255,v1 ' connect an CDS (fotoresistor)
    if v1 < 230 then led
    goto main

    led:

    high portd.1
    pause 500
    low portd.1
    pause 500
    goto main
    ---------------------------------------
    on 16F877A no works!!
    why?

    thx
    chip_1

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


    Did you find this post helpful? Yes | No

    Default

    Chip_1, I beleive the resistance of CDS Photoresistors are quite high as I remember. If the resistance you are encountering is much more than say 50k Ohms then the pot command will not work. You could possibly use the RCTIME command instead with and appropriate capacitor.....

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or using the internal analog to digital converter with a op-amp[ buffer between CDS and the PIC.

    Be sure you place a 0.1 uF capacitor close to your PIC.

    Is anything else work with this PIC?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16F877A with 20MHz XTAL not working?
    By ustredna in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2011, 15:04
  2. 16F877 vs. 16F877A
    By DavyJones in forum General
    Replies: 12
    Last Post: - 11th April 2009, 18:22
  3. help my bluetooth and PIC 16F877A?
    By slimpeng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th March 2008, 06:52
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. 1st 16F877A program in PICBasic
    By Borisw37 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th January 2005, 04: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