Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 2nd June 2009, 05:11 PM   #1
Exclamation help pic 16f84a

i want to make a circuit to make a led turn on when i push the push button

by using these code

void main()
{
TRISA=0B00011111;
TRISB=0;
loop:
if (PORTA.F0==0) { PORTB.F0=1; }
else {PORTB.F0=0; }
goto loop;
}
killer_007 is offline  
Old 2nd June 2009, 07:20 PM   #2
Default

That should be like this
Code:
  void main()
  {
    TRISA=0B00011111;
     TRISB=0;
 loop:
     if (PORTA.0==0) { PORTB.0=1; }
     else {PORTB.0=0; }
     goto loop;
}

Last edited by be80be; 2nd June 2009 at 07:20 PM.
be80be is offline  
Old 2nd June 2009, 07:47 PM   #3
Default

Welcome to the forums. You will need a little bit more code than that in order to make a successful program. What language are you using?

It would be worth looking at Nigel's site WinPicProg Page. He has some very good tutorials that explain how to wire up the hardware. He also uses a more up-to-date PIC that is still produced.
edeca is offline  
Old 2nd June 2009, 10:09 PM   #4
Default

i want the circuit not the code plz

because i want to make it and the code is not a problem
killer_007 is offline  
Old 2nd June 2009, 10:23 PM   #5
Default

Any of the following will help you:

Nigel's PIC Tutorial Switch Board
PIC Tutorial
PIC Tutorial

Have a read and come back with some specific questions. Do you have any parts and a breadboard to practise with?
__________________
Private messages are for personal communication, please do not use them to ask for help.
edeca is offline  
Old 2nd June 2009, 11:12 PM   #6
Default

does there is more simple circuits
killer_007 is offline  
Old 2nd June 2009, 11:23 PM   #7
Default

What's the problem with the circuit? Hook the switch up to the input line, and the led to the output line...
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 2nd June 2009, 11:41 PM   #8
Default

Killer you don't check to see if PORTA.F0 there isn't a port like that on a pic
Here this should get you started
Attached Thumbnails
help pic 16f84a-sw.png  
be80be is offline  
Old 2nd June 2009, 11:52 PM   #9
Default

be8, I did a quick google search there is PIC code out there that refers to the ports exactly as he did.. Might be the compiler.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 3rd June 2009, 12:31 AM   #10
Default

thanxxxxxxxxxxxxxxxxxxxxxxx
every one
killer_007 is offline  
Old 3rd June 2009, 02:21 AM   #11
Default

There some things I haven't tried. mikroC thats it.
be80be is offline  
Reply

Tags
16f84a, pic

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
H e l p me please :S Relay 16f84a tred13 Electronic Projects Design/Ideas/Reviews 3 22nd November 2008 10:27 AM
C++ in PIC 16f84a sheng_james Micro Controllers 6 12th January 2008 07:53 AM
PIC 16f84A problem prasanna_km Electronic Projects Design/Ideas/Reviews 4 26th May 2005 06:01 PM
16F84A urgent iceman83 Micro Controllers 4 8th April 2005 10:23 AM
HELP with 16f84a i2c PIC Dummy Micro Controllers 0 20th February 2004 05:59 PM



All times are GMT. The time now is 08:22 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker