Pic12f683 Cmcon0 = 7


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Well, in that case with 8 bit ADC, variable mon should be a BYTE rather than a WORD.

    Your ADC range for 0-5v is an ADC reading of 0-255 where 255=5v.

    So 2 volts will be 2/5ths of 255 namely 102...

    So the IF statement then becomes IF mon > 102 THEN...

    The decision to use 8-bit or 10-bit ADC is simply a matter of precision, and you chose whether you need steps of 1/255 or 1/1024 for the ADC span that you are using.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    1/255 is fine.

    Where can I go to learn the basics of using AD conversions? It's obvious that I have no clue.

    Thanks again for the help.

    ~ Dave

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Posts #20 and #23 of this thread... and you're almost there... it's real simple... add to that the ADCIN section of your PBP Manual and the ADC Section of your chosen PICs Datasheet.

    Lesson 1.

    Get a PIC with ADC Input capability and enough pins to drive an LCD Display. Hook it up so you can send messages to your LCD. Put a POT (10K or 5K) across your 5v supply with the wiper to the PIC ADC pin. Write a small program to display what the ADC value is when reading 8-bit. Wind the POT up and down a few times to see digits change...

    Lesson 2.

    Repeat above with 10-bit ADC input.

    You're an expert!

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Melanie,

    OK, I contacted my supplier rep and he's sampling me some LCD screens and driver ICs. He gasped and said "Wow, you're finally going digital!"

    I also went a step further and ordered the book, Programming PIC Microcontrollers with PICBASIC. Something that I should have done a long time ago.

    Thanks again!

    ~ Dave

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 07:14
  2. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 08:31
  3. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 14:35
  4. Working with indivividual bytes of an array
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2007, 20:16
  5. code conversion
    By saturnX in forum mel PIC BASIC
    Replies: 19
    Last Post: - 3rd October 2005, 18:17

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