Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

At my wits end

Status
Not open for further replies.
In the labs at uni, or at home. It triggers an LED on the outputs though, so it is obviously triggering it. Or is the output somehow (linearly?) related to the input voltage?
 
zanes said:
In the labs at uni, or at home. It triggers an LED on the outputs though, so it is obviously triggering it. Or is the output somehow (linearly?) related to the input voltage?
hi,
No, there is no relationship between the digital input and output voltages.
When you say it triggers an LED, do you mean it lights an LED.?

Can you post a diagram on how you have connected one LDR and one output pin, just a quick sketch would do, include all the components connected to the input and output pin.

As you are driving an H Bridge, why are toggling the output pin at such a high rate.? rather than at a fixed voltage level.
At a rough estimate, the Port output pin is toggling around 30KHz.!
 
Hmmm.... I think the problem may lie in my hbridge, as I have just been doing some testing with the PIC loaded up, and I've got some weird results. I'll probably cop out and buy a controller IC!
Yes, it lights an LED. The reason I have my program setup this way is that is the easiest way I could think of implementing my design on my PIC!
 
zanes said:
Hmmm.... I think the problem may lie in my hbridge, as I have just been doing some testing with the PIC loaded up, and I've got some weird results. I'll probably cop out and buy a controller IC!
Yes, it lights an LED. The reason I have my program setup this way is that is the easiest way I could think of implementing my design on my PIC!

hi,

Code:
Main
	[B];bcf porta,0 ;turns both 
	;bcf porta,1
	;bcf portb,0 ;motors off
	;bcf portb,1[/B]
	btfsc porta,2 ;tests light on right LDR
	goto rightlight		;if light,goto rightlight 
             [B]bcf portb,0;;turn off if not called[/B]
	btfsc porta,3 ;tests light on left LDR
	goto leftlight		;if light,goto left light
	[B]bcf porta,0;turn off if not called [/B]
	goto Main
rightlight

Make these small changes to the program, the outputs dont toggle, they stay high when called and go off if not called.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top