Added DEFINE and doubled the ADCIN, no change really.
But I did notice a vulnerability in my system. Watch this when I gently touch power leads to the rails.
Added DEFINE and doubled the ADCIN, no change really.
But I did notice a vulnerability in my system. Watch this when I gently touch power leads to the rails.
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!
the problem you see does not exist , its the scopes reaction to having an large antenna [YOUR HAND] capacitively coupled to all of its inputs providing an overwhelming signal on it most sensitive ac input range, the scope is unable to provide the dc bias needed to keep the traces aligned in the overwhelmed state
Warning I'm not a teacher
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!
.I try to keep my development code as close to final as possible, cause I know I'll forget to change stuff back. At least this way I can fire and forget the pin initialization
grounding unused pins and setting them as outputs is pointless , useless and potentially catastrophic
just leaving them as analog is ten times easier and can never do any harm, setting them as input with wpu on is also ok and can never do any harm
if the device is not battery powered its not worth any sort of effort
Last edited by richard; - 4th March 2025 at 04:39.
Warning I'm not a teacher
- digital input,
- weak pull-up ON,
- pin not connected.
I try to stay away from analog settings; no idea why. Maybe cause I started using only digital way back when.
https://skills.microchip.com/introdu...tecture/691929
Unit will always be powered by wall adapter, or possibly USB; but never battery..
Last edited by Demon; - 4th March 2025 at 21:53.
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!
According to this:
https://skills.microchip.com/introdu...tecture/691929
The pull-up is disabled automatically when either TRIS is set to an output or the pin is set as an analog input. These changes to TRIS and ANSEL will override WPU settings.
I can just set all pull-ups ON, leave the unused pins unconnected and forget about them. Then use the others as I wish in ANSEL and TRIS.
The only times I need to be concerned with WPU is on pins that must not be disturbed for whatever special reason.
Code:WPUA = %11111111 '----------------------------------------------------------------' WPUB = %11111111 ' ALWAYS SET WEAK PULL-UPS ON ALL PINS FIRST ' WPUC = %11111111 '----------------------------------------------------------------' ' CHANGES TO ANSEL AND TRIS WILL OVERRIDE AS REQUIRED ' '----------------------------------------------------------------' ANSELA = %00000010 ' Pin A3 = SW input not implemented yet ' Pin A2 = ADC (B5K) not implemented yet ' Pin A1 = ADC (B5K) ' Pin A0 = ADC (voltage divider) not implemented yet ANSELB = %00000000 ANSELC = %00000000 TRISA = %00000010 ' Pin A3 = SW input not implemented yet ' Pin A2 = ADC input 2 not implemented yet ' Pin A1 = ADC input 1 ' Pin A0 = ADC input 0 not implemented yet TRISB = %00000000 ' Pin B7 = ...not available, ICSPDAT ' Pin B6 = ...not available, ICSPCLK TRISC = %11000000 ' Pin C7 = RX *** Datasheet requirement, INPUT *** ' Pin C6 = TX *** Datasheet requirement, INPUT ***
EDIT: I can even leave PORT at the top in case a pin is left as analog output.
Code:PORTA = %00000000 '-------------------------------------------' PORTB = %00000000 ' ALWAYS SET PINS LOW FIRST ' PORTC = %00000000 '-------------------------------------------'
Or did I miss something important...?![]()
Last edited by Demon; - 4th March 2025 at 22:29.
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!
it looks to me that you are creating problems and complications trying to solve a problem that does not exist.
generic pin control solutions will never work for all chips, there are too many chip variations.
pic pins to date always default to inputs, analog if possible. leave them that way unless you need one to be different.
each and every pin you employ needs to configured to suit its usage
mcc makes it easy
![]()
Warning I'm not a teacher
making any measurements on a dc signal other than the ac noise level using a scope that is ac coupled to the dc signal is meaningless
Warning I'm not a teacher
Bookmarks