40x1 port C power on glitch (on)

RBruceM

New Member
I ran into a problem with my antique diesel engine controller application for the 40x1, and hope someone might have some suggestions.

The port c outputs come up in a semi random state (mostly on) when power is applied. I can immediately set them low, but thats too late for the air solenoid valves they're connected to. The rest of my code is now fully bench tested and ready to go. This condition occurs even with a program consisting of nothing but a low portc 0. The dirsc command makes no difference on this power up sitution.

I could add hardware to eliminate this power on glitch but I'm hoping someone has found a way to have port C come up off, as the default port does...????

TIA
Bruce M
Snowflake, AZ
 
Last edited:

BeanieBots

Moderator
To the best of my knowledge there is nothing you can do in code because it will always define the port first before running any user code.
You will have to implement a hardware solution.
Depending on what you have connected, I would have thought a simple pull-down resistor should do the trick.
 

RBruceM

New Member
Thanks, the glitch is more than just a minor glitch- the outputs will stay high, driving an LED until they are reset in the program. So a pull down resistor alone won't cut it. I'll have to think about how to fix it externally in the easiest manner. Suggestions welcomed.
 
Last edited:

BeanieBots

Moderator
Interesting!
Doesn't sound too clever from a firmware point of view.
I've not used a 40X/1 so have no first hand experience but on other breads the outputs start low and inputs start as inputs (ie floating).
The startup reset state takes 76mS on a 28X. I would guess a similar figure for the 40X.
 

RBruceM

New Member
Yes, I would think that driving the C port pins (semi randomly) during firmware intialization could also fry someone's external input circuits if they weren't expecting it (!). I checked and all of my 40x1's do this. I haven't checked a 28x1 for this problem. C 0 is always on, C 1 often, C 3 sometimes.
 
Last edited:

hippy

Senior Member
Doesn't sound too clever from a firmware point of view.
Yes, I would think that driving the C port pins (semi randomly) during firmware intialization could also fry someone's external input circuits if they weren't expecting it (!). I checked and all of my 40x1's do this. I haven't checked a 28x1 for this problem. C 0 is always on, C 1 often, C 3 sometimes.
Sounds like a bit of an "oops" moment during firmware initialisation to me; all inputs or all outputs low makes sense, so I expect this is an oversight which slipped through the net. Probably worth posting to Feedback or Rev-Ed direct if Technical don't pass a comment in this thread shortly.
 
Top