Deciding which PIC

Discussion in 'Programmer's Corner' started by camerart, Apr 10, 2014.

  1. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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...
     
  3. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    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.
     
  5. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  6. tshuck

    Well-Known Member

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

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

    Moderator

    Oct 2, 2009
    12,441
    3,361
    Presumably you are referring to code memory.
    You will have to go to PIC32MZ2048 if you want 2MB memory.
     
  8. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You mean the hex file!?

    You want us to decompile that?
     
  10. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  11. jjw

    Member

    Dec 24, 2013
    173
    31
    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.
     
  12. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,387
    497
    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".
     
  13. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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.
     
  14. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    I don't understand the term 'generic', but I did find reference to 4 bit, which used 2X flipflops, is this what you mean?
     
  15. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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!)
     
  16. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    Can you explain a bit more about using external RAM please. I assume this is where the code goes?
     
  17. jjw

    Member

    Dec 24, 2013
    173
    31
    PIC16Fxx controllers can't run programs from external RAM.
     
  18. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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)
     
  19. camerart

    Thread Starter Active Member

    Feb 25, 2013
    517
    30
    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?
     
  20. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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. :)
     
Loading...