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.

PICBasic Pro

Status
Not open for further replies.

surferdude89

New Member
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~~
 
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.
 
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?
 
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... >.<
 
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.?
 
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
 
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.
 
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.:)
 
ericgibbs thx for the help! now i tin i get the meaning

i always put PORTC = 1 and wondering y only 1 pin is high

now i know need to put PORTC = 255 :p

anyway thx for the help
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top