PDA

View Full Version : PBP Support for 12F1840 8-Pin Device?



springtank
- 9th June 2011, 22:40
Greetings - I've been using PBP V2.50/V2.60C for about two years, mostly with 16F886 devices. I would like to try the new Microchip 12F1840 8-pin part, but it is not listed as a supported device when using MicroCodeStudio and PBP V2.60C. Do I need to wait for another PBP patch before I can use the 12F1840 part? Not sure what to do.
Thank-you for making this forum a wonderful resource.

Darrel Taylor
- 10th June 2011, 00:07
The 12F1840 is not even in production yet.

Microchip is sampling them, but that's all.
Production quantities are expected by late July or August.
We just got samples a couple days ago.

They will be added to PBP in the next version.

springtank
- 10th June 2011, 00:49
Darrel - Thank-you very much for the reply. I ordered and received some 12F1840 devices from Mouser back in mid-April, so I didn't realize they were not in production. No worries, I can wait, and at least now I know support is coming for the part. You rock as always.

retepsnikrep
- 10th June 2011, 09:01
I emailed PBP support re this matter a few weeks ago and they replied that they though code compilied for another pic would run on it. I will post details later I don't have access to it here. I think the issues were that the suggested pic has more ports, so as long as you didn't try to use them then hex code for the substitute pic may/should work on the 12F1840.

I also spoke to piccircuit .com who make a neat cheap pickit 2 clone and they sent me a file to allow the pickit 2 software to work with the new device.

I'll post details later.

retepsnikrep
- 10th June 2011, 17:44
This is the reply i got from Charles Leo


The datasheet wasn't available in time for our last PBP revision, and another revision isn't planned for few months.

It looks to me like the part is identical to the 16F1828, with the exception of a few missing ports. I think you can compile for the 1828 and the hex file will work for the 1840. Let me know if you encounter any compiler or assembly errors and I will look into it.

Programming support for the 1840 has already been added to the meProg software for the programmers.

Charles Leo
microEngineering Labs, Inc.
2845 Ore Mill Road STE 4
Colorado Springs, CO 80904
719-520-5323
fax: 719-520-1867
http://melabs.com (http://melabs.com/)This is the reply i got from Piccircuit.com


Hi,

Thanks for checking with us.
For the PIC12F1840, you might need to install the attached patch to enable the PIC12F1840 programming
Please apply the patch at C:\Program Files\Microchip\PICkit 2 v2>PK2DeviceFile.dat
Then the PIC12F1840 should be detected by the PICkit2.
Please let us know the testing results on our solutions. We will try our best to help you.

Best Regards,
PICCIRCUIT.COM (http://piccircuit.com/)
Patch attached

5659

springtank
- 11th June 2011, 19:00
Retepsnikrep (Peter?) - Thank-you for taking the time to post the added info. When I get my test board together, I will certainly give it a shot - Very much appreciated.

LakisFM1
- 8th March 2012, 08:29
Hello , did you finally managed to play with the 12F1840 ?

I mean you used 12F1822 Hex ?

But i think Microcode Studio wouldn't give error (and quit) when try to write more than 2048 words ?

I need the 12F1840 for the 4K space ....

springtank
- 10th March 2012, 06:34
LakisFM1 - Yes, I have been playing with the 12F1840 for a while now. I only used very small programs for the 12F1840 until I purchased PBP3 that had full support for it. The advice I got here on the forum was to use the 16F1828 include file to allow me to compile code for the 12F1840, using PBP2.60. The steps I used are below.
1. Get latest PICKIT2 programmer firmware that supports programming 12F1840.
2. Modify "16F1828.inc" file to allow using Internal Oscillator and other options you want
3. I used PBP 2.60C with MicroCode Studio Plus V4.0.0.0
4. Create NEW program in Microcode Studio Plus for your 12F1840 (mine were very simple)
5. In Microcode Studio Plus, Choose Device = "16F1828"
6. Compile using MPASM
7. Open PICKIT2 application, select device "12F1840", then program device with your HEX file.

Once I got PBP3, compiling for 12F1840 works fine with no special tricks needed.
Maybe the above steps can help somebody who wants to try using PBP2.x with 12F1840, but I am very pleased with PBP3.
Sorry I have not used 12F1822.

LakisFM1
- 10th March 2012, 20:53
Would it be too much if i ask you to attach the modified .inc file ?

Thank You in any case !

springtank
- 11th March 2012, 02:36
LakisFM1 - I will try to attach the one I used, along with a very short example program. Hope you find it useful.

LakisFM1
- 11th March 2012, 08:20
Thank you!

I thought the differences in the .inc were also about the registers ,
so i had to verify that aaaaaall the registers of the 12F1840 are in same addresses as the 16F1828. :numbness:

Or maybe is it you are using a simple TRISA/PORTA? (em, with also ANSELA,WPUA and OSCON :distrust:)

springtank
- 12th March 2012, 03:26
LakisFM1 - Yes, I was only doing very simple things with the 12F1840 and PBP2.6. I really just did Port toggle control and some simple PWM. All my programs were very short, mostly used to check out my handmade test board with a real 12F1840. You have my .inc and simple program, and I didn't do much more than that until PBP3 came out.
If you are serious about using PBP with the 12F1840, then I think PBP3 is a must for you. It will make your life a lot easier. No matter what you do, the 16F1828 is not a 12F1840.
Sorry I don't have more for you.

Charlie
- 8th November 2012, 20:32
So did we ever get an update to support this device in PBP 2.6?

Acetronics2
- 8th November 2012, 21:03
So did we ever get an update to support this device in PBP 2.6?

PBP is now @ v 3.06 ... :rolleyes:
see here : http://pbp3.com/downloadtrial

Alain

Charlie
- 8th November 2012, 21:07
Thanks Alain, but the price is a bit out of my range to simply support a single new device.
I'm not asking for more development on 2.6, I'm asking if it was ever done.

Acetronics2
- 9th November 2012, 10:25
Thanks Alain, but the price is a bit out of my range to simply support a single new device.
I'm not asking for more development on 2.6, I'm asking if it was ever done.

I WIN !!! :D

so, you just have to create the relevant "include" files from some existing similar ones ... libraries are open.

nowhere, nobody works for free ... ;)

Alain

Charlie
- 9th November 2012, 12:59
I might do that... is it just the include files?
How do I get it in the pull down list of devices?

LakisFM1
- 10th November 2012, 08:32
springtank's solution worked for me totally fine on pbp 2.6 (Thanks one more time!)

A compiled .hex file of 1822 , also worked 'as is' on the 1840!

I used many registers in my program (can't remember now) ,
and i remember first ,i compared the two pic memory maps (18f40 and 16f628) and were same ,
the only differences were the extra registers on the bigger pic.

ps. don't expect to get '18F40' on pull down list , just use springtank's guide.