Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 15
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
One birthday today, congrats!
Colin 99 (53)


Next birthdays
05/12 Colin 99 (53)
05/14 hvguy (41)
05/14 thehappyelectron (14)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Computer Science
« Previous topic | Next topic »   

getting started with microcontrollers

Move Thread LAN_403
wylie
Sat May 01 2010, 05:14PM Print
wylie Registered Member #882 Joined: Sat Jul 07 2007, 04:32AM
Location:
Posts: 103
So, i have a few project ideas and they all would be way easier to achieve with a microcontroller. I started shopping around, and i just cant decide on PIC vs AVR.

I have a buddy who loves PICs. He's finishing up a midi-guitar with them lol. Note triggering is still a bit of a problem, but I'm sure he'll figure it out eventually.

Anyway, he programs almost exclusively in assembly. I helped my cousin learn assembly, and we got the "hello world" assignment working...that's the extent of my assembly experience. I haven't used C in a few years, but I'm definitely more familiar with it: 1st computer i bought was a sparcIPX, on which i made an alarm clock program with sound produced by piping a nice big text file into /dev/audio (or whatever it was). Woke up to that noise for 2-3 years lol. Went on to make a number of openGL demo-like programs.

Though i could probably figure out assembly enough to do what i want, I know i can use C to make things work. All the projects i have in mind (LED color-mixing/dimming, and some motor control) would have outputs running in the audio-range or slightly higher (compared to uC clock speeds of 8Mhz and up), so i doubt i'd need the extra speed/efficiency i could gain by programming in ASM.

Conclusion: PIC or AVR? Anyone tried mikroC for PICs? AVR uses gcc, which i'm actually familiar with.

Tangential Question: I was thinking of getting a demo board. The PICKit2+LowPinCountDemoBoard looks like a good entry level solution. It comes with a chip with internal 8mhz internal oscillator, and if that isn't stable enough for my purposes there's enough free protospace on the demo board to add a few external, switchable, xtal resonator nets. Is the demo board necessary though? If the only high freq part of the circuit on my breadboard is the clock resonator, do the breadboard losses add up enough to ruin the operation? Somewhere, I've seen estimates for the parasitic capacitance and inductance for sections of breadboard. Can i just tally up those values for my layout and compare them to the xtal net; if the parasitics swamp the resonator, it won't work?

The demo board just seemed like a convenient platform: add some xtals and some output lines, BAM!

PS: the main reason i want to use some uC action: Watched too many vids of RGB LED projects, and i just had to get in on that sweet, sweet, color-mixing stuff. With my supply of radioshanty parts, i was able to whip up a 3-channel PWM (2 opamps making a LFO-triangle generator feeding the CV pin of a 555, leading to a 2n2222 to invert the duty cycle and buffer the 555 from the irf510 that actually drove the LED string, per color channel.) It "works", but the duty cycle modulation can only span like 50% at most, so the lights never fully dim or fully light. Hence the desire for proper digital control.
Back to top
Kipmans
Sat May 01 2010, 05:45PM
Kipmans Registered Member #91 Joined: Thu Feb 09 2006, 03:03PM
Location: The Netherlands
Posts: 45
If you already have some C and gcc experience, then go for the AVR. If you want to (probably never), you can always switch to assembly on the AVR.

I wouldn't worry about the resonator not working on your breadboard. Just place it within a reasonable distance from the chip and it will work for sure.
Back to top
Lethal Shot
Sat May 01 2010, 05:46PM
Lethal Shot Registered Member #1623 Joined: Tue Aug 05 2008, 03:31PM
Location: The Netherlands
Posts: 39
PICs work just fine on a breadbord, I've prototyped a lot with PICs on breadbords with 10 MHz crystals and haven't had any problem with them so far.
A few friends of mine work with MikroC and it seem to work good, although it will generate more code than is absolutly necessary its possible to view and edit the assembly code if required.

