Author Topic: Arduino guy getting his first PIC chip, pointers please  (Read 8108 times)

0 Members and 1 Guest are viewing this topic.

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Arduino guy getting his first PIC chip, pointers please
« on: April 30, 2015, 12:17:08 am »
I recently got hold of a bunch of PIC16F72s from a Shenzhen supplier selling away their NOS at US$0.25/each. I need starter guide.

I am a CS student with some experience playing with Arduino and Raspberry Pi.

PS. I also got a few Altera MAX II (EPM240/EPM570) CPLD evaluation boards, some beginners' instructions is also welcomed.
 

Offline rx8pilot

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: us
  • If you want more money, be more valuable.
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #1 on: April 30, 2015, 12:23:31 am »
What have you done to help yourself so far?

Surely as a CS student, you have heard of Google. Don't mean to be too sharp, most folks are more helpful if you do at least some work.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #2 on: April 30, 2015, 12:36:26 am »
What have you done to help yourself so far?

Surely as a CS student, you have heard of Google. Don't mean to be too sharp, most folks are more helpful if you do at least some work.

So far I got MPIDE X up and running on my Mac and have a LED blinker up and running.

I don't have a PICKit yet and the LED blinker is flashed with my TL866. Is getting an PICKit any good? Will it work on my Mac or do I need to put it on Linux or Windows VM? Is it a good idea for me to hunt down some easier-to-use eval kit for the PIC?

On the CPLD front, VHDL seemed odd to me and Quatrus not working on Mac and not supporting Ubuntu Linux well enough made it quite inconvenient - have to fire up a VM and fiddle with shell scripts every time before using it is a bit tiring.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #3 on: April 30, 2015, 01:21:43 am »
I made a short tutorial for a Cyclone V using schematic entry and a little verilog.

https://www.eevblog.com/forum/microcontrollers/bemicro-cv-questions/msg524041/#msg524041

You will have to adapt it to your device and pinouts, also I don't know what version of Quartus you need for the Max II as in I don't know if it's supported by the latest version.

Also Altera usually has at least a myfirstfpga or cpld demos. I'll try to dig the links to altera university and training, they do have tons of information.

I do prefer VHDL myself, the reason I used verilog on that example was because the OP of that thread was using that.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #4 on: April 30, 2015, 01:55:02 am »
Some links

https://www.openimpulse.com/blog/products-page/product-category/max-ii-epm240-cpld-minimal-development-board/

This seems to have example code and it might be one of your boards

This one could be your other board:

https://www.openimpulse.com/blog/products-page/product-category/max-ii-epm570-cpld-development-board/

The first problem I see is that you are going to need a usb blaster programmer or compatible. Newer FPGA dev boards have the programmer built in. Otherwise you'll have to purchase one from ebay that will work with your dev boards.

You can also pickup something newer including the MAX 10:
https://www.altera.com/products/boards_and_kits/all-development-kits.html

Or go to an FPGA instead.

The cheapest ones that I like are the Arrow BeMicro ones

Products:
http://www.arrow.com/bemicro/

Wiki:
http://www.alterawiki.com/wiki/BeMicro

But their samples have erratas so you might be better off with a DE0 Nano or other ones from Terasic, they have more sample code.

http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=13&List=Simple

But there are many choices and it's hard to decide once you start looking into dev boards, do you want one with the SoC built in? or just FPGA?

No matter what, be prepared, because you are going down the proverbial rabbit hole.

Edit: Also I don't like what Altera has done with their training website and the full overhaul of their site, I can't find the cpld courseware anymore, but this is their new main entry for the free training:
https://www.altera.com/support/training/curricula.html

Legacy courses :
http://wl.altera.com/servlets/searchcourse?num=10&start=10&total=39&forwardto=legacycourses

Tutorias:
https://www.altera.com/support/training/university/materials-tutorials.html
« Last Edit: April 30, 2015, 02:01:05 am by miguelvp »
 

Offline 0b01010011

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #5 on: April 30, 2015, 02:26:53 am »
Had no issues with PicKIT III but don't let small children near it, as they will split the case when you're not looking.

When I started out with PICs the golden rules I followed was:
- ALWAYS start with a blinking LED for any new project, and keep it for debugging.  No point spending 3 days writing something when you don't even have oscillation.
- Remember pins are default analogue inputs.
- For more complex peripherals (e.g. gated TIMER1 or the USART), print out that section of the datasheet and read in its entirety.

Also remember that Microchip does free samples even if you say it's for educational/hobby use.  Never had a request refused, and I must have got at least 20 PICs that way.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #6 on: April 30, 2015, 02:51:26 am »
Some links

https://www.openimpulse.com/blog/products-page/product-category/max-ii-epm240-cpld-minimal-development-board/

This seems to have example code and it might be one of your boards

This one could be your other board:

https://www.openimpulse.com/blog/products-page/product-category/max-ii-epm570-cpld-development-board/

The first problem I see is that you are going to need a usb blaster programmer or compatible. Newer FPGA dev boards have the programmer built in. Otherwise you'll have to purchase one from ebay that will work with your dev boards.

You can also pickup something newer including the MAX 10:
https://www.altera.com/products/boards_and_kits/all-development-kits.html

Or go to an FPGA instead.

The cheapest ones that I like are the Arrow BeMicro ones

Products:
http://www.arrow.com/bemicro/

Wiki:
http://www.alterawiki.com/wiki/BeMicro

But their samples have erratas so you might be better off with a DE0 Nano or other ones from Terasic, they have more sample code.

http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=13&List=Simple

But there are many choices and it's hard to decide once you start looking into dev boards, do you want one with the SoC built in? or just FPGA?

No matter what, be prepared, because you are going down the proverbial rabbit hole.

Edit: Also I don't like what Altera has done with their training website and the full overhaul of their site, I can't find the cpld courseware anymore, but this is their new main entry for the free training:
https://www.altera.com/support/training/curricula.html

Legacy courses :
http://wl.altera.com/servlets/searchcourse?num=10&start=10&total=39&forwardto=legacycourses

Tutorias:
https://www.altera.com/support/training/university/materials-tutorials.html

The CPLD eval board I got is essentially a breakout board with JTAG, oscillator and 3.3V regulator on it and I usually couple it to my Raspberry Pi or Arduino Due during use.

MAX II is supported by the latest Quatrus 14.1. This is one major nice point of it.

I do have an USB Blaster clone for a long time, as it is the cheapest JTAG adapter I can find that OpenOCD supports. I was using it as ARM JTAG but since now I got the CPLD eval board it can start serving me as CPLD JTAG.

FPGA eval boards get utterly expensive here.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #7 on: April 30, 2015, 03:05:15 am »
Had no issues with PicKIT III but don't let small children near it, as they will split the case when you're not looking.

When I started out with PICs the golden rules I followed was:
- ALWAYS start with a blinking LED for any new project, and keep it for debugging.  No point spending 3 days writing something when you don't even have oscillation.
- Remember pins are default analogue inputs.
- For more complex peripherals (e.g. gated TIMER1 or the USART), print out that section of the datasheet and read in its entirety.

Also remember that Microchip does free samples even if you say it's for educational/hobby use.  Never had a request refused, and I must have got at least 20 PICs that way.

I also have this "start with a blinky and keep it blinking" habit on all but the smallest MCUs :-P (8-pin MCU like ATtiny85 or the like never get blinky but anything bigger will)
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #8 on: April 30, 2015, 08:42:03 am »
PIC16F72  is not were you should start... coming from arduion etc ... get hold of  a PIC18 or PIC24 starter board or put an enhanced PIC16 on a BB... 
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #9 on: April 30, 2015, 10:53:12 am »
PIC16F72  is not were you should start... coming from arduion etc ... get hold of  a PIC18 or PIC24 starter board or put an enhanced PIC16 on a BB...

I will try to get a cheap PIC18/24 starter kit maybe, but before that PIC16F72 is all I got. Maybe I would roll a Arduino-compatible board for this chip for now?
 

Offline 0b01010011

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #10 on: May 01, 2015, 04:23:13 am »
I second this - I started on a PIC16F84A I got given in a grab bag, but quickly found the enhanced devices (PIC16F1XXX for example) were the way to go - a variety of pin counts and features and things to play about with.

Another thing is that most of the peripherals are configured in reasonably sane states to begin with so there's no need to set every possible parameter if you don't need to.  But you do need to study the datasheet carefully.

I have a few demo boards that I got with my PicKIT 3 - these aren't too bad really and give you a nice space to experiment from with areas for prototyping.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #11 on: May 01, 2015, 08:47:00 am »
0x53 I wholeheartedly agree
 
