Hello from Argentina! Excellent work with GCB.
I'm testing the Millis library and I can't get it to work on a PIC18F4520, it compiles fine but the LED doesn't blink.
All the other examples I tried work fine.
Greetings, Adrian.
Good evening, sorry for the delay in responding.
I tried the script and it didn't work, so I read the "millis.h" library and saw that Timer0 doesn't start on the 18F4520.
I added the line to start Timer0 "InitTimer0 Osc, PS0_16" to the code using the oscillator speed in "PS0" and it started working.
Thanks for the quick reply.
Good evening, I tried the modified "millis.h" library without adding "InitTimer0" to the code. Tested on PIC12F629, 675, 683; 16F84A, 628A, 88, 818, 873A; 18F4520, 18f4620 and it works perfect.
Thank you very much Anobium, for the quick response.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello from Argentina! Excellent work with GCB.
I'm testing the Millis library and I can't get it to work on a PIC18F4520, it compiles fine but the LED doesn't blink.
All the other examples I tried work fine.
Greetings, Adrian.
Good spot, looks like these 18F chips have not tested with this function.
As I do not have one of these chips please add script to your program, as shown below.
This will treat all the library references to TOCON1 to TOCON for these chips.
Please test and let me know if this resolves as we should add to timer.h library... if it works.
Good evening, sorry for the delay in responding.
I tried the script and it didn't work, so I read the "millis.h" library and saw that Timer0 doesn't start on the 18F4520.
I added the line to start Timer0 "InitTimer0 Osc, PS0_16" to the code using the oscillator speed in "PS0" and it started working.
Thanks for the quick reply.
Last edit: Adrian 2023-10-21
Thank you, but this is a good workaround.
Try the revised millis.h library and remove the InitTimer0 line from the main program.
The issue was the script that determines whether a chip has a Pre and Post scaler was incorrect for your chip family.
Try, test and let me know if resolved.
Last edit: Anobium 2023-10-21
Good evening, I tried the modified "millis.h" library without adding "InitTimer0" to the code. Tested on PIC12F629, 675, 683; 16F84A, 628A, 88, 818, 873A; 18F4520, 18f4620 and it works perfect.
Thank you very much Anobium, for the quick response.