Jay.slovak said:So you say, the whole thing works OK?
It only works every now and then..... :cry:
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Jay.slovak said:So you say, the whole thing works OK?
Hmm strange :shock: Try to set all unused PINs to output or leave them as input and ground them...ptewright said:Jay.slovak said:So you say, the whole thing works OK?
It only works every now and then..... :cry:
What type of regulator do you have, something like 7805? Make sure you have those small 100nF Caps there.ptewright said:I decided to change PIC, i'm now using a 16f77, it's a huge 40 pin thing, but it's the only other one I had. Anyway, it works a lot better now. It doesn't reset as often, however, I noticed that the regulator gets super hot, and then it resets, anyway to prevent that?
Jay.slovak said:What type of regulator do you have, something like 7805? Make sure you have those small 100nF Caps there.ptewright said:I decided to change PIC, i'm now using a 16f77, it's a huge 40 pin thing, but it's the only other one I had. Anyway, it works a lot better now. It doesn't reset as often, however, I noticed that the regulator gets super hot, and then it resets, anyway to prevent that?
ptewright said:Yeah, I'm using the LM7805C. From L.Chung's diagram, I switched C1 from 470uF to 33uF, because that's all I had, and I'm using a 100nF for C2 as you suggested. The rest is the same as that last diagram. The motor doesn't seem to run for more than 4 minutes. The regulator heats up after that, then the PIC keeps on resetting.
Nigel Goodwin said:ptewright said:Yeah, I'm using the LM7805C. From L.Chung's diagram, I switched C1 from 470uF to 33uF, because that's all I had, and I'm using a 100nF for C2 as you suggested. The rest is the same as that last diagram. The motor doesn't seem to run for more than 4 minutes. The regulator heats up after that, then the PIC keeps on resetting.
I would suggest the 7805 is overheating, causing the output voltage to drop as it shutsdown.
I presume you're feeding the motor from the 5V rail?, this is causing excessive dissipation in the regulator - try fitting a good sized heatsink on the 7805, or powering the motor from the unregulated supply (depending what voltage it is).
ptewright said:What does the "5V rail" mean? I'm feeding in 12V to the motor as shown in the diagram. I already added a heat sink to it. If I use a 12Vdc adapter that plugs into the wall, is that regulated or not?
eblc1388 said:This wiring can help or even solve your problem.
ptewright said:eblc1388 said:This wiring can help or even solve your problem.
This is exactly what I'm doing.
Is there a way to save some variables in the program just right before it resets, for example if I had a count value. The if the program resets, I just check what that count value is, and I'll know where to pick up from there?
Nigel Goodwin said:If it's reseting you have a problem! - you should fix the problem rather than try to bodge round it. The circuit as you have drawn it doesn't show what the PSU is like - I would suggest a far larger electrolytic on the input of the 7805 (1000uF?), plus small caps on it's input and output.
There's also no way to know when a reset might occur, so you don't know when to save the variables, or even if it will complete saving them?.
You previously mentioned the 7805 was getting hot, you now seem to have ignored that?, is it still happening?.
Yes, it's called Data EEPROM Memoryptewright said:Do PICs have non-volatile memory for storing variables?
ptewright said:A reset rarely occurs, but it would be nice to know if one occured.
Jay.slovak said:Yes, it's called Data EEPROM Memoryptewright said:Do PICs have non-volatile memory for storing variables?
eblc1388 said:ptewright said:A reset rarely occurs, but it would be nice to know if one occured.
So you have gone from PIC always resetting to rarely occurs. The problems just vanished in thin air.
No, I am the ASM guy, I do all stuf in Asemby...ptewright said:Jay.slovak said:Yes, it's called Data EEPROM Memoryptewright said:Do PICs have non-volatile memory for storing variables?
Do you know how to access the eeprom in c code?
ptewright said:Jay.slovak said:Yes, it's called Data EEPROM Memoryptewright said:Do PICs have non-volatile memory for storing variables?
Do you know how to access the eeprom in c code?
Nigel Goodwin said:Your C compiler should have I2C functions built in, they will explained in the user manual - if not you could always write your own?, but you may as well use assembler to do it anyway?. Or get a better compiler?, I don't do C, but from what I've seen I2C support is commonplace.