![]() |
![]() |
![]() |
|
|
|||||||
| 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? |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
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~~ |
|
|
|
|
|
|
(permalink) |
|
PS: I'm using PIC16F877A and 4MHz Crystal Ocs.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
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/ |
||
|
|
|
|
|
(permalink) |
|
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? |
|
|
|
|
|
|
(permalink) |
|
Depending on the IR sensor (is it a 3 lead device) you may need a pullup resistor.
|
|
|
|
|
|
|
(permalink) |
|
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/ |
|
|
|
|
|
|
(permalink) |
|
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... >.< |
|
|
|
|
|
|
(permalink) |
|
try testing the output port with a LED 1st. see weather the port supplies 5V(high)
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
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/ |
||
|
|
|
|
|
(permalink) |
|
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 |
|
|
|
|
|
|
(permalink) | |
|
Quote:
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/ |
||
|
|
|
|
|
(permalink) |
|
There is voltage supply at Vss, the MCLR is connected, but how to i check whether my crystal is working correctly?
|
|
|
|
|
|
|
(permalink) |
|
Are you using PICkit2 to supply the program to your PIC?
__________________
All those who believe in psycho kinesis, raise my hand. |
|
|
|
|
|
|
(permalink) |
|
I use an adapter to supply the power to my PIC development board
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
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/ |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| 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 |