parsing adc word into bits


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Location
    Torrance, CA, USA
    Posts
    2

    Default parsing adc word into bits

    Hi
    I am trying to reduce a 10 bit adc word into individual bits. Is that possible?
    I am using one port for the high byte (adresh) but I cannot use adresl. One of the ports I am using is the VPP port so I, without thinking of the consequences, assigned the middle bit on another port.
    Any suggestions? The pic is 16F946.
    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I'm not sure I understand.
    You have 10bits of data from the ADC and wants to output those 10bits on individual port pins...or....??
    Code:
    PORTA = ADRESL		'Lower byte on Port A
    PORTB.0 = ADRESH.0	'Higher two bits on PortB.0...
    PORTB.1 = ADRESH.1	...and PortB.1
    /Henrik Olsson.

  3. #3
    Join Date
    Sep 2006
    Location
    Torrance, CA, USA
    Posts
    2


    Did you find this post helpful? Yes | No

    Default adc bits

    Henrik,
    Thanks very much. That is exactly what I wanted to do. I guess I have never used the ".n" notation in picbasic and forgot all about it. Used to do a lot of basic stuff and it was allowed there.
    Thanks, again
    Greybirdman

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  4. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

Members who have read this thread : 1

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