PIC18FxxK40 and K42 any support?

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

PIC18FxxK40 and K42 any support?

Post by octal » Mon May 21, 2018 10:07 am

Hello,
are there any plans to have official support for K40 and K42 chips in Swordfish BASIC compiler?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: PIC18FxxK40 and K42 any support?

Post by David Barker » Mon May 21, 2018 2:16 pm

Not at the moment Octal...

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18FxxK40 and K42 any support?

Post by Jerry Messina » Tue May 22, 2018 10:32 am

Basic support for the K40 family already exists. The files posted here on the forum should work without much issue.

Library support is lacking, especially for things like the eeprom, but that's nothing new what with the gazillion different variations mchip releases.

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: PIC18FxxK40 and K42 any support? And Q10....

Post by SHughes_Fusion » Mon Jul 16, 2018 3:28 pm

I'll add my voice to calls for K4x support, would prefer not to have to use workarounds.

Also, does anyone have any insights as to whether the new Q10 series can be used with Swordfish? They seem friendly enough at first glance and the pricing is better than other 18Fs. Only thing to dislike about them at the moment is the new documentation style Microchip have adopted. I suspect it is meant to be mobile friendly although what serious developer would use a mobile screen as their primary means of reading datasheets?

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18FxxK40 and K42 any support?

Post by Jerry Messina » Mon Jul 16, 2018 5:15 pm

I've got an update coming out in the next couple of days that addresses the K40 issues and it includes support for the Q10.
It also updates a number of the library files so you can use them with devices with PPS mapped pins, although you still
have to do the pps mapping yourself.

The Q10 is very similar to the K40 from what I can tell so far. It has a lot of the same Core Independent Peripherals.
From what I see, the only different between the Q10 and the K40 is that there's no LF version of the Q10...
it's rated at full speed over the entire 1.8V-5V range.

I'm going through and debugging them now... figured I'd wait and release them all at once instead of piecemeal.
So far some of the revamped modules include: eeprom, usart/usart2, setdigitalio, pps, intosc, spi/spi2, and wdt.

I still have I2C on the todo list, and adc (but that one's probably going to stay on the list... there's just too many variants).

Support for the K42 and K83 families is still AWOL. The cores on those two are very different from the other 18F's and
require fundamental changes to the compiler to get them working.

Anything else?

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: PIC18FxxK40 and K42 any support?

Post by SHughes_Fusion » Tue Jul 17, 2018 8:50 am

That sounds great, thanks for your support Jerry.

So, am I right in thinking the K40 and Q10 don't actually need any compiler changes, just library changes? If so I'll bake one in to a board and start playing.

Shame about the K42, I was keen to try that as the main limitation I run in to on the larger projects is RAM. Guess I really should move out of my comfort zone and get familiar with the PIC24 or even PIC32.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18FxxK40 and K42 any support?

Post by Jerry Messina » Tue Jul 17, 2018 11:27 am

So, am I right in thinking the K40 and Q10 don't actually need any compiler changes
Well, not exactly, but if you hang on a bit I have all new device files that'll take care of what's needed.

Those devices have moved the interrupt priority enable bit (IPEN) to a different register and SF doesn't recognize it.
The new device files take care of all that for you.

Other than that, as far as the compiler's concerned the K40 and Q10 work like all the others... it's the peripherals and libraries that need the biggest changes.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18FxxK40 and K42 any support?

Post by Jerry Messina » Thu Jul 19, 2018 10:42 pm

It's taking me a little longer to get this together than I was expecting. I had to make some mods to the device file generator to fix some registers that were missing in the mchip files for the K40 and Q10.

At this rate it'll probably be next week until I have it ready. Stay tuned...

SHughes_Fusion
Posts: 219
Joined: Wed Sep 11, 2013 1:27 pm
Location: Chesterfield

Re: PIC18FxxK40 and K42 any support?

Post by SHughes_Fusion » Fri Jul 20, 2018 7:30 am

Thanks, Jerry, from my perspective no great rush as all projects are several weeks away, the main thing I wanted to find out is whether it was technically possible.

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18FxxK40 and K42 any support?

Post by Jerry Messina » Sat Jul 28, 2018 2:51 pm

It's been a busy week! I finally got to it... see viewtopic.php?f=3&t=2078

Post Reply