Loading ...
Sorry, an error occurred while loading the content.

Re: Analog input on 16F628A using JAL

Expand Messages
  • Joep Suijs
    The 628 does not have a regular adc. See thread: http://groups.yahoo.com/group/jallist/message/17660 Joep ... the level 0 stuff of ... over my already working
    Message 1 of 4 , Jan 1, 2005
    • 0 Attachment
      The 628 does not have a regular adc. See thread:

      http://groups.yahoo.com/group/jallist/message/17660

      Joep


      --- In jallist@yahoogroups.com, "Ben Hosken" <ben@n...> wrote:
      >
      > Hi,
      >
      > I'm a newbie to JAL and PIC programming. Since starting I have got
      the level 0 stuff of
      > flashing led, switched led and serial comms to the PC working.
      >
      > I'm now trying to get an analog input from a 10k pot and send it
      over my already working
      > serial link.
      >
      > I'm trying to find some JAL code which works on the 16f628A to be
      able to read an anlog
      > input on the Port A pins. I have found janalog and pic_adc but I
      can't seem to get them
      > working and the examples tend towards the 877 chip.
      >
      > Does anyone have any example JAL code for init'ing the AD functions
      and reading an
      > analog value into a byte variable?
      >
      > Thanks
      >
      > Ben Hosken
    • Vasile Surducan
      The simplest way for AD reading on 16F628 is to use the comparator and internal reference module. I ve discovered that some example on these theme written in
      Message 2 of 4 , Jan 1, 2005
      • 0 Attachment
        The simplest way for AD reading on 16F628 is to use the comparator
        and internal "reference" module. I've discovered that some example
        on these theme written in Conex club magazine is not available to
        download. Unfortunately I do not have the source here. If interested
        mail me privately please and maybe in 03. january you'll have it.

        Vasile


        --- In jallist@yahoogroups.com, "Ben Hosken" <ben@n...> wrote:
        >
        > Hi,
        >
        > I'm a newbie to JAL and PIC programming. Since starting I have got
        the level 0 stuff of
        > flashing led, switched led and serial comms to the PC working.
        >
        > I'm now trying to get an analog input from a 10k pot and send it
        over my already working
        > serial link.
        >
        > I'm trying to find some JAL code which works on the 16f628A to be
        able to read an anlog
        > input on the Port A pins. I have found janalog and pic_adc but I
        can't seem to get them
        > working and the examples tend towards the 877 chip.
        >
        > Does anyone have any example JAL code for init'ing the AD functions
        and reading an
        > analog value into a byte variable?
        >
        > Thanks
        >
        > Ben Hosken
      • Ben Hosken
        Vasile Thanks for your pointers. I have cut and paste the code for the first input and have found a copy of jpic628.jal which I needed for it to work. After
        Message 3 of 4 , Jan 2, 2005
        • 0 Attachment
          Vasile

          Thanks for your pointers. I have cut and paste the code for the first input and have found
          a copy of jpic628.jal which I needed for it to work. After including the jrtl library in order
          for it to compile, along with changing CMCON_C1OUT to C1OUT to be consistant with the
          library the code is compiling.

          Sorry if this sounds silly as I'm just starting out but looking at the reference sheet it
          indicates that setting CMCON = 2 means that there will be two comparators using the RA0
          as input for C1OUT with RA3 being "internally" linked to the VDD. Is this correct??

          I had simply connected my pot to gnd, +5v with the middle connection going to the RA0
          pin. Is this example correct in this instance or should I be usinResistor-Capacitor style
          circuit. Again I appologise if this is a simple question.

          I appreciate your help.

          Ben
          --- In jallist@yahoogroups.com, "Vasile Surducan" <vasile@s...> wrote:
          >
          > The simplest way for AD reading on 16F628 is to use the comparator
          > and internal "reference" module. I've discovered that some example
          > on these theme written in Conex club magazine is not available to
          > download. Unfortunately I do not have the source here. If interested
          > mail me privately please and maybe in 03. january you'll have it.
          >
          > Vasile
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.