If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
OOps ! I have a big problem : but1 don't work proper ! I double/triple check all ; I change the button, but nothing... After a few press on but1 or EVEN on but2, but1 became inopperating ! If press but2, rel2 go high and but1 stop him, but don't make rel1 high ! Or, if rel2 go low because of overload, but1 don't work not at all ! Must disconnect power source for 're-starting' him...
But2 works verry fine, but but1 don't !!! I really don't understand ! I check everything for so many times, I change even PIC...Please, help...again...![]()
Hi fratello,
2 changes for you to try.
1.turn WDT timer on in your config.
2.You have used: Call check in several places, change them to
GoSub check
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Check the T1CON assignment.
Make sure it has 8-digits.If it's not 8 digits, or if the digits are different, along with disabling the rel1 output on GP5, it may also make it difficult to re-program the chip.Code:T1CON = %00110100
<br>
DT
Thanks for reply ! The code posted by Mr.Darrel works fine with this two modifications :
' @ Sleep
' GPIF=0 'Clear port change interrupt flag
Here are something wrong...and, of course, it's only my fault...
Great !
Now I have a related question for Darrel . . .
Sleep vs @ sleep
PBP vs ASM ?
I tried both on John's T flusher code and only @sleep would work
Am I correct, sleep works with some time designation I. E. Sleep 60 , and @ SLEEP works with interrupts ?
Last edited by Archangel; - 4th August 2009 at 05:19.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
SLEEP vs. @ SLEEP vs. NAP
PBP's SLEEP command is designed to work with the Watch Dog Timer.
It sets the WDT prescaler to an appropriate divisor then internally does an @ SLEEP.
When it wakes-up it decrements a counter and if that counter is still greater than zero, it goes back to sleep.
The processor may have to go through several hundred or even thousands of sleep/wake cycles before execution of the program will resume. It all depends on the specified period.
If the WDT is disabled and you are relying on port change interrupts to wake the PIC it will take just as many of those interrupts before the program resumes execution.
If you are using ASM Interrupts, the ISR will be called on each wake-up. This also may happen several hundred times before the rest of the program can see what happened in the interrupt.
If you are using ON INTERRUPT, no interrupts will be serviced until after the complete SLEEP command has finished.<hr>
@ SLEEP in assembly language, simply puts the processor to sleep for 1 sleep/wake cycle. Program execution will resume immediately on the first wake-up. Or if interrupts are enabled, it will jump to the ISR first, then resume were it left off. Although if interrupts are enabled, you <strike>must have 2 NOP's</strike> should have 1 NOP after the @ SLEEP statement to allow the pipeline to load the ISR's first instruction.<hr>
PBP's NAP command operates much like @ SLEEP, except it changes the WDT prescaler according to the specified period (12F-16F only) before executing an @ SLEEP internally.
It only waits one sleep/wake cycle.
hth,
DT
Thank You Darrel,@ SLEEP in assembly language, simply puts the processor to sleep for 1 sleep/wake cycle. Program execution will resume immediately on the first wake-up. Or if interrupts are enabled, it will jump to the ISR first, then resume were it left off. Although if interrupts are enabled, you must have 2 NOP's after the @ SLEEP statement to allow the pipeline to load the ISR's first instruction.
1 sleep / wake cycle ? still not causing sparks across my synapses, Is that OSC/4, Arbitrary countdown of WDT, something conjured using black cat bones and herbs? AND IF WDT is not enabled, will it sleep forever waiting for an interrupt? And if so will that interrupt wake it up?
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
I change the resistors from transistors base with 2k2 instead 4k7; nothing !!!
I change the transistors (BC337) with others (2SC1815; 2SC9014) but the results are all the time the same : after couple of pressing on but1 OR but2 (doesn't matter !) but2 (and rel2) works fine but but1 (rel1-of course) became inopperating !
Last edited by fratello; - 8th August 2009 at 14:27. Reason: ...picture of two modules
Hi Fratello,
Ok, in the crude drawing I posted, R3 is selected to limit the current going through the relay coil. r1 is selected to limit current going into the transistor's base, and R2 is the trick. R2 needs to be smaller than R3, but not so low a value so as to inhibit the transistors operation. R2 will increase the ON current, but should help drive the transistor to "cut off".
in this link:http://engr.astate.edu/jdg/Electroni...orBiasing.html
Scroll down to Figure 5.
RC is your relay coil represented as a resistor
R1 is the resistor from the pic port, I know it is shown as connected to Vcc, but when your port goes high that is exactly what you have
R2 is the "pulldown resistor, causing cutoff
RE is the current limiting resistor for the load.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
The problem are sure somewhere in the code ! The same code, how I say earlier, work if @SLEEP (and just this command !!!) is disabled !!!
Like in the previous code, which work - for real !- just after adding little pause in different places, I think this code is good, but need...something, I don't know what ! I spend all my day trying different variant of code...with pause from 20 to 100, but useless...I don't lose my hope ! Cheers !
If it is a 78L05 ... then that's where your 3mA is going. (Quiescent Current)
<br>
DT
Bookmarks