Delta-Sigma-ADC in Assembler embedded in PBP, increasing resolution


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    What about using

    Code:
    andlw 0x2F0 ; Are we done? (We're done when bit2 of
    btfsc STATUS,Z ; the high order byte overflows to 1).

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Question

    No, you can only check one byte(8bits) in one go. You're also trying to check several bits at the same time, only one is "allowed". If you really MUST check for something more complicated you'll need to rewrite the code yourself. Certanly possible but nothing i will help you with.

    Good luck.
    /Ingvar

    PS. Is there a perticular reason why you can't use 10 bits and scale the result as i showed you in my last post? DS.

  3. #3
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    Where is the result stored - in result_l or result_h or are they the same ?

    At U = Umax there should be a value of 1024.

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Result_h is the high byte(8bits) of the wordsized(16bits) result. Result_l holds the lower 8 bits.

  5. #5
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    I don't understand this. How do you combine these two to get a Dez-number between 0 and 1023 ?

  6. #6
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Red face

    Ok, time for somebody else to step in. I don't have the patience, time and/or languageskills to explain how hex, binary and decimal correlates. I recommend that you buy a book that expalins the basics of "microcontrolling". Can't give you any advice on good books since i haven't needed one for 20 years.

    Good luck
    /Ingvar

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Haven't followed this from the beginning but I'll jump in here real quick.

    A word is 16bits. A byte is 8bits. A word consists of 2bytes a high and a low. To combine 2 bytes into a word you can do:
    Code:
    MyWordResult var WORD
    
    MyWordResult = Result_h * 256 + Result_l
    HSEROUT [#MyWordResult,10]
    If Result_h is 100 in decimal and Result_l is 25 in decimal. Your result would be 25625 in decimal. Or if you like in binary.

    Code:
             H I G H     L  O  W
             B Y T E     B Y T E
    MSB---> 01100100  00011001 <----LSB
    See? The high byte is 100 and the low byte is 25.

    Since the most significant bit in the low byte equals to 128 the least significant bit in the high byte equals to 256. That is why you multiply the highbyte by 256.

    Or seeing it as 16bit word:

    LSB MSB
    1+0+0+8+16+0+0+0+0+0+1024+0+0+8192+16384+0 = 25625

    /Henrik Olsson.
    Last edited by HenrikOlsson; - 3rd October 2006 at 13:08.

Similar Threads

  1. Delta Sigma ADC is inverting
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th January 2007, 16:35

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