Techinx  If you are serious about learning about PIC mcu then I applaud your ambition, I see from your other EEVblog posts ( why a different thread ? ) you seem very capable , It just depends how deep you want to go with the learning PIC process . Plan A … buy a board and fill it with someone else’s  code have a project up and running in hours, and learned very little.

Plan B. Put a PIC16Fxxxx on a board. With a pickit 2 or 3, Nice steady power supply (not usb )  Have the PIC Data sheet and any errata on hand . Install  MPLAB 8.x gather example code  Ready , steady … Go
In assembler code  ….
   Flash a led.
   Read a switch or key pad.
          “Hello world” on a LCD
   Save / read data to PIC EE
          Make a digital alarm clock.
   Make a thermometer ( with and without ADC )
    Communicate to a PC.
   Save data to an I2C eeprom.
   Control a DC motor speed.
   Control a stepper motor.
    Etc etc …be creative…

Project Problems … Post here , 1000 of EE’s ready to help .
This will be a solid foundation and you will now be ready for advanced code bigger and better PIC’s
You could do this with a 16F72 but its a little ancient as a starting device.
I did plan B aged 55 and I am still learning 16 years on.
Good luck, don’t think you will need it.          
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #12 on: May 01, 2015, 10:28:54 am »
Pickit3 works fine in OS X FYI

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26873
  • Country: nl
    • NCT Developments
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #13 on: May 01, 2015, 10:45:29 am »
IMHO PIC is a step back. Better venture into the ARM world; that's where the future is and gives you an advantage to find a job.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #14 on: May 01, 2015, 12:13:08 pm »
0x53 I wholeheartedly agree
 
Techinx  If you are serious about learning about PIC mcu then I applaud your ambition, I see from your other EEVblog posts ( why a different thread ? ) you seem very capable , It just depends how deep you want to go with the learning PIC process . Plan A … buy a board and fill it with someone else’s  code have a project up and running in hours, and learned very little.

Plan B. Put a PIC16Fxxxx on a board. With a pickit 2 or 3, Nice steady power supply (not usb )  Have the PIC Data sheet and any errata on hand . Install  MPLAB 8.x gather example code  Ready , steady … Go
In assembler code  ….
   Flash a led.
   Read a switch or key pad.
          “Hello world” on a LCD
   Save / read data to PIC EE
          Make a digital alarm clock.
   Make a thermometer ( with and without ADC )
    Communicate to a PC.
   Save data to an I2C eeprom.
   Control a DC motor speed.
   Control a stepper motor.
    Etc etc …be creative…

Project Problems … Post here , 1000 of EE’s ready to help .
This will be a solid foundation and you will now be ready for advanced code bigger and better PIC’s
You could do this with a 16F72 but its a little ancient as a starting device.
I did plan B aged 55 and I am still learning 16 years on.
Good luck, don’t think you will need it.     

Maybe I will get a better PIC chip and draw a better Arduino-like dev kit...
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #15 on: May 19, 2015, 09:24:06 pm »
IMHO PIC is a step back. Better venture into the ARM world; that's where the future is and gives you an advantage to find a job.

I know this thread is 18 days old, but this quote can not be more truthful.

Knowing what I know now, and seeing just how terrible MPLABX is, how badly Microchip is being run into the ground... Run... Run while you still can.  Dump pic and get a cheap ARM dev board. Do not put even a few hours into learning anything about PIC 8bit. Ardunio is a step up even if it was a 1/2 as powerful chip if for no other reason than support.
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Arduino guy getting his first PIC chip, pointers please
« Reply #16 on: May 30, 2015, 04:51:36 am »
Why not a PIC32 ? They are not much more expensive and you can get 28 PIN narrow DIP version with between 16 to 256 k Flash, up to 50 MHz. MPLABX is a bit slow, I'd say. It is not a bad IDE but well, it could be muuuch better, faster would be great.

But, if you want to run away from PICs, you can try a Xpresso board (debugger+uC) with LPCXpresso (the IDE), from NXP. The bundle IDE+Board works quite well. And LPCs are quite easy to work with too. Sadly, DIP28 options are limited to one part: LPC1114, it also has 32k Flash like the ATMega328 but double the MIPS and 32 bits to boot :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf