That’s a bit rough!Last edited by towlerg; Today at 00:38. Reason: old and stupid
It will loose time with temperature, and any supply voltage fluctuation (batteries).
It’s ultra cheap, you can use serial, but not keep or measure time with it.
That’s a bit rough!Last edited by towlerg; Today at 00:38. Reason: old and stupid
It will loose time with temperature, and any supply voltage fluctuation (batteries).
It’s ultra cheap, you can use serial, but not keep or measure time with it.
That’s an interesting find.
You could probably cycle the calibration value at run time then.
You could probably calibrate it yourself with a good freq counter,Code:for value = mincalvalue to maxcalvalue calvalue = value turn led on pause turn led off pause next value
and double check their work or what they thought was operating temperature.
Does anyone have an answer to the original question?
I'm trying to clean up code and wondering just how much we should pause at program start. I have code with pauses of all sorts of lengths.How long does it take for an 8 bit PIC to stabilize after Power-up?
How about:
- without LCD
- with standard 4x20 LCD
16F18877, also an 8-bit PIC.
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
a pic is ready as soon as its osc is stable; as discoverable from the oscstat reg, a handful of microseconds at worstHow about:
- without LCD
- with standard 4x20 LCD
a LCD can take 100's of milliseconds, 500 not uncommon. its not the same across version/model/maker either
its usually pretty obvious when you have tried to talk to a LCD before its listening
i feel you have the cart before the horse
Warning I'm not a teacher
Up to this moment I did not had any special needs for a fast power up, so the 1 sec pause worked just fine for me.
But I am pretty sure that each osc will have its own time to stabilise. So, for 18877, page 112 of the datasheet, says that there is a timer named OST (Oscillator Startup Timer) that counts 1024 cycles of from OSC1, if the Oscillator is set to LP, XT or HS (all these are external oscillators).
For any case of oscillator selection (internal or external), there is OSCSTAT register that displays the status of that module in the appropriate bits (page 122).
Page 603 shows the wake up time that any osc selection needs.
Other PIC have same data also, so you may look accordingly.
Ioannis
HFINTOSC is typically 11usec to 20usec max (I don't sleep the PIC)
So PAUSE 1 should be more than sufficient for a PIC without LCDs...?
(I wouldn't bother with PAUSEUS if I don't have to).
Using:
Code:#CONFIG __config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_OFF & _FCMEN_ON __config _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON & _DEBUG_OFF __config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_OFF & _WDTCWS_WDTCWS_7 & _WDTCCS_LFINTOSC __config _CONFIG4, _WRT_OFF & _SCANE_available & _LVP_OFF __config _CONFIG5, _CP_OFF & _CPD_OFF #ENDCONFIG
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
If you do not have any LCDs or other peripherals that need time to settle, I am sure that you do not need any delay in your program. If the program reached the first command then the PIC just woke up!
The problem is with other circuits connected to the PIC and are still under Reset period. PIC will not be able to communicate with this only device.
Ioannis
Yeah, hadn't put any thought into MCP23017 requirements.
Gonna have to look at those datasheets.
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
Bookmarks