You've writtenTry removing the colon as that's not supposed to there.Code:GOTO Mainloop:
You've writtenTry removing the colon as that's not supposed to there.Code:GOTO Mainloop:
I'll ask again - why does my program leave the mainloop?
porta.1 goes high and low..continuously
its a classic RMW (read modify write error) i expect the load on porta.1 exceeds the
ability of the pic to maintain the logic level.
if your chip has latx regs use them
'OUTPUT PORTA.4
'OUTPUT PORTA.1
'becomes
out1 var lata.4
out2 var lata.1
trisa = % 11101101
'HIGH PORTA.1
'becomes
out2=1
PAUSE 10000
mainloop:
'HIGH PORTA.4
out1=1
'LOW PORTA.1
out2=0
GOTO mainloop
Warning I'm not a teacher
Well I feel like an idiot.
I connected a 2.5 ohm 100 watt resistor as my load instead of the electronic load (5 amps).
No issues....works like it should. So the electronic (programmable) load must be the culprit. I could get the scope out and find out if its really introducing excess current draw and/or spikes on my supply.
What did I learn?
How to setup the 16F15324 registers and use the LAT function instead of port(x)...
Slow down and organize my code, schematic, and the real issue before throwing crap at you guys.
Dont be so sensitive to critique...
And the Cubs still suck.
Last edited by pescador; - 4th June 2023 at 16:42.
My dad never liked you...
for that type of thing, I would think a relay would be appropriate.
![]()
The massive output FETs are to supply 12V to service vehicle equipment. Its an automotive environment, but - by the time it gets to my circuit, the voltage is isolated from the alternator noise, etc, etc..
My circuit actually works in the field - somehow - which tells me that my electronic load is the culprit. So I'm changing my load to something that emulates my true load in the field. I have some police car flasher lights coming.
That being said, I want to know why this particular type of load resets my PIC. Good to know stuff.
At first I thought with the 16F15324 I was setting up the registers wrong - a software reason. Using port instead of latch feature for example. Richard showed me how to setup registers properly but problem still exists.
Beefy PS - I use a 15amp supply, but if load shorts in first milliseconds the draw is much higher than 15 amps. Thats why if the load is on first the inrush current draw has passed. I think that makes sense. If I used a car battery would the result be the same? I need to try that.
BTW - Its amazing how you PICBASIC guys know things about PICBASIC code. I'm like - "how in the world did you figure that out" ! Its like you have this magic code book. (I know - its in the docs)..I guess if you do it enough it.......
for example - from another thread :
ansela = ~ 16
lata = ~ 16
trisa = ~ 16
Get the scope out. - should be my quote on my forum slogan
Last edited by pescador; - 4th June 2023 at 14:02.
My dad never liked you...
After what you have seen ... I wouldn't even try !!!
that means your electronic load draws lots of current @ start ( called an overshoot ) and you are not sure it's internal circuits can withstand, say, 40, 50 or more Amps the car battery could easily give ...
" magic smoke " probably in sight ...
Glad you got it in the end ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
No hard feelings. We are here to help each other and not to argue or fight. More info you give the better the answer you 'll get.
It the first time that I see you use electronic load to test the circuit. So, what is that load? DIY or a ready made device? How is that set up? Can you adjust it?
Ioannis
Bookmarks