Unwanted output signal jitter


Results 1 to 21 of 21

Threaded View

  1. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    [QUOTE=LinkMTech;48591]A couple of thoughts...

    Code:
    CLRW                    ' Clear all registers<<<-----CLRW works with PBP?
    
    ADCON1 = %00000000      '<<<---What's the default 'JUSTIFY' on a 16F737?
    
    DEFINE ADC_BITS     5                     <<<<---Why not use all 8 bits?
    -------and the manual says only 8,10,12...  I don't see 5 as a legal value
    
    Low_Adj var byte ' Input declared as byte size <<<-- You might want WORD here
    Low_set var word ' Input declared as byte size    <<<<- it is? :)
    
    Low_set = (abs(low_adj-128))*8      <<<<---these lines look a bit scary to me
    That last one...
    If you get a value above 32, when multiplied by 8 will overflow a byte variable. Low_set is a word, but low_adj isn't. I seem to have bad luck when mixing variable sizes like that. But that's just me...
    I think the ADC_BITS might be your killer. Keep it at 8 bits, AND out the low 3 bits, and shift it down by 3 bits.

    EDIT: Notice I changed OR to AND. My mistake..duhhhh...
    Last edited by skimask; - 4th January 2008 at 14:34.

Similar Threads

  1. 16F1827 setup
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 10th March 2011, 00:04
  2. Replies: 24
    Last Post: - 1st December 2009, 09:01
  3. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 15:19
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 21:36
  5. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 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