PDA

View Full Version : Load needed for circuit to work ?



lerameur
- 5th May 2012, 01:26
Hi,

I discovered a new problem which I never seen or heard of before. My circuit works fine with the LCD hooked up. I removed the LCD restart and the pins output goes haywire..
I removed all the coding concerning the LCD in the program, did not work. Turns out, if I do not have 56 ohm resistance between the positive and negative, the circuit will not function properly. This resistance also need to be placed on the MCLR / ground rail !!!

here is the code I have, but I am not sure this will make a difference because the code does work with the 56ohm resistance..

'using a pic16F88 - on cart trial module.
' MPASM Header


INCLUDE "modedefs.bas"
OSCCON = %01110000 '8 Mhz
Define OSC 8

CMCON = 7 : ANSEL = 0 : ADCON1 = 7


' Define ADCIN parameters
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS

ADCON1 = %00000010 'for 8 bit


value var word : variable var word : i var byte

'TRISA = %00000000 ' Set PORTA to all output
TRISB = %10000000
PORTB.1 =0
PORTB.2 =0
PORTB.3 =0
PORTB.4 =0

mainloop:

ADCON0.2 = 1 'Start Conversion
ADCIN 6, value 'Read channel PORTB.7
pause 100

variable = 256 -value
variable = variable *14
pause 30


i=1
while i<=variable
PORTB.1 =1
PORTB.2 =1
PORTB.3 =1 'green led
PORTB.4 =0 'red led
i=i+1
pause 1000
wend

i=1
while i<=variable
PORTB.1 =0
PORTB.2 =0
PORTB.3 =0 'green led
PORTB.4 =1 'red led
i=i+1
pause 1000
wend


goto MAINloop

end

spcw1234
- 5th May 2012, 01:35
Have you measured your supply voltage without a load on it? It could be to high...

lerameur
- 5th May 2012, 01:41
I have an LM7805, so it is 5v., its pulling about 140mA with the resistor, which half of the current comes from the resistor.

Ramius
- 5th May 2012, 01:43
Hi Lerameur!
Your description is a little confusing. From my experience, MCLR (pin 4) is typically tied to +5v thru a 10K resistor. Pin 5 should be ground and pin 14 should be +5v. A 56 ohms will draw about .089 amps so for all intents and purposes it is almost a short! Do you have maybe a one-line (schematic) of how you have things wired? Also what type of power (+5v) source are you using? Best, Ed

Ramius
- 5th May 2012, 01:49
Hi Lerameur!
As I was answering your post my second question was answered, you are using a 7805. So the next question would be did you install the .1mfd and some other value capacitors on the output of the 7805? The reason I ask is that 7805's as well as other voltage regulators will oscillate if there are no capacitors. Once the oscillations start eveything will act "spritual" (technical term) as the PIC is basically being powered by a form of AC and not pure DC! Best, Ed

lerameur
- 5th May 2012, 01:52
Ooo. thank you for your help Ramius, I forgot to put the capacitor. what a difference this little thing can do. Works good now.

Archangel
- 6th May 2012, 09:48
Once the oscillations start everything will act "spiritual" (technical term) as the PIC is basically being powered by a form of AC and not pure DC! Best, Ed
Thanks for that Ed, The term "spiritual" best description ever I think.