PIC 18F Series

Discussion in 'General Electronics Chat' started by R!f@@, Jun 23, 2014.

  1. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    I am running into issues even with the 20*4 LCD with too much Msg's

    Last project (ADC checker) is working upto 3 Rows.
    Error msg is RP bit should be set manually for indirect addressing or something. I will post about it later.

    I have read all these issues will be cleared if I use 18F series PIC's

    I like to know what no's should I keep in stock.
    There are few here who knows about the 18F part no.s that are needed to keep in hand for projects as such.

    I am not yet familiar with those yet.
    So a suggestion about PIC18F no's that I can keep in stock will be a lot of help and I can look up the data to study them.

    8 pins to 40 pins will be suitable.
     
  2. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    I found a PDF.
    Attached below.

    Are these all there is about 18F's ?

    Looking at the PDF I made a little list

    1. PIC18F1320
    2. PIC18F2320
    3. PIC18F258
    4. PIC18F452
    5. PIC18F458

    How's this list for a general Stock.
    If OK, I can start saving.
     
    Last edited: Jun 23, 2014
  3. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,383
    495
  4. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    I have but that table has too much to select from.
    I am not an expert.
    Just asking around since I guess most of you know what I am trying to do at first.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,509
    2,368
    Apart from a few 18pin 18F1220, most projects I have covered so far have been with the 28pin versions.

    I have used both the 28pin 18F2221 & 18F23K22, for anything larger, 40pin 18F46K22.

    The K22 series require a programmer with later firmware, if using Pickit it is only the 3 that covers the K22 series. Otherwise Pickit2. covers the rest.
    The advantage of the K22 series is multiplexing of pins, so you do not get stuck having to go with a larger Pic if using a variety of modules in one μp, e.g. ECCP, Usart, T1OSC etc.
    Max.
     
  6. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    When picking things like 18F452, look for 18F4520 which is a later (fewer bugs) version of the 452. Frequently, bringing up an older part will get a suggestion for a later version. Always use the later version.

    Then look at the errata for your prospective chip. Go for one with 'B' level silicon or better with few reported issues. I don't use any 'A' level silicon if I can avoid it.

    In a given package the lines shake out along memory/RAM amounts then peripherals. Buy the one with the biggest memory, the cost difference is negligible compared to the hassle of running out of memory. If you filter the selection guide for pins/Vdd and peripheral set, it cuts down the number of chips to something manageable.

    Lots of RAM is a must with MicroC.

    Have fun.

    Just curious, what's the cheapest way to ship to Maldives? Any customs issues?
     
    Last edited: Jun 23, 2014
  7. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    What is the problem you are having with 16F PICs? There is nothing magical about 18F that makes it better for use with and LCD.

    Are you talking about storage for messages? If you have a lot of text to store, you should store it in program memory.

    Bob
     
  8. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    Cannot quote to every one so.
    @Max.
    I have easyPIC7 Eva Board.

    @John
    I chose all the ones with BIG memory and all tht I left out the smaller memory ones.
    Get 18F4520 instead of F452. OK I will look into it.
    "B" ..? Is this the prefix or version ?
    Does it mean 18F4520B ???

    I have custom issues from time to time. But small postal packages are not an issue.
    Cheapest way is just standard shipping I think.
    From Aliexpress it is Hongkong post or Chinese standard shipping (insured). It is the cheapest.
    Ebay also standard international shipping(insured or with tracking)

    @Bob.
    I am trying to get my codes completed with LCD. I am getting weird characters with 16F with too many msg's.
    The VA meter project is done with fewer msg's but I like to include two more in it
    The ADC checker got busted at the 4th Row.
    Cannot put any more msg's.
    My main issue which I haven't been able to find an answer so far is storing the msg's in Program memory.

    Is it the EEPROM ?

    I still like to know how I can do it. Cause I am not running out of memory, Statistics (mikroC Pro) shows tht but still msg's get corrupted.
     
  9. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    Program memory is program memory, the memory that stores the program. You can also read and write it in a program on any modern PIC. You could also use EEPROM for the message text, but it is usually only 256 bytes, so you might run out of it. If you are using RAM, the problem with PIC16F is that the RAM is broken up into small, discontinuous chunks, and 18F does not have that problem, but any constant text should not be in RAM anyway since that is wasteful. Look at your MicroC doc's to see how you can store text in either program memory or EEPROM. Note that you will need a special function to write from one of these to the LCD. If the MicroC library has support for LCD, it should have support for strings in program memory as well.

    Bob
     
    R!f@@ likes this.
  10. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,022
    You can't tell from the part number. You CAN tell from the Device ID and Revision ID that is accessible by most programmers (you also can read it at runtime on some parts). While the parts have 'date codes' the silicon rev is not readily apparent on many of them (contact the Microchip sales office or tech support).
    EDIT: the Programming Specifications for the chip will tell you if you can access the DeviceID/Rev and how to do it at runtime.

    Here's what I mean about the silicon revs (for an 18F4520) Compare errata sheets for silicon Rev A1 with Rev B4. 44 issues in the A1! Can't hardly move without getting busted. Some of the latest parts come out of the chute pretty clean but as I've said before:
    The data sheet giveth, the errata taketh away.

    To minimize the risk of getting older, buggy chips, buy from a franchised, high volume distributor, not Ebay, not brokers. Non-franchised guys frequently have excess stock from years back.

    Good point. Specify 'code' to put in ROM i.e.
    Code ( (Unknown Language)):
    1. const char [B]code[/B] aString[]="Hello"; // vs.
    2. const char bString[]="There";
    3.  
    but looking at the generated code, it is the same, at least for this. In our earlier display multiplexer, either one made the tables/strings in ROM. Maybe the optimizer makes use of 'code' but I don't know... Its good as it is.

    One possibility for your messaging problems is that MicroC does NOT completely handle the midrange RAM like it should. From the manual:
    THe 16F887 requires IRP to access RAM banks 2 and 3 via the FSR registers. Look at your assembler output, search on the name of the message with an underscore i.e. _string. If you see it using FSR, you probably have a problem. Looking at DigitsBuf[] in the charger project, I see it doing just that.

    18F - yes.
     
    Last edited: Jun 23, 2014
    R!f@@ likes this.
  11. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    I see what you are saying.

    I was going to ask about where to buy the 18F. So ebay is out.
    Wht about Digikey or Mouser.

    Which supplier would you buy from ?

    Last night I tried const char approach and even though I see tht the RAM usage is getting minimized I get problems. Sometimes it works sometimes it doesn't.
    I learned how to put the code in PM and copy it to RAM before sending to LCD.
    Still the problem exists. I guess I have to use 18F for LCD's.
     
  12. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,509
    2,368
    I buy from DigiKey, no problems so far.
    A main reason for me is overnight delivery to Canada with no brokerage chgs and flat rate shipping.
    Max.
     
  13. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    I buy from Microchip direct, which always has the lowest price, but the shipping is from Thailand, so it takes about 2 weeks.

    Bob
     
  14. Robin Mitchell

    Well-Known Member

    Oct 25, 2009
    732
    199
    PIC18f45k22 for the win!
    It runs at 5V and has many nice features.
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,509
    2,368
    Or 18F46k22 version for another $1 and get twice the memory.;)
    Max.
     
    ErnieM likes this.
  16. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
  17. R!f@@

    Thread Starter AAC Fanatic!

    Apr 2, 2009
    8,741
    759
    Maldives is not listed in Microchipdirect. :mad:
    I should have known. Oh well, nothing new. :(
     
  18. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    My latest choice too, mostly for dual I2C drivers, but 5V and lots of memory.
     
Loading...