The difference between PICs and AVRs isn't too big. Most just choose one and do everything with them.
Back to top
wylie
Sat May 01 2010, 05:57PM
wylie Registered Member #882 Joined: Sat Jul 07 2007, 04:32AM
Location:
Posts: 103
generate more code than is absolutely necessary

Does that impact the 2k limit on the free version of MikroC? Otherwise i just have to stay inside the storage limits of my uC. Is there any way to estimate the impact on instructions/cycle of bloated code, or do you have to get all empirical up on that biatch?

Sounds like I'd be a lot happier with AVR, and will be fine using the breadboard for my applications (now, when i get around to my induction heater and a HFHV inverter i'll have to switch to point2point construction or a real PCB lol)
Back to top
rp181
Sun May 02 2010, 02:13AM
rp181 Registered Member #1062 Joined: Tue Oct 16 2007, 02:01AM
Location:
Posts: 1529
People usually say ARM's are better for latter, but I think they are fine to start off with if you know C, or any programming language (I know java, and started on that just fine).
You can also use the mbed for quick prototyping, the compiler is online. Its a non-limited simple compiler that downloads a binary to your computer, which you just drag and drop into the mbed. Of course, if the site is down, you cant program (Like now!).
Back to top
Bjørn
Sun May 02 2010, 07:50AM
Bjørn Registered Member #27 Joined: Fri Feb 03 2006, 02:20AM
Location: Hyperborea
Posts: 2058
Look at this: Link2
A more correct feature list can be found here: Link2

That is everything you need for $25, just plug it in a serial port and get to work. It is a high performance 32 bit microcontroller that is extremely capable. It can decode MP3, it can be used as a 2 MHz oscilloscope without overclocking anything. It is immensely more powerful than 8 bit microcontrollers and not really more expensive (no programmer needed).

Another huge advantage is that you can pop into the chatroom and get help with it which is a requirement for getting an easy start unless you really know what you are doing.
Back to top
Lethal Shot
Sun May 02 2010, 01:25PM
Lethal Shot Registered Member #1623 Joined: Tue Aug 05 2008, 03:31PM
Location: The Netherlands
Posts: 39
I don't know how much the extra code impacts the limit, but as far as I know it doesn't make a big difference.
However seeing the link Bjorn gave I would definetly go for the 32 bit controller.
Back to top
wylie
Mon May 03 2010, 10:54AM
wylie Registered Member #882 Joined: Sat Jul 07 2007, 04:32AM
Location:
Posts: 103
Whoa, Thanks Bjorn! Its got more timers than most of the current PIC offerings and dual, 3-phase pwm. Right up my alley smile

They even include the cable for $25, what a steal!
Back to top
Petezel
Sat Nov 12 2011, 08:42PM
Petezel Registered Member #211 Joined: Sun Feb 19 2006, 05:33PM
Location:
Posts: 27
Hey guys,
What are the bare hardware requirements to getting code onto an AVR?
I have poked and prodded about the internet and it left me quite confused.
I run linux and have AVRdude. I currently own an Arduino Uno, Arduino Pro Mini and have http://www.ebay.co.uk/itm/220840262364 (atmega based) and http://www.ebay.co.uk/itm/220868661815 (unknown, probably CP2102) on their way, expected in a week or two. I also have an FTDI232 based DIP32 module but I'm not sure if it works (http://www.futurlec.com/USBMOD3.shtml).

By the way Bjoern, I have that exact ET-STM32 Stamp Module, but I run linux and couldn't figure out the toolchain I'd need, and it was super complicated. I would love to harness the power of that board, but at a later date.
Right now I have a need for small 8-bit controllers to do relatively basic things with. Being able to use the Tiny's would be super effective, due to Link2
I want to be able to program ATMega 8/48/168 and some of the common ATtiny chips. I have seen the ArduinoISP but I am confused as to what it can actually do. Ideally I'd like a solution that doesn't tie up my 'duino, but if that would work, I'll take it!
Is it possible to program an AVR using only a USB<>serial converter?
Does the target chip need to have a bootloader to do this? If it does, how can I load it on?
My thanks to anyone who can point me in the right direction smile
- Petezel
Back to top

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.