Deciding which PIC

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,

I am just starting a project and need to choose the correct PIC chip. I have Oshonsoft basic progam, and have been mainly using 16F684A and 16F819 so far, but I have been advised that the latest code will be too large for those types.

An example of the code is here:View attachment Code.txt This code is for reading NMEA (GPS) data, and put it on an LCD screen. The information involved, will then need quite a complicated equation for the project.

The chip will of course need LCD, TX RX, plus enough pins to drive two motors also UART. I appreciate that this isn't easy, but just as a guideline, are there any suggestions for a suitable PIC, that will take me right through the project please.

Cheers, Camerart.
 

tshuck

Joined Oct 18, 2012
3,534
Microchip has a parametric part finding tool on their website (called MAPS, I think). You specify what you need, and it'll tell you what parts are suitable...
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Microchip has a parametric part finding tool on their website (called MAPS, I think). You specify what you need, and it'll tell you what parts are suitable...
Hi Tshuck,

If possible it would be good to keep with the PICs that I have the programs (Oshonsoft and Pickit2) to program, but I would update and learn new chips (with difficulty I'm afraid) if necessary.

These are 'see attached'

It will need a USART, LCD, RX TX, enough pins to drive two motors, XTL.

As for the code memory size, all I can guess, is a program for parsing NMEA ASCII sentences, with global locations and time, then quite a complicated maths equation. I believe that the NMEA sentences, must be held for a while, perhaps averaged, then replaced. Probably at speed.

Thanks, Camerart.
 

Attachments

tshuck

Joined Oct 18, 2012
3,534
Those are some pretty old parts. The Pickit 2 can program many more PICs than that list, so it seems your compiler is the limiting factor there (there are others that should have better support out there). You could also use an external RAM to store things.

You probably don't need the full sentence, and can just use the parts you need in order to trim the RAM requirements.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Those are some pretty old parts. The Pickit 2 can program many more PICs than that list, so it seems your compiler is the limiting factor there (there are others that should have better support out there). You could also use an external RAM to store things.

You probably don't need the full sentence, and can just use the parts you need in order to trim the RAM requirements.
I'm afraid I'm of the age where I'm a bit stuck in time, this is why I use the ones, I'm used to.

The list is from Oshonsoft, a really good simulator, that I'm also used to. I can update if absolutely necessary to a version with 18 series chips.

I think I only need Longitude, latitude, time, and height? from the sending sentence plus the same from the home sentence for the calculation.

I've never used external RAM, but I'm open to suggestions.

I did a project a while back, with menus, and timing etc, where someone programmed a 16F648A for me, and I remember he struggled with the lack of memory (4MB) and I'm guessing the calculation will be more, so perhaps 8MB needed.
 

tshuck

Joined Oct 18, 2012
3,534
There are ways you can get creative and save space in your project.

What does your code look like? And what is the calculation?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
First I'm sorry but, I said the PIC memory is 4Mb and I should have said 4Kb.

There is a link in #1 for and example code, before the equation. The equation will calculate where the tracker will aim the antenna, from the sending location NMEA sentence and the 'home NMEA sentence. I don't know any more than this.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
You mean the hex file!?

You want us to decompile that?
At the moment, I'm only choosing which PIC to use. The link shows an example of a simple Read NMEA data and show it on an LCD. This plus an equation (yet to be done) is to give an example for estimating the size of memory needed for code.
 

jjw

Joined Dec 24, 2013
823
If you want to use Oshonsoft basic, you should probably buy the 18F version.

For example PIC18F2620 has 64kB program memory and 4kB Ram in a 28 pin DIP package.
 

shteii01

Joined Feb 19, 2010
4,644
If you use "generic" lcd, you can use 4 bits for data transfer instead of "normal" 8 bits. It is one of those space saving/pin saving "tricks".
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Microchip has a parametric part finding tool on their website (called MAPS, I think). You specify what you need, and it'll tell you what parts are suitable...
I found MAPS, entered 8Kb flash USART, and it showed 16F648A in it's choices, which confused me.

I tried to select LCD, and I have 2 line and 4 line, but the choices showed 60, 72, 96 etc which also confused me.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
If you use "generic" lcd, you can use 4 bits for data transfer instead of "normal" 8 bits. It is one of those space saving/pin saving "tricks".
I don't understand the term 'generic', but I did find reference to 4 bit, which used 2X flipflops, is this what you mean?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
If you want to use Oshonsoft basic, you should probably buy the 18F version.

For example PIC18F2620 has 64kB program memory and 4kB Ram in a 28 pin DIP package.
Some earlier suggestions pointed out that I could have external memory, which might save me from changing to 18F version, if possible I would prefer to use the 'old' chips or similar, that I'm used to if possible. (Brain fading, I'm afraid!)
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Those are some pretty old parts. The Pickit 2 can program many more PICs than that list, so it seems your compiler is the limiting factor there (there are others that should have better support out there). You could also use an external RAM to store things.

You probably don't need the full sentence, and can just use the parts you need in order to trim the RAM requirements.
Can you explain a bit more about using external RAM please. I assume this is where the code goes?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
PIC16Fxx controllers can't run programs from external RAM.
Ok, so I've so first thing is to assess the size of the code including the equation then?

As an example, would it be easy to assess the example code I posted at post #1? (Remember that the initial program would be done with Oshonsoft)
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,

I've used the recommended MAPS for selecting PIC, and come up with these likely three.

16F767 16F886 16F916

All run on Oshonsoft, plus USART and I think LCD.

I'm not quite sure if the built in LCD, is much different to using the output pins.

Any comments?
 

THE_RB

Joined Feb 11, 2008
5,438
What is the math task and which LCD?

Reading the NMEA data is very fast and easy, the math task (and the code to drive the LCD) are the things that will decide the amount of memory you need.

Like a lot of OP's you want us to suggest a solution when you have not yet provided enough information. :)
 
Top