18f4550 a/d


Closed Thread
Results 1 to 7 of 7

Thread: 18f4550 a/d

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 a/d

    Clock speed, sample times, power rail noise, board layout - lots of potential issues. But do you even have an issue? The readings you describe have less than than 1% error, and likely only at the rails. If you really need to get better than that there are techniques for averaging and even for deriving further bits if you do a search on the forum. Microchip also has application notes on the subject.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 a/d

    Question: I see you have set ALL of PortA to be inputs, are they ALL PROPERLY terminated to either VCC or VSS or are they left floating?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Feb 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 a/d

    Hi all and thanks for the replies,

    Demon:
    The Config are saved in the .INC file and are as follow:
    CONFIG FOSC = HSPLL_HS, PLLDIV = 5 , CPUDIV = OSC1_PLL2
    CONFIG FCMEN = ON , PWRT = OFF, BOR = ON, VREGEN = ON , WDT = OFF,PBADEN = OFF ,MCLRE = ON
    CONFIG CCP2MX = OFF, LPT1OSC = OFF , LVP=OFF, ICPRT = OFF,STVREN = OFF , IESO = OFF

    Charlie:
    I'm using a 20mhz crystal with the about settings.
    sample time: DEFINE ADC_SAMPLEUS 50 I think that's 50us.
    The power supply: I'm using a high end with no noise and constant 5vdc.
    the board I'm using has a ground plane but I still soldered wires from the PS directly the MCU and the analog input.
    You are correct about the error % but those numbers are only at rails when I'm in middle it can jump 25 max(ie: from 350 to 325) but not always sometime it does stay consistant within 1 which i'll be happy with.I'll be reading a temp sensor so variation of 20 can results in a false temp reading or big variation.


    Archangel:
    Good catch I changed porta to output except AN0 to input. But did not help


    I added a 10uf 50v cap to the input seems to help a bit but still once in a while not all the time I get those unexpected drop or rise in value as much as 20.

    I've done similar with 16F887 that was dead on i had problems at first but added cap and ground wires and worked perfect.

    Now what i don't understand is the DEFINE OSC 48 in the 18F4450 is it too fast should i just run everything internal OSC(4mhz) and ADC clock internal(RC) would that help? I don't want to go through that until i ask you guys speed is not an issue here(probably I should've run it with internal clock to start with and save a crystal HAHAHAHAH).Or is it the TAd the sampling time the clock speed of the ADC(DEFINE ADC_CLOCK 3)

    Thank you all for your help.

    Happy Thanksgiving,

    Joe

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 a/d

    I never used a serial LCD before. LCDOUT will use parallel on Port D the way you defined it.

    I always use the internal oscillators on 18F PICs, never had a problem.

    Don't have enough skill to comment on ADC stuff.

    Robert

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 a/d

    Quote Originally Posted by starwick View Post
    Now what i don't understand is the DEFINE OSC 48 . . .
    The thing to remember is this: The define explains to PBP what OSC speed you are using, it does not SET the OSC to that speed. It is supposed to match so your timing is correct for all the bit / bang operations to work properly, and pause timing to be accurate. It is possible to lie to PBP and compensate in code.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. 18f4550
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 21st June 2007, 19:03
  2. 18f4550 help, please
    By dalibor in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2007, 21:55
  3. 18f4550
    By alaaodeh in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd February 2007, 18:33
  4. 18f4550
    By vanxn in forum USB
    Replies: 2
    Last Post: - 27th June 2006, 20:40
  5. 18f4550
    By vanxn in forum USB
    Replies: 1
    Last Post: - 27th June 2006, 19:59

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