I'm trying to build a program to read an analog channel and send the data throught the UART. I'm missing some delay routines, as well as a routine to rotate through the four channels I want to sample. I'm assuming f=10MHz. For the moment I'm trying to get it to run on MPLAB v7 's simulator. However, I get the following error: MPLINK 3.90, Linker Copyright (c) 2004 Microchip Technology Inc. Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x0000003a Errors : 1 Can anyone help me with this error and/or give suggestions to improve my code/have it do what it's supposed to do? Thanks, Alex Here is my code so far: ;****************************************************************************** LIST P=18F452, F=INHX32 ;directive to define processor and file format #include ;processor specific variable definitions ;****************************************************************************** ;Configuration bits ; The __CONFIG directive defines configuration data within the .ASM file. ; The labels following the directive are defined in the P18F452.INC file. ; The PIC18FXX2 Data Sheet explains the functions of the configuration bits. ; Change the following lines to suit your application. __CONFIG _CONFIG1H, _OSCS_OFF_1H & _RCIO_OSC_1H __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H __CONFIG _CONFIG3H, _CCP2MX_ON_3H __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L __CONFIG _CONFIG5H, _CPB_ON_5H & _CPD_OFF_5H __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L __CONFIG _CONFIG7H, _EBTRB_OFF_7H ;****************************************************************************** ;Variable definitions ; These variables are only needed if low priority interrupts are used. ; More variables may be needed to store other special function registers used ; in the interrupt routines. UDATA WREG_TEMP RES 1 ;variable in RAM for context saving STATUS_TEMP RES 1 ;variable in RAM for context saving BSR_TEMP RES 1 ;variable in RAM for context saving UDATA_ACS EXAMPLE RES 1 ;example of a variable in access RAM ;****************************************************************************** ; Macros MOVLF macro literal,dest movlw literal movwf dest endm ;****************************************************************************** ;Reset vector ; This code will start executing when a reset occurs. ;RESET_VECTOR CODE 0x0000 org 0x000 goto Main ;go to start of main code ;****************************************************************************** ;Start of main program ; The main program code is placed here. Main: rcall Initial Loop ; A/D Channel 1 MOVLF B'01000001',ADCON0 ;WAIT 15 uS bsf ADCON0,2 ;start! ;WAIT 20 uS ; Label result - this inserts the channel number on the unused ADRSH bits! movlw ADCON0 andlw B'00111000' iorwf ADRESH,F ;Send Result ; Check PIR 1 <4> is SET movff ADRESH,TXREG ; Check PIR 1 <4> is SET movff ADRESL,TXREG bra Loop ; Initialization Initial ; A/D MOVLF B'11001000',ADCON1 MOVLF B'01000001',ADCON0 ; UART MOVLF B'10000000',TRISC MOVLF D'10',SPBRG MOVLF B'00100100',TXSTA MOVLF B'10000000',RCSTA MOVLF B'00000000',PIE1 return ;****************************************************************************** ;End of program END -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist