For PM
FOR MPASMCode:@ device pic12F683, xt_osc, wdt_on, mclr_on, protect_off
Code:@ __config _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
For PM
FOR MPASMCode:@ device pic12F683, xt_osc, wdt_on, mclr_on, protect_off
Code:@ __config _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
Dave
Always wear safety glasses while programming.
Hi there,
Run into more problems now lol. With 'use mpasm' unticked, I can no longer use mplab ide to build/upload the file to the pic. It gives a stream of errors.
However, if I tick the 'use mpasm' again, I get errors in picbasic pro:
Warning[207] e:\.......\sertest.asm 93 : Found label after column 1. (device)
Error[122] e:\.......\sertest.asm 93 : Illegal opcode (pic12F683)
for code:
#####################################
@ device pic12F683, xt_osc, wdt_on, mclr_on, protect_off
DEFINE OSC 4
Include "modedefs.bas"
OSCCON = %00001000
ANSEL=0
CMCON0=%00000111
pw var byte
led var gpio.4
OSCCON=%01110000
oldpwm var byte
#########################################
etc...
I think I basically don't understand how these applications work together creating multiple files that are all linked together... I come from the old school - one program and run!![]()
oooh further to my last I think I misunderstood what you said Dave... so I switched to the:
@ __config _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
and now the error I get in the compiler is Error[118] e:\....\sertest.asm 93 : Overwriting previous address contents (2007)
?!
Is this perhaps related to my program and not this config aspect?
OPEN YOUR PBP FOLDER AND FIND 12F683.INC
YOU WILL SEE
CHANGE THE RED PART AFTER ELSE TO THIS ;Code:NOLIST ifdef PM_USED LIST include 'M12F683.INC' ; PM header device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off XALL NOLIST else LIST LIST p = 12F683, r = dec, w = -302 INCLUDE "P12F683.INC" ; MPASM Header __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON &_CP_OFF NOLIST endif LIST
AND YOU DONT NEED TO WRITE "@ DEVICE" STATEMENT AT THE BEGINNING OF YOUR CODE ANYMORE.Code:NOLIST ifdef PM_USED LIST include 'M12F683.INC' ; PM header device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off XALL NOLIST else LIST LIST p = 12F683, r = dec, w = -302 INCLUDE "P12F683.INC" ; MPASM Header __config _XT_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF NOLIST endif LIST
Excellent!!! I was just reading another persons similar problem and was trying to track it down. Many thanks for that. It does indeed now compile and MPLAB IDE lets me upload the code to the PIC.
Out of interest, is there any way that I can check if the thing has actually switched to the external oscillator [short of removing the oscillator!] by looking at the assembler file?
Many thanks all for help with this - has been bugging me for hours!![]()
COOL!!!
You are using MPLAB!!!!
Tool bar - configure - configuration bits.
That shows the current sttings.
Dave
Always wear safety glasses while programming.
Haha, you make it sound soooooooooo easy :P
'XT'Cheers
I was hoping that this would help with my serial comm's issue but it hasn't lol. Maybe try another PIC, one with a serial interface built in perhaps?!
I'll persist with this PIC for now and try to do some error-checking handshaking.
I can say that I've definitely learned something today
Best regards to all
J.
In my opinion forget about using PM, always use MPASM. Later PM will nor work when you get into different things.
Now I forgot to tell you when you set the fuses in code space you will have to comment out some lines in the chips *.inc file that is in the PBP directory.
http://www.picbasic.co.uk/forum/showthread.php?t=543
Or you can modify the *.inc file.
My inc for this chip looks like this.
Code:;**************************************************************** ;* 12F683.INC * ;* * ;* By : Leonard Zerman, Jeff Schmoyer * ;* Notice : Copyright (c) 2005 microEngineering Labs, Inc. * ;* All Rights Reserved * ;* Date : 08/31/05 * ;* Version : 2.46a * ;* Notes : * ;**************************************************************** NOLIST ifdef PM_USED LIST include 'M12F683.INC' ; PM header ; device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off XALL NOLIST else LIST LIST p = 12F683, r = dec, w = -302 INCLUDE "P12F683.INC" ; MPASM Header ; __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF NOLIST endif LIST
Dave
Always wear safety glasses while programming.
Bookmarks