Author Topic: PIC User wanting to go Arduino Route  (Read 7340 times)

0 Members and 1 Guest are viewing this topic.

Offline embracinTopic starter

  • Contributor
  • Posts: 16
  • Country: za
PIC User wanting to go Arduino Route
« on: May 28, 2012, 03:41:39 pm »
Hi

I hope this post has not been presented before, but I've got a somewhat simple question, that I can't find a simple answer to.

I am a Third Year Electrical Engineering student, in South Africa, where our micro-controller courses have gone the way of the PIC. I would like to expand my horizons to the realm of arduino micros, so I can decide for myself which I prefer. However in order to do this, I want to compare apples to apples.

On our PIC micros, we build a board from scratch on solderless-breadboard, or veroboard depending on the application, and connect our PICKIT when we need to program/debug the unit. I was wondering how I may do so with an Arduino processor. I dont want to go the route of the UNO etc, as they 'hide' too much away from me, and in South Africa, they are quite expensive, and relatively large and un-customizable when compared to the PIC micro system as I Know it. I would like to develop my own boards to fit into very small areas, such as in remote control plane, and all the boards I have seen have been too large for my needs. Before someone brings up the Arduino Nano, the Nano requires I build another board, which I would like to avoid.

So what I am really asking is
  • How do I connect an Arduino processor in a breadboard so that I can program\debug it without buying any pre-built PCB etc.
  • Is it worthwhile going this route.

In case you where wondering, I DO NOT, want a PIC vs Arduino debate. I simply want to know if there is a PICKIT and breadboard equivalent in the Arduino world.

Regards
EMBracin
 

Offline pkrobot

  • Contributor
  • Posts: 12
  • Country: us
Re: PIC User wanting to go Arduino Route
« Reply #1 on: May 28, 2012, 04:42:14 pm »
If you dislike details to be hidden from you, then perhaps you won't like Arduino. But Arduino makes your life very easy. It is basically an AVR Atmega328 microcontroller, with a bootloader (which allows communication with it it directly from serial port), and a bunch of libraries. So already, a lot of things that you may like to do are hidden from you.

As for the price, you can get an ATmega328 without bootloader for about $3, and with bootloader for $5. You can use a cheap programmer to burn bootloader on to the chip, or you can use an Arduino Uno or an older version to do that. Do a little search on the internet, and you'll find out how to do that. In fact, the official site also gives you that info. Once you've burnt the bootloader on to the chip, you can use a simple, low cost USB-to-TTL serial converter (FTDI is expensive, consider CP2102 based converter available from ebay for less than $3). You can run the AVR chip without an external resonator/crystal for up to 1MHz, but these are cheap, so it won't drive the cost up significantly.

I really like Arduino, but if you are considering expanding your horizons, consider using MSP430, or an ARM core based microcontroller like Stellaris from TI or ST Microelectronics STM32 option. ST has STM32 Discovery kits available from mouser for as low as $8. Another option is using ST's 8-bit micro option. Their STM8S-Discovery kit is available from Mouser for less than $10, and once you have programmed it, you can break off the ST-LINK (programmer section), and use the microcontroller section in your projects. It even has a prototyping area. Have a look at it.

