Dear All
I need your help. I try to begin my work with microcontroller. As last post I try to follow lesson on http://www.gooligum.com.au/tutorials.html but I have no pic 12f509 so I use 12f675 instead. After I write code as follow
;************************************************************************
; *
; Description: Lesson 1, example 1 *
; *
; Turns on LED. LED remains on until power is removed. *
; *
;************************************************************************
; *
; Pin assignments: *
; GP1 - indicator LED *
; *
;************************************************************************
list p=12F675
#include <p12F675.inc>
; ext reset, no code protect, no watchdog, 4Mhz int clock
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT
;************************************************************************
RESET CODE 0x000 ; effective reset vector
movwf OSCCAL ; update OSCCAL with factory cal value
;***** MAIN PROGRAM
;***** Initialisation
start
movlw b'111101' ; configure GP1 (only) as an output
tris GPIO
movlw b'000010' ; set GP1 high
movwf GPIO
goto $ ; loop forever
END
And I build it success as follow
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.cof".
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.hex".
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F675 "12F675TMPO.ASM" /l"12F675TMPO.lst" /e"12F675TMPO.err" /o"12F675TMP
" /d__DEBUG=1
Message[302] C:\DOCUMENTS AND SETTINGS\SOVANNARITH\DESKTOP\NEW FOLDER (4)\12F675TMPO.ASM 19 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[224] C:\DOCUMENTS AND SETTINGS\SOVANNARITH\DESKTOP\NEW FOLDER (4)\12F675TMPO.ASM 24 : Use of this instruction is not recommended.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" "..\..\..\..\Program Files\Microchip\MPASM Suite\LKR\12f675.lkr" "12F675TMP
" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"mypro01.cof" /M"mypro01.map" /W
MPLINK 4.30.01, Linker
Copyright (c) 2009 Microchip Technology Inc.
Errors : 0
MP2HEX 4.30.01, COFF to HEX File Converter
Copyright (c) 2009 Microchip Technology Inc.
Errors : 0
Loaded C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.cof.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01
Preprocessor symbol `__DEBUG' is defined.
Mon Feb 22 11:21:36 2010
----------------------------------------------------------------------
BUILD SUCCEEDED
The question is that when I compile it to pic and I try to construct circuit to light on the led It still not work. Could you advise me on such problem?
Thank
I need your help. I try to begin my work with microcontroller. As last post I try to follow lesson on http://www.gooligum.com.au/tutorials.html but I have no pic 12f509 so I use 12f675 instead. After I write code as follow
;************************************************************************
; *
; Description: Lesson 1, example 1 *
; *
; Turns on LED. LED remains on until power is removed. *
; *
;************************************************************************
; *
; Pin assignments: *
; GP1 - indicator LED *
; *
;************************************************************************
list p=12F675
#include <p12F675.inc>
; ext reset, no code protect, no watchdog, 4Mhz int clock
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT
;************************************************************************
RESET CODE 0x000 ; effective reset vector
movwf OSCCAL ; update OSCCAL with factory cal value
;***** MAIN PROGRAM
;***** Initialisation
start
movlw b'111101' ; configure GP1 (only) as an output
tris GPIO
movlw b'000010' ; set GP1 high
movwf GPIO
goto $ ; loop forever
END
And I build it success as follow
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.cof".
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.hex".
Clean: Deleted file "C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12F675 "12F675TMPO.ASM" /l"12F675TMPO.lst" /e"12F675TMPO.err" /o"12F675TMP
Message[302] C:\DOCUMENTS AND SETTINGS\SOVANNARITH\DESKTOP\NEW FOLDER (4)\12F675TMPO.ASM 19 : Register in operand not in bank 0. Ensure that bank bits are correct.
Warning[224] C:\DOCUMENTS AND SETTINGS\SOVANNARITH\DESKTOP\NEW FOLDER (4)\12F675TMPO.ASM 24 : Use of this instruction is not recommended.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" "..\..\..\..\Program Files\Microchip\MPASM Suite\LKR\12f675.lkr" "12F675TMP
MPLINK 4.30.01, Linker
Copyright (c) 2009 Microchip Technology Inc.
Errors : 0
MP2HEX 4.30.01, COFF to HEX File Converter
Copyright (c) 2009 Microchip Technology Inc.
Errors : 0
Loaded C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.cof.
----------------------------------------------------------------------
Debug build of project `C:\Documents and Settings\Sovannarith\Desktop\New Folder (4)\mypro01.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.30.01, mplink.exe v4.30.01
Preprocessor symbol `__DEBUG' is defined.
Mon Feb 22 11:21:36 2010
----------------------------------------------------------------------
BUILD SUCCEEDED
The question is that when I compile it to pic and I try to construct circuit to light on the led It still not work. Could you advise me on such problem?
Thank