From PICLIST@MITVMA.MIT.EDU Thu Nov 14 22:11:19 2002 Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-7.13) id A00713C20084; Thu, 14 Nov 2002 22:11:19 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <12.007DAE20@cherry.ease.lsoft.com>; Fri, 15 Nov 2002 0:57:18 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8d) with spool id 8643 for PICLIST@MITVMA.MIT.EDU; Fri, 15 Nov 2002 00:57:03 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 2152; Fri, 15 Nov 2002 00:04:16 -0500 Received: from ALPHA9.CC.MONASH.EDU.AU [130.194.1.9] by mitvma.mit.edu (IBM VM SMTP Level 320) via TCP with ESMTP ; Fri, 15 Nov 2002 00:04:15 EST X-Comment: mitvma.mit.edu: Mail was sent by ALPHA9.CC.MONASH.EDU.AU Received: from splat.its.monash.edu.au ([130.194.1.73]) by vaxh.cc.monash.edu.au (PMDF V5.2-31 #39306) with ESMTP id <01KOWI8TF74K90900K@vaxh.cc.monash.edu.au> for PICLIST@MITVMA.MIT.EDU; Fri, 15 Nov 2002 16:03:25 +1100 Received: from splat.its.monash.edu.au (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 5A8D71300B7 for ; Fri, 15 Nov 2002 16:03:25 +1100 (EST) Received: from eng.monash.edu.au (civ-tnixon.eng.monash.edu.au [130.194.129.127]) by splat.its.monash.edu.au (Postfix) with ESMTP id 405D51300B2 for ; Fri, 15 Nov 2002 16:03:25 +1100 (EST) X-Sender: "Tony Nixon" MIME-version: 1.0 X-Mailer: Mozilla 4.79 [en]C-CCK-MCD monwin/025 (Windows NT 5.0; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en References: <001301c28c5f$3335f0b0$0305a8c0@bigstud.compsecurity.com> <007a01c28c61$f00c9cf0$3b64a8c0@tdcinternal.com.au> Message-ID: <3DD4801E.6852F62E@eng.monash.edu.au> Date: Fri, 15 Nov 2002 16:03:26 +1100 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Tony Nixon Organization: Monash University Subject: Re: [PIC] First Program Blues. Please Help. To: PICLIST@MITVMA.MIT.EDU X-RCPT-TO: Status: R X-UIDL: 277600590 X-Evolution-Source: pop://mailinglist%40farcite.net@mail.farcite.net/ X-Evolution: 00000728-0000 Heres a simple program you can test with. It assumes you have a 4MHz crystal as a clock source. LED is connected to PORTA pin RA0 All other IO pins are disconnected. ; list P = 16F84A ; include "P16f84A.inc" ; ------------------ ; CONFIGURATION FUSE ; ------------------ ; __CONFIG _CP_OFF & _HS_OSC & _WDT_OFF & _PWRTE_OFF ; ; CRYSTAL SPEED = 4000000Hz ; CBLOCK 0x0C NaHi NaLo NbHi NbLo ENDC ; ; ------------- ; PROGRAM START ; ------------- ; clrf PORTA ; port pins are ALL OUTPUTS LOW clrf PORTB bsf STATUS,RP0 clrf TRISA clrf TRISB bcf STATUS,RP0 MainLoop bsf PORTA,0 ; turn the LED on call Delay ; wait a bit bcf PORTA,0 ; turn the LED off call Delay ; wait a bit goto MainLoop ; keep doing this loop ; ; DELAY SUBROUTINE ; Delay movlw 01h movwf NbHi movlw 03h movwf NbLo movlw 8Ah movwf NaHi movlw 5Bh movwf NaLo DeLoop0 decfsz NaLo,F goto DeLoop0 decfsz NaHi,F goto DeLoop0 decfsz NbLo,F goto DeLoop0 decfsz NbHi,F goto DeLoop0 ; return end -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.