Menu

Strange issue ....

jackjames
2023-09-08
2023-09-09
  • jackjames

    jackjames - 2023-09-08

    I forgot the subject :(
    I know ... I always find problems ... sorry!
    I detected a strange problem that occurs with a pic12f683:
    I use the GP5 port to pilot an active buzzer.
    This door works well until the timer1 is imposed, then it no longer reacts to programming.
    In the code that I attach (I cut the rest and left only the code that creates the problem) I added two loops that perform a flashing to check the ASM which, however, seems to me ok.
    The line that calls the sub that creates this problem is highlighted in the source.
    If this line is commented, the program turns well, otherwise the GP5 does not work.
    I therefore attach the source and the Asm list.

     

    Last edit: jackjames 2023-09-08
  • Anobium

    Anobium - 2023-09-08

    I can take a look.

    Try the attached HEX. This was created using PIC-AS as the assembler rather than GCASM. This will help understand if this is or is not a GCASM issue.

    Using PIC-AS will isolate the issue to the preprecossor or the chip specific compiler.

    Test and let me know the result.

    P.S. I change the title.... :-)

     
  • Anobium

    Anobium - 2023-09-08

    And, attached is a changed program to test. I am trying to isolate the issue because in the simulator there is no issue.

    This test has no I2C to the LCD. Does this resolve? If is does then it could be in the I2C routines.

     
  • jackjames

    jackjames - 2023-09-08

    Unfortunately the problem occurs.
    If I don't call the TempoTimer1 routine where the registers are set to activate the timer1, the circuit works perfectly.
    So the problem arises when the T1CON register is touched or the TMR1H TMR1L register.
    I thought it was a problem of microcontroller but occurs on three different microcontrollers.

     
    • Anobium

      Anobium - 2023-09-08

      Remove the CLS and PRINT lines. What happens?

      I know you think this is related to Timer1 but I think not.

       
  • Anobium

    Anobium - 2023-09-08

    A thought.. do you have the I2C pullups fitted? Does pulling GP1 high permit the LEDs to flash?

    Not having SCL pulled high would cause the i2C bus to halt.

     
  • Anobium

    Anobium - 2023-09-08

    Or, change LCD_IO from 10 to 4. Test.


    I am asking because I can see the LEDs are not flashing here and I am trying to isolate the issue.

     
  • jackjames

    jackjames - 2023-09-08

    Now I'm not at home, as soon as possible I perform these tests and let you know.

     
  • jackjames

    jackjames - 2023-09-08

    The I2C bus works very well and also the Print on the LCD display.
    PulluP's resistance on the bus are there.
    The offending exit, GP5, perfectly pilot the LED.
    The LCD display works very well both when the problem is created by setting the T1Con register, and when T1con is not set and the output on GP5 is ok.
    LCD_io 4 it is not possible to use it because the micro has only 6 doors.

     
  • Anobium

    Anobium - 2023-09-08

    Please set to LCD_IO 4. You dont need any connection.

     
  • jackjames

    jackjames - 2023-09-08

    Errors have been found:

    Error: LCD Parameters not setup correctly - please correct the LCD setupSYSLCDTEMP.0, or your Defined CONSTANT, is not a valid I/O pin or port
    Error: LCD Parameters not setup correctly - please correct the LCD setupSYSLCDTEMP.1, or your Defined CONSTANT, is not a valid I/O pin or port

     
    • Anobium

      Anobium - 2023-09-08

      So, sorry. Try LCD_IO 0

       
  • jackjames

    jackjames - 2023-09-08

    NO WAY. The problem remains.

     
    • Anobium

      Anobium - 2023-09-08

      I have the chip here. I tried and as yet not replicated.

      The I2C looked highly likely to be the cause.

      What is the exact circuit? what programmer? You seem to have something attached to MCLRE.. so, how are you physically programming?

       
      • jackjames

        jackjames - 2023-09-08

        I program with pickit3 and pickit3 programmer.
        However, I remove the micro from the circuit and plan it, the pickit is not connected to the circuit.
        McLR is used as input to read the pressure of a key.
        I am attaching the part of the source that creates the problem where you also find the very simple scheme of the micro connections.

         
      • jackjames

        jackjames - 2023-09-08

        I commented all the references to the I2C bus and the display, the problem remains.

         
        • Anobium

          Anobium - 2023-09-08

          I will look on Monday.

           
          • jackjames

            jackjames - 2023-09-08

            Ok have a good weekend

             
          • jackjames

            jackjames - 2023-09-08

            It doesn't depend on the compiler.
            I wrote the same program in MikroBasic leaving out the LCD section and it gave the same problem.
            Thinking that maybe they are my micros, I used a pic12f629 that I had in the drawer and it has a similar architecture to the 12F683: The result is the same.
            So, is it possible that it is a micro-specific problem?

             
            • Anobium

              Anobium - 2023-09-09

              Clean the code option. Removal the register settings, specifically remove OPTION_REG = 0 Ansel etc. (They are all managed by GC BASIC anyway ) but to need to isolate this issue for you.

              I did not reproduce here. Check voltages and remove the input from the MCLR ( whilst trying to isolate this issue ).


              Off to Goodwood Revival today. The only historic motor race meeting to be staged entirely in a period theme, Goodwood Revival is an immersive celebration of iconic cars and fashion. It will be fun.

               
  • Anobium

    Anobium - 2023-09-09

    A new baseline for you. Does thos operate the LEDs?
    I have cleaned out the program so we can focus on the base code.
    It works here.

     

    Last edit: Anobium 2023-09-09

Log in to post a comment.