View previous topic :: View next topic |
Author |
Message |
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
Problem with MCLR pin on PIC16F690 |
Posted: Wed Feb 12, 2020 7:15 pm |
|
|
Hi,
To everyone who helped me so far, thank you very much!
I created a prototype, it includes an LCD, PIC16F690 and a keypad. I am unable to disable the MCLR pin through software, but when I turn it on through the PicKit programmer, the prototype works, when I use a pullup resistor, the prototype does not work and the MCU is in permanent reset. Has anyone encountered this problem? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Wed Feb 12, 2020 7:26 pm |
|
|
Yes....some PICs are like that. You get an error message from the PICkit3 programming software. I think it has to do with using the internal clock and mclr pin. Have to admit it's been years but scratched my head over it for a week or two. Since them I use 'big' PICs. 18F46K22s (40 pins), 26K22 (28 pins), way overkill for all projects but no more weird messages !I know someone will know the details about the issue, it has to do with how the PIC was designed. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Feb 13, 2020 12:23 am |
|
|
You say 'Pickit'. Is this a Pickit 2 or a Pickit 3. The '2' has issues with this
chip. What software are you using to drive the 'Pickit'?. What value
was the pullup resistor?. What is your development environment?.
(Wondering if you may be using MPLAB, and ending up with the PIC
built in DEBUG rather than RELEASE mode...). |
|
|
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
|
Posted: Thu Feb 13, 2020 5:18 am |
|
|
I will describe the steps below:
1. Create and compile the code with the CCS PIC C compiler.
2. Use PicKit2 or PicKit3 programmer to upload the hex file to the chip.
3. The pull-up resistor is 2k.
I do not use MPLAB, its very heavy for my PC. I have XC8 installed, but I use it with the command prompt. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Thu Feb 13, 2020 5:47 am |
|
|
PICKit3 has issues with it as well. I only have PK3 here and remember having problems programming them, or a family member. 'Something' about the internals of that PIC is different than the rest of the PICs so you program it to use the internal oscillator AND use the _MCLR pin for I/O.
It's not really the programmer. It's the PIC. |
|
|
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
|
Posted: Thu Feb 13, 2020 6:05 am |
|
|
It works when I use the programmer PicKit. How does the programmer pull the MCLR pin high? What is the difference between the programmer and a pull-up resistor? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Thu Feb 13, 2020 6:57 am |
|
|
hmm.. this,
Quote: | I am unable to disable the MCLR pin through software, |
Please show us the code you're using, as MCLR is normally controlled by 'fuse' statements. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Feb 13, 2020 7:26 am |
|
|
What program are you actually using to do the programming?.
You refer to XC8, but this is the compiler, not programmer software.
The CCS code can't drive the PicKit without the Microchip drivers from
MPLAB. So do you have this (MPLAB 8.92, much smaller and better than
MPLAB-X for this)?.
It's almost certainly _not_ how the programmer pulls the signal high, but that
it is for some reason in debug mode.
Are you specifying MCLR or NOMCLR?.
What version of the programming code?.
What compiler version?.
Post the bottom couple of lines of your .LST file. |
|
|
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
|
Posted: Thu Feb 13, 2020 2:17 pm |
|
|
I use PicKit2 v2.61 to upload the hex file. It has an option to start the MCLR and VDD pins.
Compiler CCS PIC C v5.82.
#fuses NOMCLR, NOWDT, NOPROTECT, INTRC_IO
EDIT:
here
is an image of the PicKit.2 software with which I upload the hex code and turn on MCLR and VDD. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Fri Feb 14, 2020 12:17 am |
|
|
OK. Pickit2 software.
This is a known issue with this and these chips.
You need pulldown resistors (about 10K), on the ICSPDAT and ICSPCLK
pins.
The PICKIT2, seems to not correctly turn off the DEBUG fuse. With
these resistors the chip will run, but without them it'll not start.
The Pickit programmers have these, which is why it works with these
connected. |
|
|
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
|
Posted: Fri Feb 14, 2020 2:47 am |
|
|
Currently I have pullup resistors on ICSPCLK and ICSPDAT which I need for the keypad to work. I will try adding a pulldown resistor and see what will happen. The whole prototype will have to be reworked if I can not use pull-up resistors for the keypad. |
|
|
RamShop55
Joined: 04 Feb 2020 Posts: 18
|
|
Posted: Sun Feb 16, 2020 10:46 am |
|
|
Sorry for the double post. I tried, but it did not work for me. Its strange, because on a hand soldered universal PCB the MCU works correctly, and the ICSPDAT and ICSPCLK pins are not connected to anything. This PCB is simple its only designed to use the internal comparator 1 with the absolute voltage reference of 0.6V where the MCU seems to be working but I have other problems. What is the recommended approach towards the MCLR(pin 4), ICSPDAT(pin 19) and ICSPCLK(pin 18)? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Sun Feb 16, 2020 11:48 am |
|
|
Normally there is no problem.
However this particular chip is a 'pig'.
For some reason, it behaves as if it is always in ICSP mode, even when
MCLR is sitting at normal voltages.
Because of this ICSPCLK has to be low when the chip starts or it won't
work.
The unconnected board is OK, since nothing takes this pin high. Your
other board fails because of the pullup resistors.
Honestly switch to one of the newer equivalent chips that don't have
this problem. The PIC16F18344 doesn't give this problem. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Feb 16, 2020 12:04 pm |
|
|
His Pickit2 won't work with that chip. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Sun Feb 16, 2020 12:21 pm |
|
|
He talks about having a PicKit3 as well.
I think this does support the later chip. |
|
|
|