Please visit the homepage for location and information on open hours


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC Microcontrollers
06-19-2015, 09:06 PM,
#1
PIC Microcontrollers
Does anybody here play around with Microchip PIC Microcontrollers at all?

I know Arduino is the "go-to" solution these days for prototyping...but I really enjoy playing with 8-bit PICs...I find I can do nearly anything I need done with them...and I can design my own boards with a much smaller footprint when I'm just working with the chip itself (vs. a chip and support PCB such as Arduino).

I typically start a project on a breadboard...and then, if I want to make it a permanent solution, but still a one-off, I use a prototyping board I designed for most 8-pin and 20-pin PIC Microchips (image attached).

This protoboard has connectors for the PICKIT3 programmer (to program a raw PIC), a serial connection for PICAXE chips (PIC chips with a serial bootloader), I also can whack a couple of traces, run a couple of wires, and use the PICAXE connector for serial bootloading of a PIC chip w/out the PICAXE bootloader (needs different serial in / serial out pins). Also, there is a 4-pin header that can go to USB...I sometimes play with PIC18F14K50 chips, which can support USB.

I can bring one of these in if anybody is interested.

Brendan


Attached Files Thumbnail(s)
   
Reply
06-20-2015, 12:18 AM,
#2
RE: PIC Microcontrollers
I haven't played with PICs since college. They're awesome and give you tons more flexibility, but require more setup which is why Arduinos seem to be the default (in multiple form factors even).

I hadn't seen USB support for them before. That's awesome. Huge improvement from having to mess with a serial programmer.
Reply
06-20-2015, 07:59 PM,
#3
RE: PIC Microcontrollers
True, PICs take more setup...but once you're up and running, it's nice!

I think ATMega chips can probably do as much as a PIC can, I just need to learn the lower-level aspects of the ATMega...looking past the "Arduino" code.
Reply
06-21-2015, 01:22 AM,
#4
RE: PIC Microcontrollers
You have direct pin control, how much lower are you wanting? Toss the Arduino libraries and build your own?

You can actually get an ATMega chip w/o the Arduino hardware for roughly the same price range as a PIC, like many microcontrollers. If you want, you can use some versions of the Arduino to program the chip then move it to a breadboard (the Uno is socket mounted instead of surface mount).
Reply
06-21-2015, 06:13 AM,
#5
RE: PIC Microcontrollers
(06-21-2015, 01:22 AM)ABearden Wrote: You have direct pin control, how much lower are you wanting? Toss the Arduino libraries and build your own?

For me, I would like to understand the nuts-and-bolts of the ATmega platform...the Arduino environment / eco-system makes development very easy...but there is such a huge abstraction layer between the code and the chip, that can muddy the waters...for example, I was using the canned "FastLED" library, and was also trying to use interrupt-driven serial communications...it was falling down hard...and I finally figured out the FastLED library disables all interrupts to be able to bit-bang the "spi-ish" protocol at the right speed.

I do like the ease of development that Arduino brings...don't get me wrong...just like I loved PICAXE to learn PIC microcontrollers.

I've also built up circuits around ATMega328P controllers (QFP and DIP) and had success writing the Arduino bootloader to the raw chips (using another Arduino).

I think in my spare time, I might see what's involved in tweaking the bootloader for the ATMega328P to allow for operation using a 20MHZ resonator, vs. the 16MHZ that is the legacy Arduino standard...(Although, this might also mess up some timing / communication features as well...hard to say, again, due to the abstraction layer).

Still, getting another ~4 million instructions per second would be nice!
Reply
06-21-2015, 01:11 PM, (This post was last modified: 06-21-2015, 01:14 PM by ABearden.)
#6
RE: PIC Microcontrollers
According to the ATmega(48/88/168/328) datasheet the chip handles 20Mhz no problem and some have reported running their chip at 25 or 30 Mhz, though no promises on stability. And from what I can find writing your own bootloader seems pretty straight forward. If you want to use Arduino IDE, you should be able to swap to a 20Mhz crystal and use boards.txt to tell the IDE what frequency it's running at (it changes the comm and timing functions appropriately); it already set the 8+ Mhz, external crystal oscillator fuses. For programming, you can get a premade 20Mhz bootloader, but there's lots of info on it on the Arduino forums on modifying your own bootloader for 20Mhz as well. If you don't want Arduino, you have to write your own comm and timing functions anyway (apparently libc has helper macros to calculate that). Really just depends on how deep you want to get, but sounds like you're a two-feet kind of guy. Big Grin

Info Dump:
Software-
Atmel Studio 6 (direct link)
Hardware-
Eval Kit for ATmega328
Low Level-
AVR Instruction Set
Beginning/Getting Started Tutorial
Bootloader/Fuse Setting Tutorial
Reply
06-21-2015, 06:00 PM,
#7
RE: PIC Microcontrollers
Good stuff; thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)