> From: Tom Dickinson[SMTP:tmdickin@OPTONLINE.NET] > Sent: Friday, January 23, 2004 6:09 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: Trouble assembling code for 16F84A > I'm new to PIC programming and my problem is that the assembler (both > MPLAB and MPASMdos) doesn't seem to load the internal register > definitions from the 16F84A.inc file. I would hate to have to declare > all these registers as equates in my source file. > Here is the first part of my code. I tried to copy exactly the format > shown in the "MPLAB IDE v6.xx" Quick Start doc. > title RADCNT07 -Measure time between rad mon counts, calc mr/hr > ; > ; This program uses TMR0 overflow interrupt to increment 16 bit > ; register (timer). When a count comes in from the radiation monitor, the > ; value in timer is divided into a 16 bit constant to give an 8 bit number > ; corresponding to the radiation level (quotient of 256 = 5 mr/hr). The > ; 8 bit number is put out on portb and a R-2R resistor ladder provides an > ; analog level, 256 = 5 volts, 1 = .02 volts. This is displayed on a DVM. > ; > > ; Tom Dickinson > ; 01/21/04 > ; > list P=PIC16F84A, R=DEC > #include > ; > __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON > ; registers > CBLOCK 0x020 > timer:2 ;16 bit running time count > radtime:2 ;16 bit time between rad monitor counts > temp:2 ;16 bit register used in compare and divide routines > radval:2 ;calculated radiation level; 256 = 5 mr/hr > radconst:2 ;constant divided by radtime to give radval > . . . . . My copy of the MPASM manual shows the correct form of the include directive as include The pound sign "#" is not accepted. I don't know why some of the symbols in the file may be defined in the symbol table. Perhaps MPASM predefines some of the more common symbols, such as "W" and "F". John Power -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body