PIC 18F46K22 MCU

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
IanR
Posts: 2
Joined: Wed Jan 22, 2014 10:39 am
Location: Stockholm

PIC 18F46K22 MCU

Post by IanR » Wed Jan 22, 2014 9:39 pm

Hello,
Recently I have been working on the PIC 18F4550 and was having problems with the two timers for USB.
Now I have another project which doesn't need USB and I have switched to the 18F46K22 for other reasons. And there are problems. No success.

I read on the internet the following comment:-

"If you want to use the 18F46K22 CPU chip, you should use the full version of Swordfish Basic. If you have a 18F46K22 and want to trade it in for a 18F4620, just drop us an email and we will be happy to send you a replacement CPU chip".

Is this true please about only using the FULL VERSION ? And if so, can anybody enlighten me why.

I have been getting up to speed on the evaluation version, so is it now time to dig a hole in my pocket if I want to use the 18F46K22 ?

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

Re: PIC 18F46K22 MCU

Post by Jerry Messina » Thu Jan 23, 2014 12:39 am

The SE evaluation version can compile code for pretty much any chip (including the 46K22) but it is limited to a single bank of ram (256 bytes). That means there's a lot of code that you won't be able to use, such as the SDcard and USB libraries.

The K series parts usually require you to make some changes to various system libraries, such as the USART, ADC, and SetAllDigital modules. Most of that is discussed in various threads here on the forum.

One thing to note when using the SE version with certain chips is that some of them have SFR registers in the upper banks that require you to use the full address/BSR register to access them. Since the SE version is limited to using bank0, you'll have to use something like the read_sfr()/write_sfr() macros in the SetDigitalIO.bas module for these registers.

What sort of problems did you have?

Post Reply