PDA

View Full Version : Mclr As Input Pin?



omid_juve
- 20th December 2007, 06:57
how can i define MCLR as input pin in picbasic pro ( my chip is 12c508a)

mackrackit
- 20th December 2007, 08:17
In the *.inc file for the chip in the PBP directory, change MCLRE_ON to MCLRE_OFF

omid_juve
- 21st December 2007, 07:22
thanks for your help

BigWumpus
- 23rd December 2007, 13:15
I have tried it too - but the MPASM reports an error when using porte.3 on a 18f2431, he doesn't know the pin !!!

mister_e
- 23rd December 2007, 19:51
It's not a PBP problem, it's a Microchip p18F2431.inc file problem. Seems they forgot to add it in their LAT/PORT/TRIS list...

BUT, erm, erm.. let's see a datasheet quote...


10.5 PORTE, TRISE and LATE
Registers
Note: PORTE is only available on PIC18F4331/
4431 devices.

on the other hand...seems they also forgot their own quote


10.5.1 PORTE IN 28-PIN DEVICES
For PIC18F2331/2431 devices, PORTE is only
available when master clear functionality is disabled
(CONFIG3H<7> = 0). In these cases, PORTE is a
single bit, input-only port comprised of RE3 only. The
pin operates as previously described.

So, just add TRISE/LATE/PORTE to the .inc file and i'm sure it will work

BigWumpus
- 23rd December 2007, 20:31
Yes - it's a mistake of MICROCHIP - even the support says, there is a porte.3, but they don't realize to kick the MPASM-kids the ass...

tenaja
- 24th December 2007, 00:00
Make sure to read the ds on this pin. I use the mclr as an input in an application, but wasted one before I learned a trick... make sure to pause for a couple seconds before you change the setting to turn it into an input. If you don't, then you may not be able to reprogram it.

nomad
- 24th December 2007, 06:33
using a jdm programmer?