C

hello ete

Başlatan cesar35, 12 Temmuz 2012, 14:07:37

cesar35

hello ete
how to configure for this project PIC18F2550
here
include "modedefs.bas"
 
DEFINE OSC 4
RX  VAR BYTE 'VARIAVEL RX
TRISB = %00000000
PORTB = %00000000
TRISC = %10000000
SERIAL VAR PORTC.7


PROG:
SERIN SERIAL,N9600,RX
IF RX = "A" THEN FRE
IF RX = "B" THEN TRA
IF RX = "C" THEN ESQ
IF RX = "D" THEN DIR
IF RX = "E" THEN PARA
GOTO PROG

FRE:
PORTB=%01010000
GOTO PROG

TRA:
PORTB=%10100000
GOTO PROG

ESQ:
PORTB=%01100000
GOTO PROG

DIR:
PORTB=%10010000
GOTO PROG

PARA:
PORTB=%00000000
GOTO PROG

thank you  ;D ;D ;D

ete

#1
Pls. add the following lines to the top of your program.
Pay attention also the 18F series should be compiled by using MPASM assembler.
Open the View menu in MCS and select  "Program & Compiler Options"
Selet the Assembler button and you have to show manually or automatically the path of your MPASM directory.

There is one more job, Open in the MCS the 18F2550.INC file which is in PBPxxx main directory.
You will see on the bottom side the MPASM configuration and similar fuse lines. Put ";" to the most left side of the each line and re-save back that file.

Ete

asm
  __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
  __CONFIG _CONFIG1H, _FOSC_INTOSC_XT_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
  __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _BORV_1_2L & _VREGEN_OFF_2L
  __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
  __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_OFF_3H
  __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
endasm


cesar35

;****************************************************************
;*  18F2550.INC                                                 *
;*                                                              *
;*  By        : Leonard Zerman, Jeff Schmoyer                   *
;*  Notice    : Copyright (c) 2007 microEngineering Labs, Inc.  *
;*              All Rights Reserved                             *
;*  Date      : 11/08/07                                        *
;*  Version   : 2.50a                                           *
;*  Notes     :                                                 *
;****************************************************************
        NOLIST
    ifdef PM_USED
        LIST
        "Error: PM does not support this device.  Use MPASM."
        NOLIST
    else
        LIST
        LIST p = 18F2550, r = dec, w = -311, w = -230, f = inhx32
        INCLUDE "P18F2550.INC"   ; MPASM  Header
        ;__CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
        ;__CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H
        ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
        ;__CONFIG    _CONFIG3H, _PBADEN_OFF_3H
        ;__CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L & 0DFh
        NOLIST
    endif
        LIST
EEPROM_START   EQU   0F00000h
BLOCK_SIZE   EQU   32
thank you
Here where I modify the line
thank you

Powered by EzPortal