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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Clean the code option. Removal the register settings, specifically remove OPTION_REG = 0Ansel 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.... :-)
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.
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.
Remove the CLS and PRINT lines. What happens?
I know you think this is related to Timer1 but I think not.
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.
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.
Now I'm not at home, as soon as possible I perform these tests and let you know.
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.
Please set to LCD_IO 4. You dont need any connection.
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
So, sorry. Try LCD_IO 0
NO WAY. The problem remains.
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?
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.
I commented all the references to the I2C bus and the display, the problem remains.
I will look on Monday.
Ok have a good weekend
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?
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.
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