Author Topic: How to choose a PIC, specific Project in mind...  (Read 4318 times)

0 Members and 1 Guest are viewing this topic.

Online kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: za
    • ShoutingElectronics.com
How to choose a PIC, specific Project in mind...
« on: June 03, 2014, 07:55:33 pm »
Hi All,

I am just looking for your help (and suggestions)
I want to build a 'Universal Logger'.
Basically a PIC Micro, that can log to a text file on a FAT formatted SD Card.
A USB interface on the pic would be nice to connect to the PC for configuration, etc, but I could always use the UART, or a FTDI usb to UART conversion.
Also, Preferrably built in RTC, although might go for external one if it works out cheaper.

Low Power for battery use would be good.

Once I have the basics down, then I can tailor the program depending on what I want to Log, etc
Have a few 1 Wire Temperature Sensors logged at 5 minute intervals.
or
Have it log all the pin states for a Port, and if any pins change state, timestamp and record the new value.
or
Log Current / Voltage / Power at certain times, etc.

As I say, once I have the basics down, then all i have to do is make up 'shields' and change the coding (or add functions that can be selected via a sort of menu, etc).

The main problem that I am having is figuring out what PIC I need.
For Development, I need to have a Through Hole DIP for breadboarding, but later may want to do a SMT board.
I prefer to use C18 with some libraries (eg ADC Lib, XLCD, etc)

I have checked the Microchip MDDFS (Memory Disk Drive File System) Library specs for memory requirements, and it has the following for the C18's

Code: [Select]
	                  PROG	        DATA
R/O                    25203         1886
Write Enabled   17366          0
Format Enabled   7394         0

Total Bytes         49963         1886
Kbytes                  50         2

So If I am doing this right, for Read Only + Writing + Formatting, I will need 50KB Programming Memory, and 2 KB Data Memory.

Then I will need the space for the other LIBS and my own coding.

Oh, and it will also need to be compatible with a Pickit 2, 'cos that is the only programmer that I can afford at the moment..

Anybody have suggestions on which pic to use. I have tried their parametric search, but the vast amount of options makes my head spin, and makes it hard to choose.

Much, Much Appreciated for all your suggestions and input.

P
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5137
  • Country: ro
  • .
Re: How to choose a PIC, specific Project in mind...
« Reply #1 on: June 03, 2014, 09:23:39 pm »
That library is huge.

You can use
* FatFS : http://elm-chan.org/fsw/ff/00index_e.html  or
* PetiteFS : http://elm-chan.org/fsw/ff/00index_p.html

PetiteFS is optimized for 8bit microcontrollers and is much lighter (2-4KB program, 44 bytes ram + stack) but it has some limitations you may not care about ( Single volume and Single file , File write function with some restrictions).

You can talk to SD cards using SPI, probably all pic chips have it. So this isn't an issue, you don't need to look for something special.

Lots of documentation about SD Cards, SPI, FatFS here:

http://blog.silabs.com/2013/02/07/how-to-interface-an-sd-card-with-fat-file-system-using-spi/
http://www.engineersgarage.com/embedded/avr-microcontroller-projects/sd-card-interfacing-project
http://www.dharmanitech.com/2009/01/sd-card-interfacing-with-atmega8-fat32.html

USB ... it's probably more expensive but I would personally go with external USB to serial chip, instead of using a PIC with built in USB.  The built in USB requires space for the code needed to run it, you're limited to certain oscillators, it makes everything less flexible for you.
You may also be unable to flash some of these newer PICs with the Pickit 2.
Leave the usb separate, use a usb to uart, that means your PIC will only need to have one UART and one SPI available at same time (or just uart, you could bit bang spi but why...). This will also allow you to leave the usb chip running all time while your pic can switch frequencies, go to sleep between measurements, and you don't have to worry about the usb part, that's taken care of the separate chip.
Few PIC mcus have rtc inside and the oscillators aren't accurate enough to not have some drift in time.. they're about +/- 3%

I would look at something like PIC16F1516 or PIC16F1519 (or one in between): 
16F1516 : http://www.digikey.com/product-detail/en/PIC16F1516-I%2FSP/PIC16F1516-I%2FSP-ND/2651364
16F1519 : http://www.digikey.com/product-detail/en/PIC16F1519-I%2FP/PIC16F1519-I%2FP-ND/2651374

