Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Anyone working with the new PIC18FxxJxx parts?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Anyone working with the new PIC18FxxJxx parts?

by zener on Tue Sep 07, 2010 11:39 pm

Such as PIC18F26J13...

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Wed Sep 08, 2010 12:30 am

Yes. PIC18F24J11
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Wed Sep 08, 2010 1:40 am

Are you writing in C or assembly? Do you know if there is anything particularly special about these parts?

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Wed Sep 08, 2010 1:56 am

Assembly.

They have Peripheral Pin Select - the 18F and 18FK don't.
They don't need high voltage for programming - the 18F and 18FK do (unless LVP is used, but that requires a dedicated LV PGM pin).
Some parts have 12 bit ADC (most 8 bit PICs are 10 bit)
Dual UART and dual master/slave IIC/SPI.
None have USB, some 18F and 18FK do.
Lower cost and more memory than the older 18F series parts.
Other than that, just another 18 series part.
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Wed Sep 08, 2010 2:38 am

18FxxJ53 have USB...

The issue I am having is they suggest their C compiler supports the parts but really it doesn't seem to. The Hi-Tech doesn't at all, and the PIC18 documentation is out of date.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Wed Sep 08, 2010 3:24 am

Support will probably be in the next release of HiTech. The PIC18F26J13 is a new part.

I think you could configure the C compiler for PIC18F26J11 for developing the code and then switch to PIC18F26J13 before programming.

If you don't want surprises, stick with popular mature parts like the 18F2550/4550.
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Wed Sep 08, 2010 2:37 pm

It turns out they have newer library documentation with info for the PIC18F2xJ13, they just don't have it on their website for some reason. I had asked the local rep ahead of time if this part was supported because I could use a different part. He said "no problem..." Turns out it is "some problem". Yes the Hi-Tech will support it in a couple of months. Thanks.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Thu Sep 09, 2010 1:26 am

The 2550 looks good but costs quite a bit more than the 26J13 so I will try to make it work. Got the AD working today even though their example code was incorrect...

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Thu Sep 09, 2010 7:48 am

What was wrong with the ADC code?
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Thu Sep 09, 2010 1:43 pm

They put their variable declarations inside of the main loop which the compiler did not like at all. Also the OpenADC function needs four arguments for these processors but they only had three so I got an error "too few arguments". I got it figured out but it was a bit of a letdown considering this was the example code provided for this specific processor. On the other hand none of the other library functions even have example code provided so I guess I should count my blessings. I just wish there was more example code available.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Thu Sep 09, 2010 2:37 pm

So here is a question maybe you can help me with. I am using the ICD3. When I program the part, it does not run automatically. I have to click on the "run" triangle in the upper right part of the screen. The program will not run any other way and if I disconnect the board from the ICD3 then it will not run, even if I press the reset button. I have confirmed the reset line is transitioning correctly. I am guessing this is something in software but I don't know what is causing this. Thanks.

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Thu Sep 09, 2010 2:51 pm

If you want to run without the ICD connected, then you must do a release build instead of a debug build.

Use the ICD3 as a programmer to download the release build. It will run with the ICD connected or with it disconnected.

A debug build has some additional code to communicate with the debugger. If there is no debugger connected, the chip will usually (but not always) hang in the debug exec code.
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Thu Sep 09, 2010 3:18 pm

You are correct sir!! That problem is solved! Thanks! Now to try my hand at the timer. I am trying to generate an interuupt at 1kHz. So I am going to use timer 2 and set the prescale to /16 and the post scale to /1 and set the period register to 125. Since my main clock is 8Mhz and the timer gets fed with Osc/4, I think I should end up with a 1kHz interrupt...

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Anyone working with the new PIC18FxxJxx parts?

by oPossum on Thu Sep 09, 2010 9:23 pm

Zener wrote:When I program the part, it does not run automatically. I have to click on the "run" triangle in the upper right part of the screen.


Did they remove the auto run option from ICD3?

Image
I am the Possum, and I approve of this message. Sent from MacBook Wheel Sorry for my bad German.
oPossum
 
Posts: 636
Joined: Fri Oct 26, 2007 12:42 am
Location: Michigan, USA

Re: Anyone working with the new PIC18FxxJxx parts?

by zener on Thu Sep 09, 2010 11:19 pm

If I program from the programmer menu it runs automatically. If I program from the debugger it doesn't.

Never did get my interrupt working. It seems timer 2 won't count. It always seems to have the value 0x33. So it never generates an interrupt. I checked all the status registers and everything is correct. The "on" bit is set for Timer2. I am not sure that the debugger is correctly reporting the TMR2 value however. Why does the "refresh" command in the watch window right-click menu not seem to do anything?

zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Please be positive and constructive with your questions and comments.