Page 1 of 1

PIC18FxxK40 and K42 any support?

Posted: Mon May 21, 2018 10:07 am
by octal
Hello,
are there any plans to have official support for K40 and K42 chips in Swordfish BASIC compiler?

Re: PIC18FxxK40 and K42 any support?

Posted: Mon May 21, 2018 2:16 pm
by David Barker
Not at the moment Octal...

Re: PIC18FxxK40 and K42 any support?

Posted: Tue May 22, 2018 10:32 am
by Jerry Messina
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.

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

Posted: Mon Jul 16, 2018 3:28 pm
by SHughes_Fusion
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?

Re: PIC18FxxK40 and K42 any support?

Posted: Mon Jul 16, 2018 5:15 pm
by Jerry Messina
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?

Re: PIC18FxxK40 and K42 any support?

Posted: Tue Jul 17, 2018 8:50 am
by SHughes_Fusion
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.

Re: PIC18FxxK40 and K42 any support?

Posted: Tue Jul 17, 2018 11:27 am
by Jerry Messina
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.

Re: PIC18FxxK40 and K42 any support?

Posted: Thu Jul 19, 2018 10:42 pm
by Jerry Messina
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...

Re: PIC18FxxK40 and K42 any support?

Posted: Fri Jul 20, 2018 7:30 am
by SHughes_Fusion
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.

Re: PIC18FxxK40 and K42 any support?

Posted: Sat Jul 28, 2018 2:51 pm
by Jerry Messina
It's been a busy week! I finally got to it... see viewtopic.php?f=3&t=2078