They have 512 bytes of ram,  lots of flash memory (7 or 16 k  x 14bit ) so you have plenty of room for fat library + menus + whatever you want, and lots of pins for sensors or whatever you want to put on it.

I've used the 16f1519 in a project recently and it was a pleasure to work with it, not having to care about how much flash memory my code is going to use.

The 1516 is about 1.5$ if you buy 10..  Cheapest with usb pic18f14k50 at 2.4$ if you get 10... http://www.digikey.com/product-detail/en/PIC18F14K50-I%2FP/PIC18F14K50-I%2FP-ND/1999470  and remember you'd also need oscillator for it and you only have 8KB of flash memory (need flash for usb library and fatfs library so really 8kb is little)
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27943
  • Country: nl
    • NCT Developments
Re: How to choose a PIC, specific Project in mind...
« Reply #2 on: June 03, 2014, 09:25:43 pm »
Why a PIC? Look at the LPC1114 from NXP for example. That can be programmed over a serial (USB) port using Flashmagic (free!) and has a free C compiler (LPCExpresso or GCC + Eclipse). This is a complete module ready to go: http://www.ebay.com/itm/Z111xP-New-ARM-Cortex-M0-Core-Module-LPC1114-Development-/310708342484  Hook an SD card to the SPI port and use FatFs (http://elm-chan.org/fsw/ff/00index_e.html) to handle the filesystem on the SD card. Fatfs is pretty straightforward to use and works reliable (I did some stress tests myself).
« Last Edit: June 03, 2014, 09:27:14 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: How to choose a PIC, specific Project in mind...
« Reply #3 on: June 04, 2014, 05:21:19 am »
Why a PIC? Look at the LPC1114 from NXP for example. That can be programmed over a serial (USB) port using Flashmagic (free!) and has a free C compiler (LPCExpresso or GCC + Eclipse). This is a complete module ready to go: http://www.ebay.com/itm/Z111xP-New-ARM-Cortex-M0-Core-Module-LPC1114-Development-/310708342484  Hook an SD card to the SPI port and use FatFs (http://elm-chan.org/fsw/ff/00index_e.html) to handle the filesystem on the SD card. Fatfs is pretty straightforward to use and works reliable (I did some stress tests myself).

Is the Z111xP board open sourced?  Is it possible to clone its design into custom PCB's?  Where is the schematic, bootloader, etc?
 

Online kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: za
    • ShoutingElectronics.com
Re: How to choose a PIC, specific Project in mind...
« Reply #4 on: June 04, 2014, 06:19:43 am »
Without trying to start a uC war, the reason I want to use a PIC is because that is the Micro that I know the best (been using it since EPE Magazine had their first PIC tutorial years and years ago.), and can use quite easily. Thanks for the smaller libs. I will see, maybe I can squeeze it into the PIC18LF2420 that I have the most experience with.

P
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27943
  • Country: nl
    • NCT Developments
Re: How to choose a PIC, specific Project in mind...
« Reply #5 on: June 04, 2014, 11:09:04 am »
Why a PIC? Look at the LPC1114 from NXP for example. That can be programmed over a serial (USB) port using Flashmagic (free!) and has a free C compiler (LPCExpresso or GCC + Eclipse). This is a complete module ready to go: http://www.ebay.com/itm/Z111xP-New-ARM-Cortex-M0-Core-Module-LPC1114-Development-/310708342484  Hook an SD card to the SPI port and use FatFs (http://elm-chan.org/fsw/ff/00index_e.html) to handle the filesystem on the SD card. Fatfs is pretty straightforward to use and works reliable (I did some stress tests myself).

Is the Z111xP board open sourced?  Is it possible to clone its design into custom PCB's?  Where is the schematic, bootloader, etc?
The design is pretty simple: a 3.3V regulator, an FTDI USB/serial converter and a microcontroller. The bootloader comes standard with the microcontroller when you buy it from NXP. There is nothing to open source about it.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: How to choose a PIC, specific Project in mind...
« Reply #6 on: June 04, 2014, 11:22:02 am »
Quote
the reason I want to use a PIC is because that is the Micro that I know the best

Sounds like a reason NOT to use a PIC: you already know it. Time to learn something else.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf