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

Re: [jallist] pin i/o

Expand Messages
  • Ziya Erdemir
    ... From: Stef Mientki To: Sent: Tuesday, November 30, 2004 5:06 PM Subject: Re: [jallist] pin i/o ... I
    Message 1 of 15 , Dec 1, 2004
      ----- Original Message -----
      From: "Stef Mientki" <s.mientki@...>
      To: <jallist@yahoogroups.com>
      Sent: Tuesday, November 30, 2004 5:06 PM
      Subject: Re: [jallist] pin i/o


      > But if you still want to use assembler,
      > you've to understand read-modify-write cycle,
      > and understand why JAL uses shadowing,
      > then you also will know why your program is behaving as you see.
      >
      > hopes this helps,
      > Stef

      I think shadowing is not the problem at this moment becasue there is no jal
      port output instruction in his program.

      I have seen that some C compiler shadows tris registers (as default) while
      Jal shadows port registers. Is there any difference between ideas? Actually
      in the case of power flactuation (if there is no power supervisor) all
      registers are suspected to change their contents. I think shadowing must be
      users preference and must be optional and must be added "to do list". It
      also consumes one more stack space and in ISR this stack consumption is not
      counted.

      Ziya
    • Wouter van Ooijen
      ... No shadowing *can* always be a problem when r-m-w instructions are used on a port. ... Shadowing port registers solves the r-m-w problem. Shadowing tris
      Message 2 of 15 , Dec 1, 2004
        > I think shadowing is not the problem at this moment becasue
        > there is no jal
        > port output instruction in his program.

        No shadowing *can* always be a problem when r-m-w instructions are used
        on a port.

        > I have seen that some C compiler shadows tris registers (as
        > default) while
        > Jal shadows port registers. Is there any difference between
        > ideas?

        Shadowing port registers solves the r-m-w problem. Shadowing tris
        registers might be used to avoid bank switching, or (on 12-bit cores) to
        compensate for the lack of a tris register.

        Wouter van Ooijen

        -- -------------------------------------------
        Van Ooijen Technische Informatica: www.voti.nl
        consultancy, development, PICmicro products
        docent Hogeschool van Utrecht: www.voti.nl/hvu
      • Stef Mientki
        something for the FAQ ? Stef
        Message 3 of 15 , Dec 1, 2004
          something for the FAQ ?
          Stef

          Wouter van Ooijen wrote:

          >>I think shadowing is not the problem at this moment becasue
          >>there is no jal
          >>port output instruction in his program.
          >>
          >>
          >
          >No shadowing *can* always be a problem when r-m-w instructions are used
          >on a port.
          >
          >
          >
          >>I have seen that some C compiler shadows tris registers (as
          >>default) while
          >>Jal shadows port registers. Is there any difference between
          >>ideas?
          >>
          >>
          >
          >Shadowing port registers solves the r-m-w problem. Shadowing tris
          >registers might be used to avoid bank switching, or (on 12-bit cores) to
          >compensate for the lack of a tris register.
          >
          >Wouter van Ooijen
          >
          >-- -------------------------------------------
          >Van Ooijen Technische Informatica: www.voti.nl
          >consultancy, development, PICmicro products
          >docent Hogeschool van Utrecht: www.voti.nl/hvu
          >
          >
          >
          >
          >
          >
          >Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
        • James Hammond
          Thanks everyone for your help with this , now that I am aware what the problem is , and being a someone who likes a simple solution , I have decided as wouter
          Message 4 of 15 , Dec 1, 2004
            Thanks everyone for your help with this , now that I am aware what the
            problem is , and being a someone who likes a simple solution , I have
            decided as wouter suggests just not to care about the other outputs so
            now I generate the clock from a pin on port a and the drive everything
            else from port c using JAL.

            cheers
            James



            --- In jallist@yahoogroups.com, "Wouter van Ooijen" <wouter@v...> wrote:
            >
            > > bsf 0x07 , 0
            > > bcf 0x07 , 0
            > > ....
            > > ....
            > >
            > > I can get a wave of approx 2.5 mhz which is what I expect since the
            > > pic is running at 20 mhz and executes one instruction per 4 clock
            > > cycles. I am using the square wave as the input clock of a voltage to
            > > frequency converter and the fast I can go the better sample rate and
            > > resolution etc etc
            > >
            > > The problem comes when I am using other pins on the port to drive
            > > other components.
            >
            > Indeed, this works only if you do not care for the output values of the
            > other pins of the same port.
            >
            > Wouter van Ooijen
            >
            > -- -------------------------------------------
            > Van Ooijen Technische Informatica: www.voti.nl
            > consultancy, development, PICmicro products
            > docent Hogeschool van Utrecht: www.voti.nl/hvu
          • Eur van Andel
            ... Very well said. Learn about the RMW problem and you ll see our point. Is there a port in your ... where you can spare a pin so that the rest of the pins
            Message 5 of 15 , Dec 1, 2004
              On Tue, 30 Nov 2004 15:23:12 -0000, "James Hammond" <donmmah@...> wrote:

              >The problem comes when I am using other pins on the port to drive
              >other components.
              Very well said.

              Learn about the RMW problem and you'll see our point.

              Is there a port in your

              >include f877_20

              where you can spare a pin so that the rest of the pins are either input or not
              used? After all, you have 33 output pins.


              --
              Ir. E.E. van Andel, Fine Wire Heat Exchangers, Fiwihex B.V. www.fiwihex.com
              Wierdensestraat 74, NL-7604 BK Almelo, The Netherlands eur@...
              phone +31-546-491106 fax +31-546-491107 mobile +31-653-286573
            • Eur van Andel
              ... Even better: use port e. This port has only three pins. -- Ir. E.E. van Andel, Fine Wire Heat Exchangers, Fiwihex B.V. www.fiwihex.com Wierdensestraat 74,
              Message 6 of 15 , Dec 1, 2004
                On Wed, 01 Dec 2004 10:37:10 -0000, "James Hammond" <donmmah@...> wrote:

                >Thanks everyone for your help with this , now that I am aware what the
                > problem is , and being a someone who likes a simple solution , I have
                >decided as wouter suggests just not to care about the other outputs so
                >now I generate the clock from a pin on port a and the drive everything
                >else from port c using JAL.
                Even better: use port e. This port has only three pins.


                --
                Ir. E.E. van Andel, Fine Wire Heat Exchangers, Fiwihex B.V. www.fiwihex.com
                Wierdensestraat 74, NL-7604 BK Almelo, The Netherlands eur@...
                phone +31-546-491106 fax +31-546-491107 mobile +31-653-286573
              Your message has been successfully submitted and would be delivered to recipients shortly.