Discussion in 'Programmer's Corner' started by musica07, Aug 12, 2008.

  1. musica07

    Thread Starter Member

    May 28, 2008

    I would like to ask for some help regarding the ADC. In my project, I'm using the 10-bit ADC. It has 1024 counts(0-1023).

    I have a pressure sensor connected to pin RA0 of the PIC18F2620. I have to set an offset value of 1V where this value must correspond with count 310 of the ADC. It must also corresponds to 0mmHg.

    What i have to do is to pump air into the cuff uintil it reaches 200mmHg. This 200mmHg has to correspond with count 510 of the ADC.

    I did some ADC codes but it does not seem to work. I could not figure out the problem. The program will skip the codes in BOLD. It will continue at "BP is taken at...".

    I have attached the ADC codes.

    Thanks for any help. It's greatly appreciated:)

    ADC Program:
    Last edited: Aug 12, 2008
  2. nanovate

    Distinguished Member

    May 7, 2007
    Could you put "CODE" tags around the code so that it more readable?