But I have a problem, the pic kit not found the PIC, so I used IPE of mplab... so in IPE the pic only let programming if I not select "Configuration Memory" in advance option... the software say "programming complete" but the pic no running.
If i checked option "configuration memory" the pic no let programming,
I think the hex from ccs has not the configure word or is rare...

Some help for can use this pic?
before I used this pic but wit other encapsulated and not Low voltage.. and all was ok... and the pic kit found it normal.

PCM programmer

Joined: 06 Sep 2003Posts: 20174

Posted: Sat Feb 17, 2018 7:09 pm

If you want to use the internal oscillator, don't put "crystal" in the
#use delay() statement. Change it "clock" or "internal".
If you keep the INTRC_IO fuse, then you need "clock".

cvargcal

Joined: 17 Feb 2015Posts: 44

Posted: Sat Feb 17, 2018 7:43 pm

PCM programmer wrote:

If you want to use the internal oscillator, don't put ....

Thanks you. the code work ok, but the problem is programming the pic...
I cant record the hex in this low voltage pic.

So what is the way to program that pic with the pickit?

temtronic

Joined: 01 Jul 2010Posts: 5880Location: Greensville,Ontario

Posted: Sat Feb 17, 2018 8:01 pm

If you're using MPLAB and a PICKit3 the following works..
From MPLAB
select Programmer->settings->power
then choose 3.5 volts

That 'should' work for you...

However what PCM P says is true, your code has the wrong xtal selection, you cannot say 'crystal' as then the PIC will expect to see a real xtal (and caps) attached to it.

cvargcal

Joined: 17 Feb 2015Posts: 44

Posted: Sat Feb 17, 2018 8:12 pm

temtronic wrote:

If you're using MPLAB and a PICKit3 the following works..
From MPLAB
...

OK, found my 26k22 test PCB and the above code works 100%.
The PICkit3 supplies 3.299 volts and LED flashes at 1HZ rate.
Please note the comments after the clock selection.
crystal=16MHz does NOT work
internal=16MHz does work.

When you say 'crystal', the compiler assumes you have a crystal and caps attached to the clk pins but you don't, you're actual wanting to use the internal osc peripheral.

The only minor changes to your program is the #define LED PIN_B0.
Simply change PIN_B0 to PIN_C5, compile and it should work for you. By using the #DEFINE, you can save a LOT of typing and MIStyping !! If you put the LED on another pin,you only need to change the one DEFINE not a lot of other lines of code.

Also I commented out(removed) lines the compiler defaults or inserts for you.

any problems, please report back

BTW the PICkit3 automatically chose 3.299 volts not me.
Jay

cvargcal

Joined: 17 Feb 2015Posts: 44

Posted: Mon Feb 19, 2018 8:58 am

temtronic wrote:

...
Jay

Thanks you, but no work.
Its rare, I can read and erase the device, but the pic no let programing, on PCB I only have the PIC and one led on C5 for make the testing, I probe all router with the multimetre and all is ok.

I tried all, the pickit is updated...

Its rare because with the version 18F26K22 I have not problem, but with the low voltage version yes.
The mplab say "configure LVP pin on pickit" where I conect that pin... maybe I need that pin..?
cause show this :
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.
Maybe the problem its connection... but all is connected... only not the pin LVP from PICkit

hmm..
1st I do not use LVP, so be sure the 'fuse' is set to NOLVP in your program
also there is an option in the programmer menu to check that the fuses are controlled by the program instead of MPLAB.

2nd what version of MPLAB are you using ( I'm V8.86), as I don't get a lot of 'text' about what's happening.

3rd MY PIC to PICkit has 5 connections
Vdd, Vss,PGD,PGC and _MCLR

4th be sure to select 'power from PICkit3' option. It has more than enough power to flash the LED and that's how I tested it, powered from PICkit3.

Ttelmah

Joined: 11 Mar 2010Posts: 12738

Posted: Mon Feb 19, 2018 10:18 am

What circuit have you got on your MCLR connection?.

What is being described is 'classic' for a board that has a too small resistor on this pin, or a capacitor connected directly to it. The programmer has to be able to pull this pin up to Vpp, reasonably quickly. Look at Figure 2-4 in the PicKit3 users guide. If you want a capacitor on the pin, it needs to be connected via a resistor not directly to the pin.
Programming is not going to work, till reading the device ID works.

cvargcal

Joined: 17 Feb 2015Posts: 44

Posted: Mon Feb 19, 2018 2:08 pm

The problem is communication, I don't understand what I need the pic to be read.

Some sites show the direct capacitor, and some programmers are powerful enough to work with this, but a lot are not, especially USB powered ones.
The 100R resistor is not necessary but increases the life of the switch.

temtronic

Joined: 01 Jul 2010Posts: 5880Location: Greensville,Ontario

Posted: Mon Feb 19, 2018 7:54 pm

What programming program are you using? I have MPLAB 8.86 controlling a PICkit3 and do not get any of your posted messages. It appears to me you may have a 3rd party program controlling the PICkit NOT MPLAB ?
I did see a google hit about the 'stand alone PICkit3' program 'taking over' and NOT allowing MPLAB to function correctly.
Please post what your complete hardware and software consists of.

As for the _MCLR connections. On my 46K22 setup, it's just a 4k7 to Vdd, for the test 26K22, it's a 10K to VDD with a 1K in series to the MCLR pin. NO capacitor on either board.

Jay

cvargcal

Joined: 17 Feb 2015Posts: 44

Posted: Mon Feb 19, 2018 8:33 pm

Thank you to everyone.

I get the problem... My PCB was bad, I no saw the datasheet and the QFN name pin, its diferent to SOIC.

So I soldered wire direct to PIC and the IPE mplab detect of one the PIC...
I make PCB with Proteus... and I no saw that was different.

temtronic

Joined: 01 Jul 2010Posts: 5880Location: Greensville,Ontario

Posted: Tue Feb 20, 2018 5:42 am

Good news, you FOUND out why ! All my projects are done with DIP style PICs. While I can no longer read the part number on them, I can just make out the pin one 'dimple' to be sure it's inserted into the socket properly.
Bad news, you've found another reason why Proteus cannot be trusted. It SHOULD have known about the different pinouts between PIC packages!