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

RE: [Jal_developers] FW: Functions for PIC18F452

Expand Messages
  • Wouter van Ooijen
    ... note: this code always enables interrupts, not a good idea! (same for the write) Wouter van Ooijen -- ------------------------------------------- Van
    Message 1 of 9 , Dec 1, 2003
      > procedure eeprom_get (byte in a, byte out d) is
      > assembler
      > MOVF a, w
      > MOVWF EEADR
      > BCF EECON1_EEPGD
      > BCF EECON1_EEFS
      > BCF INTCON_GIE
      > BSF EECON1_RD
      > MOVF EEDATA, w
      > MOVWF d
      > BSF INTCON_GIE
      > end assembler
      > end procedure

      note: this code always enables interrupts, not a good idea! (same for
      the write)

      Wouter van Ooijen

      -- -------------------------------------------
      Van Ooijen Technische Informatica: www.voti.nl
      consultancy, development, PICmicro products
    • Javier Martínez
      Hi Wouter, ... ... and the same in jpic.jal . :-( -- line 929 in jpic.jal loop: btfsc eecon1_wr -- wait for finishing write goto loop bcf eecon1_wren bsf
      Message 2 of 9 , Dec 1, 2003
        Hi Wouter,


        > note: this code always enables interrupts, not a good idea! (same for
        > the write)


        ... and the same in "jpic.jal". :-(



        -- line 929 in jpic.jal
        loop:
        btfsc eecon1_wr -- wait for finishing write
        goto loop
        bcf eecon1_wren
        bsf intcon_gie -- **** !! ****
        bcf status,5
        bcf status,6 -- bank_0
        end assembler

        ...

        -- line 960 in jpic.jal
        loop:
        btfsc f628_EECON1_WR ; wait for finishing write
        goto loop
        BCF f628_EECON1_WREN ; disable write
        BSF INTCON_GIE ; Enable INTs. *** !! ***
        bcf status,5 ; bank_0
        end assembler



        I've already done the changes in JPIC16. I'll try to modify the both
        files by adding a temporary variable to manage the GIE.



        --
        Regards,
        Javi.
        http://www.japus.org
      • Javier Martínez
        Hi, Files updated. I can t find on datasheets nothing about GIE while reading EEPROM, so I erased this from procedures. Updated also flash_put in jpic.jal
        Message 3 of 9 , Dec 1, 2003
          Hi,

          Files updated. I can't find on datasheets nothing about GIE while
          reading EEPROM, so I erased this from procedures.

          Updated also "flash_put" in jpic.jal (only for f877).


          Tested only up to compilation with 0.4.59.


          [PS] P18f458.jal updated with EECON1_CFGS bit. Why?



          --
          Regards,
          Javi.
          http://www.japus.org
        • Wouter van Ooijen
          ... read the 18Fxxx errata Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy,
          Message 4 of 9 , Dec 1, 2003
            > Files updated. I can't find on datasheets nothing about GIE while
            > reading EEPROM, so I erased this from procedures.

            read the 18Fxxx errata

            Wouter van Ooijen

            -- -------------------------------------------
            Van Ooijen Technische Informatica: www.voti.nl
            consultancy, development, PICmicro products
          • japus10
            Hi Wouter, ... OK, it s a work around for a feature . :-) I ll update eeprom_get in JPIC16.JAL only, except you want to modify JPIC.JAL too. ; required
            Message 5 of 9 , Dec 1, 2003
              Hi Wouter,

              > read the 18Fxxx errata

              OK, it's a work around for a 'feature'. :-)

              I'll update eeprom_get in JPIC16.JAL only, except you want to
              modify JPIC.JAL too.


              ; required sequence
              BCF INTCON,GIEH
              BSF EECON1,RD
              MOVF EEDATA,W
              BSF INTCON,GIEH



              Regards,
              Javi
              www.japus.org
            • Wouter van Ooijen
              ... except that you should re-enbale GIEH only when it was set to begin with ! Wouter van Ooijen -- ------------------------------------------- Van Ooijen
              Message 6 of 9 , Dec 1, 2003
                > ; required sequence
                > BCF INTCON,GIEH
                > BSF EECON1,RD
                > MOVF EEDATA,W
                > BSF INTCON,GIEH

                except that you should re-enbale GIEH only when it was set to begin with
                !

                Wouter van Ooijen

                -- -------------------------------------------
                Van Ooijen Technische Informatica: www.voti.nl
                consultancy, development, PICmicro products
              • japus10
                ... with ... Calm! ;-) It s only a copy & paste of the original code. It s like a fast search for me. Regards, Javi. www.japus.org
                Message 7 of 9 , Dec 1, 2003
                  > except that you should re-enbale GIEH only when it was set to begin
                  with
                  > !
                  >
                  > Wouter van Ooijen
                  >


                  Calm! ;-)

                  It's only a copy & paste of the original code. It's like a fast
                  search for me.



                  Regards,
                  Javi.
                  www.japus.org
                • Javier Martínez
                  Hi all, Updated eeprom_get in JPIC16.jal now meets Errata s sheets. -- Regards, Javi. http://www.japus.org ... --
                  Message 8 of 9 , Dec 2, 2003
                    Hi all,

                    Updated eeprom_get in JPIC16.jal now meets Errata's sheets.


                    --
                    Regards,
                    Javi.
                    http://www.japus.org




                    El mar, 02-12-2003 a las 08:05, japus10 escribió:
                    > Hi Wouter,
                    >
                    > > read the 18Fxxx errata
                    >
                    > OK, it's a work around for a 'feature'. :-)
                    >
                    > I'll update eeprom_get in JPIC16.JAL only, except you want to
                    > modify JPIC.JAL too.
                    >
                    >
                    > ; required sequence
                    > BCF INTCON,GIEH
                    > BSF EECON1,RD
                    > MOVF EEDATA,W
                    > BSF INTCON,GIEH
                    >
                    >
                    >
                    > Regards,
                    > Javi
                    > www.japus.org
                    >
                    >
                    >
                    >
                    > To unsubscribe from this group, send an email to:
                    > Jal_developers-unsubscribe@yahoogroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.