PDA

View Full Version : 12F675 MCLR directive MPASM



OLDSCHOOL
- 3rd May 2008, 20:33
I am starting with PICs and doing some simple programs with a PICKIT1 system. I had a problem where I want to use the pushbutton on the PICKIT, but it is tied to the MCLR line so it causes the micro to reset whenever the button is pressed. So I consulted the internet and this forum and I found a fix that works but only with PBP's internal assembler.

What am I doing wrong that MPASM doesn't like the directive?


@ DEVICE PIC12F675, MCLR_OFF
'@ DEVICE PIC12F675, MCLR_OFF THIS LINE WORKS IF YOU
'USE MECHANIQUES ASSEMBLER, I'M NOT SURE EXACTLY WHAT
'YOU WOULD HAVE TO DO TO GET THE MPASM ASSEMBLER TO
'CORRECTLY IGNORE THE MCLR LINE

'FOR MPASM
'@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _BODEN_ON
'@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _LVP_OFF & _CP_ALL & _DATA_CP_ON
'ONE SOURCE SAID THE ABOVE LINE WOULD WORK WITH MPASM, BUT
'I DID NOT HAVE ANY LUCK WITH IT,
'I GET ERROR[118] .....: OVERWRITING PREVIOUS ADDRESS CONTENTS

mackrackit
- 3rd May 2008, 21:21
Have you seen this?
http://www.picbasic.co.uk/forum/showthread.php?t=543

POST #5 should get you going.

OLDSCHOOL
- 4th May 2008, 01:29
Yes that clears it up. I didn't come across that thread when I was searching the forum last night.