How interesting is the new PIC18 K40 series ?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
PicoPuls
Posts: 111
Joined: Wed Mar 02, 2016 11:26 am
Has thanked: 43 times
Been thanked: 22 times
Contact:

How interesting is the new PIC18 K40 series ?

Post by PicoPuls »

How interesting is the new PIC18 K40 series ?
http://www.microchip.com/forums/m951250.aspx

Best regards
Bengt

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by QMESAR »

Hi

In my personal opinion these PIC18K40 devices are very interesting as we now see the start of implementation of core independent peripherals as they have been developing on the PIC16F1 series , The core independent peripherals is a very smart feature as it frees up the core for processing power and not driving the peripherals you only need CPU cycles when you write or change values to the peripherals These PIC16F1 devices are smart devices
with that said about the core independent peripherals the next is the feature rich and smart Peripherals they are having now such as the CLC, WWDTa ,Angular timers,math accelerator etc which allows a design engineer to use the mcu for processing and also it can be used to build interface hardware logic and other circuits these new peripherals are complex peripherals which you can do many things with depends on your needs I guess.

just an example the Math accelerator module allows you to use a PID loop in Hardware once setup /configured the cpu does nothing all is calculated in hardware and adjusted automatically imagine a PIC32MZ with this ability at 200MHZ what would its processing power be :shock:

The days of 8 bit mcu's is long not over and they have still many uses and will be there for a long time to come and the beauty here is these peripherals will find their way in to the PIC32 and PIC33's wow these things will be beauties to work with

You have to inform yourself about these new peripherals in order to understand what these new devices are capable of it is not easy to give you all the information in a single post

just my penny :D

PicoPuls
Posts: 111
Joined: Wed Mar 02, 2016 11:26 am
Has thanked: 43 times
Been thanked: 22 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by PicoPuls »

When will they be supported by Flowcode ?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by Benj »

I'll get them on the list, they shouldn't be a big job to include but it depends how many new peripheral styles are included.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by Benj »

Right I've made a start, I'd like to have another pass as there are bound to be bits I have missed.

There are lots of new and different bits to these chips so expect problems. For example the I2C hardware peripherals now feature re-mappable I/O so this is currently unsupported.

I'm hoping I/O, DAC, ADC, SPI, UARTs and Timer interrupts should work ok.

Latest files included in the update here: http://www.matrixtsl.com/mmforums/viewt ... 63&t=18209

If anyone has a go then let me know how you get on.

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by Kenrix2 »

Great job Benj. Thank you so much. Works perfect for me using the 27K40. I did expect ANSELA would be cleared in startup on this chip.

Not related to Flowcode but, I had an issue when using a LUT. After reading the errata I added the following right below "BEGIN" and problem solved.

Code: Select all

NVMCON1bits.NVMREG1=1;
Thanks again for all your hard work.
Last edited by Kenrix2 on Tue Nov 29, 2016 9:42 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by Benj »

Many thanks for letting me know,

ANSELA and other missing ANSELs have now been added to the init code as has the NVMCON1 command.

electron67
Posts: 311
Joined: Sat Jan 12, 2008 2:08 am
Has thanked: 104 times
Been thanked: 47 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by electron67 »

Hi

To working in Flowcode 6 the PIC18F**K40.zip :?:

Thanks
Enrique

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by QMESAR »

electron67 wrote: To working in Flowcode 6 the PIC18F**K40.zip :?
The problem is not with MATRIX to include the new devices the problem is that the boostC compiler people does not include new devices very often and for that reason it can take a very long time if ever they will get support in the boostC compiler,
If you really want to use these devices then my advice would be to upgrade to FC7 as it is using the Microchip Compiler devices get added to the compiler automatically as they are released and MATRIX update FC faster :D

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by QMESAR »

Just one of the great feature of the"K40" series most of the things we normally need to do in hardware and software are all included and Part of the ADC now :D
Attachments
1.JPG
1.JPG (21 KiB) Viewed 8913 times
2.JPG
2.JPG (44.97 KiB) Viewed 8913 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: How interesting is the new PIC18 K40 series ?

Post by LeighM »

Just whilst waiting for some devices to test :?
Is anyone currently successfully using (Flowcode V7) UART on the K40?

EDIT:
Just got a PIC18F47K40 and both UARTs work fine :D
Seems that there is a possibility of a silicon error with (early) K40 and the use of strings and arrays.

Post Reply