Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
Thread Tools Display Modes
Old 13th July 2008, 05:21 PM   (permalink)
Default PICBasic Pro

I'm a starter in picbasic language

I tried a simple program but my PIC is unable to supply the 5V accordingly

DEFINE OSC 4

TRISC = %00000010

PORTC = 0

START :
PORTC.0 = 1
IF PORTC.1 = 1 THEN

PORTC.4 = 1

ENDIF

GOTO START

.......pls give me advices on it~~
surferdude89 is offline   Reply With Quote
Old 13th July 2008, 05:25 PM   (permalink)
Default

PS: I'm using PIC16F877A and 4MHz Crystal Ocs.
surferdude89 is offline   Reply With Quote
Old 13th July 2008, 05:47 PM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
I'm a starter in picbasic language

I tried a simple program but my PIC is unable to supply the 5V accordingly

DEFINE OSC 4

TRISC = %00000010

PORTC = 0

START :
PORTC.0 = 1
IF PORTC.1 = 1 THEN

PORTC.4 = 1

ENDIF

GOTO START

.......pls give me advices on it~~
hi,
Whats PORTC.1 connected to.?
You are testing for a high.

On PORTC.4 you should have a 220R in series with a led.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 13th July 2008, 05:57 PM   (permalink)
Default

PORTC.1 is connected to my IR Sensor output, i measured the output of 3V when not reflected and around 0.7V when the signal is reflected.

but now even my PORTC.0 do not supply 5V to my circuit, what could be the problem? is the code wrong?
surferdude89 is offline   Reply With Quote
Old 13th July 2008, 06:07 PM   (permalink)
Default

Depending on the IR sensor (is it a 3 lead device) you may need a pullup resistor.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 13th July 2008, 06:08 PM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
but now even my PORTC.0 do not supply 5V to my circuit, what could be the problem? is the code wrong?
How are you measuring the output on PORTC.4 ?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 13th July 2008, 06:22 PM   (permalink)
Default

i did the circuit seperately by supplying 5 volt to my circuit and then measure the output of the sensor thru an op amp which is 3V

but now i wanted to use the PIC to supply 5V to the circuit but... >.<
surferdude89 is offline   Reply With Quote
Old 13th July 2008, 06:28 PM   (permalink)
Default

try testing the output port with a LED 1st. see weather the port supplies 5V(high)
richiealex is offline   Reply With Quote
Old 13th July 2008, 06:29 PM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
i did the circuit seperately by supplying 5 volt to my circuit and then measure the output of the sensor thru an op amp which is 3V

but now i wanted to use the PIC to supply 5V to the circuit but... >.<
hi,
I would like to help, but I dont understand your explanation.

Do you have a simple drawing you could post.?

What circuit are you trying to supply the 5Volts too.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 13th July 2008, 06:36 PM   (permalink)
Default

sorry for the explanation, let me put it tis way, i wan my PIC to supplied 5V(high) to a single pin(for example PORTC.0) so shud my program write tis way?

TRISC = %00000000
PORTC.0 = 1
surferdude89 is offline   Reply With Quote
Old 13th July 2008, 06:55 PM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
sorry for the explanation, let me put it tis way, i wan my PIC to supplied 5V(high) to a single pin(for example PORTC.0) so shud my program write tis way?

TRISC = %00000000
PORTC.0 = 1
hi,
That should set PORTC.0 high. about +4V

Are you sure that the PIC is running.?
Do you have the MCLR connected correctly.
Is the crystal oscillator working.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 14th July 2008, 02:15 AM   (permalink)
Default

There is voltage supply at Vss, the MCLR is connected, but how to i check whether my crystal is working correctly?
surferdude89 is offline   Reply With Quote
Old 14th July 2008, 02:36 AM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
There is voltage supply at Vss, the MCLR is connected, but how to i check whether my crystal is working correctly?
Are you using PICkit2 to supply the program to your PIC?
__________________
All those who believe in psycho kinesis, raise my hand.

AllVol is offline   Reply With Quote
Old 14th July 2008, 09:25 AM   (permalink)
Default

I use an adapter to supply the power to my PIC development board
surferdude89 is offline   Reply With Quote
Old 14th July 2008, 10:29 AM   (permalink)
Default

Quote:
Originally Posted by surferdude89 View Post
There is voltage supply at Vss, the MCLR is connected, but how to i check whether my crystal is working correctly?
hi,
Checking an osc is not easy without an oscilloscope, you could try another crystal. Do you have any low vlue capacitors connected from the xtal pins to 0V.?

If you are using a prototype board, sometimes the xtal will not oscillate.

The PICbasic program you have posted should set the PORT pin.
As ALLVOL has suggested are you sure the prommer is writing the program to the PIC.?

Try this program,
TRISC = %00000000' all outputs

START :
PORTC= 255' all pins high
GOTO START

END

Lets know what you get.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
PicBasic Pro, PicBasic Plus, Proteus Download sonsivri Micro Controllers 18 6th October 2005 12:11 PM
PicBasic Pro - Is it possible !!!! tracking Micro Controllers 7 19th May 2005 09:18 PM
picbasic PRo 2.44 dip Micro Controllers 1 12th January 2004 02:02 AM
PicBasic bozo Micro Controllers 0 15th November 2003 09:28 AM
help picbasic pro f6ggy Micro Controllers 3 3rd October 2003 08:15 PM



All times are GMT. The time now is 08:46 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.