![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) | |
| Quote:
hey are you sure , that means i have to use an external osc ( Crystal ) | ||
| |
| | (permalink) |
| yes.and you should have a loop between movwf PORTA & movlw 00h.you can use a rc osc. | |
| |
| | (permalink) |
| sorry not loop,a subroutine. | |
| |
| | (permalink) | |
| Quote:
rc osc means we're doing what the crystal do by coding right ? | ||
| |
| | (permalink) |
| 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 ![]() | |
| |
| | (permalink) |
| Wow thanks | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| 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 |