Anyone Got a 16F88 to Work in Analog?


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    thunderstrike44's Avatar
    thunderstrike44 Guest

    Default Anyone Got a 16F88 to Work in Analog?

    Has anyone got a 16F88 to work in analog at all? I am dead in the water right now. It appears to set the registers ok but I am not getting anything that tells me its working. If anyone has something that works please let me know or otherwise I guess I go back to a 16F876 and see if I can get that to work, but it cost more....

    Brian R.

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Has anyone got a 16F88 to work in analog at all? I am dead in the water right now. It appears to set the registers ok but I am not getting anything that tells me its working. If anyone has something that works please let me know or otherwise I guess I go back to a 16F876 and see if I can get that to work, but it cost more....


    Make sure you have your TRIS registers correctly set. Can you give us a very VERY short part of your program that shows where it is not working, and we can verify it?

    Did you set CMCON to 7, and turn off the comparators?

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    thunderstrike44's Avatar
    thunderstrike44 Guest


    Did you find this post helpful? Yes | No

    Default 16F88 Analog input problem

    I am trying simple code, I thought anyway....

    Take a look at this....

    DEFINE LOADER_USED 1


    OSCCON = %01100111

    TRISA = %00000011
    TRISB = %00000000
    PORTB = %00000000

    ANSEL = %00000011
    ADCON1 = %11000000
    ADCON0 = %11000001

    CMCON = 7

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50


    CTA VAR BYTE

    main:

    ADCIN 0, CTA

    ledtst1:
    IF CTA > 50 Then tst2
    PORTB = %00000001
    GoTo cont

    tst2:
    IF CTA > 100 Then tst3
    PORTB = %00000011
    GoTo cont

    tst3:
    IF CTA > 175 Then tst4
    PORTB = %00000111
    GoTo cont

    tst4:
    PORTB = %00001111

    cont:

    Pause 200

    GoTo main
    End


    Just something to give me a visual that I am getting something back. Unfortunately, unlike the 16F877A I don't have a display on this one to be able to read out the value....

    Brian R.

Similar Threads

  1. pic18f analog comparator problem
    By david.silaghi in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th May 2009, 09:38
  2. 16F88 Analog In
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 25th March 2008, 08:30
  3. analog data acquisition with 16f88
    By dru_x in forum Code Examples
    Replies: 3
    Last Post: - 29th January 2008, 13:38
  4. 16f88 - pin RA4 as analog input
    By savnik in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 15th December 2006, 13:55
  5. 16F88 reading Analog Input
    By thunderstrike44 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2004, 22:41

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