I don't quite understand why you don't like Arduino Nano. Take the connectors off (in fact, on ebay, you can find a lot of sellers selling it without the connectors or still unsoldered), and you shave off at least 2 grams. It is small in size, and incredibly light, because it uses SMD components. The solution is going to be lighter than if you were to make it from through hole components. I use it in my RC planes all the time. There are nano options available without the FTDI USB-to-serial chip and the USB connector (haven't used it myself, since the weight differential is minimal), which is going to be even lighter, and give you an opportunity to make and play with serial comm., since you'll have to make your own converter.

-pk
 

Offline T4P

  • Super Contributor
  • ***
  • Posts: 3697
  • Country: sg
    • T4P
Re: PIC User wanting to go Arduino Route
« Reply #2 on: May 28, 2012, 05:29:26 pm »
I really like Arduino, but if you are considering expanding your horizons, consider using MSP430, or an ARM core based microcontroller like Stellaris from TI or ST Microelectronics STM32 option. ST has STM32 Discovery kits available from mouser for as low as $8. Another option is using ST's 8-bit micro option. Their STM8S-Discovery kit is available from Mouser for less than $10, and once you have programmed it, you can break off the ST-LINK (programmer section), and use the microcontroller section in your projects. It even has a prototyping area. Have a look at it.
One cannot simply opt for arduino ...
but one can just simply opt for full bore : the STM32F4-Disco i have it and it's verrrrrrrrrrrrrrrry fast
like
 

Offline embracinTopic starter

  • Contributor
  • Posts: 16
  • Country: za
Re: PIC User wanting to go Arduino Route
« Reply #3 on: May 28, 2012, 05:49:42 pm »
Thanks All for your quick responses.

I like the idea of going for alternative brands, however the issue is supply. Outside the US we get taxed really heavily for postage items, and thats if some guy in the postal service, doesnt decide to keep the stuff for himself.

So I generally tend to go for stuff I can get over-the-counter, or cash on delivery, which limits my choices quite a bit, since I only order in multiples of 2 or 3. I do, do my own PCB's so stuff like SMT components is a non-issue.

I want to go for a stand alone arduino, as I can get the ATMega-328 for $4 as opposed to the UNO for about $40, here, so you can see my thought process. Additionally I always prefer to build the actual prototype before PCB, so having through hole is generally a plus, as I like to see any bugs and quickly be able to create a solution on breadboard without going through new PCBs etc. I also would prefer a single board where less can go wrong on my Remote control applications, as I use older nitro engines, which cause far too much vibrations if multiple boards and connectors are used, which has caused a friends plane to crash dramatically (further reason for my UNO hesitation).

Those STM starter packs cost upwards of $100 here so I am quite opposed to that for the moment.

Can someone please post a link on how to burn your own bootloader, and create the necessary hardware required.

Regards
EMBracin
 

Offline XynxNet

  • Regular Contributor
  • *
  • Posts: 185
  • Country: de
Re: PIC User wanting to go Arduino Route
« Reply #4 on: May 28, 2012, 07:15:27 pm »
Think about the MSP430 LaunchPad. They cost 4.30$, 2 slightly different micros are included, shipping is free and if you want to design your own optimized board later you can just yank out the dip chip an reuse it in your board.
« Last Edit: May 28, 2012, 07:18:04 pm by XynxNet »
 

Offline gtsili

  • Contributor
  • Posts: 36
  • Country: gr
  • A software/systems engineer revisiting electronics
Re: PIC User wanting to go Arduino Route
« Reply #5 on: May 28, 2012, 07:21:36 pm »

So what I am really asking is
  • How do I connect an Arduino processor in a breadboard so that I can program\debug it without buying any pre-built PCB etc.
  • Is it worthwhile going this route.


The following site has instructions on how to breadboard the Atmega chip:

http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

To program and debug the chip you need a RS232 to TTL adapter and a cheap and dirty one that works (I have built that and currently using it) all you need is a few inexpensive components, I am attaching the schematic on this post.

Finally, if you can not get the atmega chip pre-programmed, you can also make a cheap parallel or serial bit-bang programmer like this one:

http://stuff.nekhbet.ro/2006/06/15/avr-simple-to-build-programmer-hardware.html

I have no idea if it is worthwhile but I hope that helps.

------------   edit #1  ------------------
Better look at this site for the programmer, it is more complete:

http://www.serasidis.gr/circuits/avrprog/avrprog.htm

------------   edit #2  -------------------

Just to make it a bit clearer, you need the parallel (or serial) bit-bang programmer so that you can burn the arduino bootloader. Once you have done that you can upload your compiled programs (or "sketches") using the serial2TTL adapter.
« Last Edit: May 28, 2012, 07:44:53 pm by gtsili »
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: PIC User wanting to go Arduino Route
« Reply #6 on: May 28, 2012, 07:41:46 pm »

but one can just simply opt for full bore : the STM32F4-Disco i have it and it's verrrrrrrrrrrrrrrry fast
like


AAAAAARRRRRGGGGGHHHHH they are going to be here in 3 weeks, already the roads are being closed for remodelling, and the main traffic routes I use to work either go past there or ill have all the spillover traffic.
 

alm

  • Guest
Re: PIC User wanting to go Arduino Route
« Reply #7 on: May 28, 2012, 08:05:44 pm »
but one can just simply opt for full bore : the STM32F4-Disco i have it and it's verrrrrrrrrrrrrrrry fast
That's great, except that arithmetic performance is completely irrelevant for many applications. If you cared at all about performance, you wouldn't be using an 8-bit micro in the first place. How does its power usage, interrupt latency and GPIO bit banging rate compare to 8/16-bit micros?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: PIC User wanting to go Arduino Route
« Reply #8 on: May 29, 2012, 05:38:44 am »
Simpler Arduinos are a common topic on the Arduino forums, and the arduino project itself is a pretty big proponent of homebuilt versions.  http://arduino.cc/en/Main/Standalone is an officially sanctioned version of the ITU tutorial, for example, and there have been recent discussions of breadboard versions using the 1284p (40pin DIP)

I prefer minimalist PCBs to securely hold the basic components, like the "Really Bare Bones Board" from http://shop.moderndevice.com/products/rbbb-kit or my Single sided version thereof http://www.instructables.com/id/Single-Sided-Really-Bare-Bones-Board-Arduino-in-EA/
 

Offline Chet T16

  • Frequent Contributor
  • **
  • Posts: 535
  • Country: ie
    • Retro-Renault
Re: PIC User wanting to go Arduino Route
« Reply #9 on: May 29, 2012, 07:10:50 am »
Chet
Paid Electron Wrestler
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: PIC User wanting to go Arduino Route
« Reply #10 on: May 29, 2012, 10:07:32 am »
How were you programming your pics ? your question seems to be more about ease of use and programming environment. Arduino is not so much about the brand of MCU but the development environment that is made available.
 

Offline gtsili

  • Contributor
  • Posts: 36
  • Country: gr
  • A software/systems engineer revisiting electronics
Re: PIC User wanting to go Arduino Route
« Reply #11 on: May 29, 2012, 10:48:22 am »
Since you probably have all the required tools and the knowledge on PICs, you may want to go the "arduino" route using the PIC way. As Simon said "arduino" is not about the MCU but the easy of use and the programming environment. So why not give Pinguino (http://www.pinguino.cc/) a try. It is supposed to be arduino compatible (language, libraries and shields), targeted at both 8bit and 32bit MCUs and probably even easier to use, since you need no additional hardware to connect it to a USB port so you can program and debug once the bootloader is burned in.
 

Offline embracinTopic starter

  • Contributor
  • Posts: 16
  • Country: za
Re: PIC User wanting to go Arduino Route
« Reply #12 on: May 30, 2012, 02:20:02 pm »
Hey all...

Great Ideas, But I believe a small amendment is in order.

I plan on automating my remote control plane, with some flight assistance, gyro assistance, flight recorder etc, etc. The best and easiest way to do this is with the ATMEGA-328 as it contains 4 built in, dedicated, PWM modules, unlike most of the PIC micros I can get hold of.

To gtsili, I would like to know whether or not Pinguino (which seems awesome) would cope with creating an appearance of 4 stable PWM outputs at ~400Hz while still running tight control code.

I have no qualms with the programming IDE interface, in fact I am quite comfortable with C/C++, PIC assembler, etc. I am actually very interested in the MCU, as it would appear the arduino is better than the PIC, by the prices I get, that the ATMega-328 which is slightly cheaper than the PIC16F690 (my go to processor of choice), and faster and comes with more features. Maybe I am overlooking something, but it appears to be quite viable at the moment to consider the ATMEL route.

Again I am not saying one is better until I have both in my hand and have actually played with it. I currently favour the PIC environment, and like the low and high level control I can get using the C/assembler hybrid programming style available with the C compilers (Ie, inserting assembler code into the generated assembler code where tight loops are needed). But that is as I know no better.
 

Offline gtsili

  • Contributor
  • Posts: 36
  • Country: gr
  • A software/systems engineer revisiting electronics
Re: PIC User wanting to go Arduino Route
« Reply #13 on: May 30, 2012, 03:31:21 pm »
To gtsili, I would like to know whether or not Pinguino (which seems awesome) would cope with creating an appearance of 4 stable PWM outputs at ~400Hz while still running tight control code.

I am afraid I do not have a pinguino (or a PIC18F(2/4)550 to build one myself) so my knowledge is limited on what I can find on their site. A quick search revealed that the default is to have 2 fast PWM outputs (3000 Hz) (http://wiki.pinguino.cc/index.php/PIC18F2550_Pinguino) but I did find that:  "What happens if you need more PWM pins. You could do it yourself by software (using interrupts). We will provide a example in the expert section soon." (https://sites.google.com/site/pinguinotutorial/led-dimmer-pwm). You will be better off to ask that question on a pinguino forum.

I guess that you do not have a PIC18F(2/4)550 to give it a go. Since you are going to buy a few parts anyway, go for an ATmega328 a 16 MHz crystal and the few passives that you are going to need to build yourself an arduino on a breadboard. It does sound worthwhile since you need 4 PWM outputs.

A quick note, if you go the arduino way, once you have your breadboard ready and the MCU flashed with the bootloader when you try to upload your first sketch you may find it very frustrating to time resetting the arduino at the correct time so that the sketch is uploaded. I have managed to find the correct timing and I usually get it each time, but you can also put a cap between the DTR line and the reset pin to do that for you, if I remember correctly.
 

Offline embracinTopic starter

  • Contributor
  • Posts: 16
  • Country: za
Re: PIC User wanting to go Arduino Route
« Reply #14 on: May 31, 2012, 05:34:39 pm »
Would a MAX232 perform the same function. I have a prebuilt board with that chip for serial debugging of PICs, and it would be great if I could use it.

On another note, I have a couple 18F4550's on hand (currently trying to make my own PCB router) and will try out Penguino and see if I can get something working. Just currently writing exams, so juggling quite a few things at once.
 

Offline gtsili

  • Contributor
  • Posts: 36
  • Country: gr
  • A software/systems engineer revisiting electronics
Re: PIC User wanting to go Arduino Route
« Reply #15 on: May 31, 2012, 08:23:51 pm »
Would a MAX232 perform the same function. I have a prebuilt board with that chip for serial debugging of PICs, and it would be great if I could use it.

On another note, I have a couple 18F4550's on hand (currently trying to make my own PCB router) and will try out Penguino and see if I can get something working. Just currently writing exams, so juggling quite a few things at once.

I have not tried a max232 but it should work like a charm since that is what it does.

Great, let us know your experience with pinguino. Good luck with your exams.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf