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
 
LinkBack Thread Tools Display Modes
Old 25th November 2007, 03:00 PM   (permalink)
Default Help PIC16F84A

Hi , i wanna turn a led on and then off. and that should be in a loop ..
so i have written a code. is it correct and am i supporsed to to use a cristal. of can i use the internal clock i'm Using PIC16F84A

Please help Me.

code :

__CONFIG _CP_OFF & _WDT_OFF & _BOREN_OFF & _MCLRE_OFF & _LVP_OFF & _INTOSC_OSC_NOCLKOUT & _PWRTE_ON

bsf STATUS,5
movlw 00h
movwf TRISA
bcf STATUS,5

Start movlw 02h
movwf PORTA
movlw 00h
movwf PORTA
goto Start
end
Mihindu_gajaba is offline  
Old 25th November 2007, 03:12 PM   (permalink)
Default

I suggest you lose the antique 16F84, and use a more modern device - and my first tutorial does exactly what you want, using the F84's replacement, the 16F628 - it would be trivial to convert to the 84 if you really had to.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 25th November 2007, 03:47 PM   (permalink)
Default

between movwf PORTA & movlw 00h you must have a delay.and i think there is a porb with your fuses.16f84a doesn't have internal osc.
aristos is offline  
Old 25th November 2007, 04:22 PM   (permalink)
Default

Quote:
Originally Posted by aristos
between movwf PORTA & movlw 00h you must have a delay.and i think there is a porb with your fuses.16f84a doesn't have internal osc.

hey are you sure , that means i have to use an external osc ( Crystal )
Mihindu_gajaba is offline  
Old 25th November 2007, 04:26 PM   (permalink)
Default

yes.and you should have a loop between movwf PORTA & movlw 00h.you can use a rc osc.
aristos is offline  
Old 25th November 2007, 04:28 PM   (permalink)
Default

sorry not loop,a subroutine.
aristos is offline  
Old 25th November 2007, 04:45 PM   (permalink)
Default

Quote:
Originally Posted by aristos
sorry not loop,a subroutine.

rc osc means we're doing what the crystal do by coding right ?
Mihindu_gajaba is offline  
Old 25th November 2007, 05:02 PM   (permalink)
Default

Yep, here's a link, not sure about the 16F84 getting an I/O pin out of the deal though.
PS your program will probably run so fast you wont see it blink.
http://www.mikroe.com/en/books/picbook/2_02chapter.htm
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 25th November 2007, 05:43 PM   (permalink)
Default

Wow thanks
Mihindu_gajaba is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
2 PIC16F84A using only 1 Xtal..? AntRoFiZ Micro Controllers 5 15th May 2007 05:01 PM
Need help 3x4keypad to PIC16F84A microcontroller juan12345 Electronic Projects Design/Ideas/Reviews 2 4th August 2006 01:16 PM
Access to configuration word of PIC16f84a folarinv Micro Controllers 3 19th December 2005 08:43 PM
PIC16F84A INTERFACE WITH MSM6242BRS(PLS HELP ME) Jay Duluguin Micro Controllers 9 18th February 2004 05:20 PM
How to Demux I/O of PIC16f84A? nenayd Micro Controllers 3 22nd October 2003 10:59 PM



All times are GMT. The time now is 02:50 AM.


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

eXTReMe Tracker