Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Microcontroller programming (Arduino, Microchip PIC, etc)

Options
  • 23-03-2011 12:11am
    #1
    Closed Accounts Posts: 1,864 ✭✭✭


    Anyone here into this kind of stuff. Been reading around the forum and only been finding posts about very high level (mostly web related) programming. Nothing wrong with that but I'm just looking to see if anyone else on here is into Arduinos and what have you.


«1

Comments

  • Registered Users Posts: 5,246 ✭✭✭conor.hogan.2


    Very interested, never actually used them though.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    Very interested, never actually used them though.
    The arduino is a great one to start with, even if you dont know any C. They make it so easy a 5 year old could program it


  • Registered Users Posts: 5,246 ✭✭✭conor.hogan.2


    Its lack of money and time and not being bothered atm.

    Have you used them? If so where do you get your parts? I know maker sell kits.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    Its lack of money and time and not being bothered atm.

    Have you used them? If so where do you get your parts? I know maker sell kits.

    Ebay mostly. Got 5 PICs for about 5GBP (12f`s tiny 8-pin yokes), the programmer was a wee bit more expensive but there is DIY jobs. One can make a very cheap arduino board this way too http://www.instructables.com/id/Perfboard-Hackduino-Arduino-compatible-circuit/ although I havn't tried. I must also admit I found a PIC or two "just laying around" at college. Of course I will return these when I finish :D not that they will miss them or anything


  • Registered Users Posts: 5,246 ✭✭✭conor.hogan.2


    Cool. I will have to get into these I first looked them up years ago. When I wondered was there any "open source hardware". I imagine I will burn through many of these if I solder as my soldering is basic at best. Probably will stick to the solderless ones.


  • Advertisement
  • Registered Users Posts: 1,922 ✭✭✭fergalr


    Daegerty wrote: »
    Anyone here into this kind of stuff. Been reading around the forum and only been finding posts about very high level (mostly web related) programming. Nothing wrong with that but I'm just looking to see if anyone else on here is into Arduinos and what have you.

    Yeah, messed around with arduinos a little bit.

    Really easy to work with, nice docs, easy to get up and running, thoroughly recommend them if you want to play with microcontrollers.


    Here is a video of simple project I did, with an old RC car I bought for a fiver on adverts:
    http://www.youtube.com/watch?v=WoCA7rZMdpQ

    I ripped out all the electronic guts of it, and replaced it with an arduino, and a motor controller and all that stuff.

    It even has a laser =)


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    fergalr wrote: »
    Yeah, messed around with arduinos a little bit.

    Really easy to work with, nice docs, easy to get up and running, thoroughly recommend them if you want to play with microcontrollers.


    Here is a video of simple project I did, with an old RC car I bought for a fiver on adverts:
    http://www.youtube.com/watch?v=WoCA7rZMdpQ

    I ripped out all the electronic guts of it, and replaced it with an arduino, and a motor controller and all that stuff.

    It even has a laser =)
    Ahhhh! That's exactly the stuff I want to go doing. Something that has results! I might give a start at this stuff too! So exciting


  • Registered Users Posts: 1,922 ✭✭✭fergalr


    Webmonkey wrote: »
    Ahhhh! That's exactly the stuff I want to go doing. Something that has results! I might give a start at this stuff too! So exciting

    It was good fun to play with.
    I did it to refresh my electronics knowledge.
    Made several smaller arduino projects first, had a quick go at building a simple lego robot, and then went on to build this simple project.

    Its amazing how fast you can pick up the practical electronics, when you've got a bit of a grounding in the 'theoretical waffle' :pac:
    And the internet is great these days - there's so much information easily accessible out there.
    I think we're really entering a create age of practical 'do it yourself' projects - its so easy to find the resources, these days.

    Actually, one thing I'd recommend, is to head along to one of the hackerspaces, like 'tog' - from what I can see, they've got a good crew there doing all sorts of more interesting projects, with arduinos and the like.


  • Registered Users Posts: 2,119 ✭✭✭p


    I've used it for a few projects and it's good fun, but does require a little bit of knowledge.

    www.data.ie occasionally run workshops also check out www.tog.ie or www.robots.ie to see if anyone's doing anything interesting at the moment.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    fergalr wrote: »
    It was good fun to play with.
    I did it to refresh my electronics knowledge.
    Made several smaller arduino projects first, had a quick go at building a simple lego robot, and then went on to build this simple project.

    Its amazing how fast you can pick up the practical electronics, when you've got a bit of a grounding in the 'theoretical waffle' :pac:
    And the internet is great these days - there's so much information easily accessible out there.
    I think we're really entering a create age of practical 'do it yourself' projects - its so easy to find the resources, these days.

    Actually, one thing I'd recommend, is to head along to one of the hackerspaces, like 'tog' - from what I can see, they've got a good crew there doing all sorts of more interesting projects, with arduinos and the like.
    I only done the theoretical parts of electronics in my IT course, had a lot of telecoms so that's where it crept into. I've always loved to get into the practical side of it but never get the time! Maybe if I just buy one of these I'll manage to get started.

    Ha yeah that "theoretical waffle", apparently it's not needed by some (/looks at another thread)

    I've briefly looked at those hacker spaces alright. I'm after recently moving to Dublin so would be well up for meeting people with similar interests. Might check it out properly now some day!

    Cheers!


  • Advertisement
  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    All this talk of theoretical waffle now I'm starting to wonder what it actually consists of. I suppose one could talk endlessly about the power consumption of the chip and what have you but i'm starting to think that if someone thinks its 'theoretical waffle' they aren`t really too interested or dont have enough groundwork built up.

    Only just got a pic to flash a led for me on a piece of protoboard today, should be tearing into the more interesting stuff now. I only got my pic programmer the other day, real old dirty looking yoke but radionics is still selling them for 160 euros :eek:


  • Posts: 0 [Deleted User]


    Programming is so much cooler when the software is controlling hardware and you can see your creation interacting with the world. I've built a theremin instrument, and some other stuff.

    Currently prototyping a more advanced project for a client, which will be stretching the arduino. LCD screen, buttons, several control outputs all regulated by a simple menu-driven operating system using a realtime clock.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    Currently prototyping a more advanced project for a client, which will be stretching the arduino. LCD screen, buttons, several control outputs all regulated by a simple menu-driven operating system using a realtime clock.

    Are you doing this sort of work with a company? Do you have to make the PCB and everything for it too?


  • Posts: 0 [Deleted User]


    Daegerty wrote: »
    Are you doing this sort of work with a company? Do you have to make the PCB and everything for it too?

    Yes I am. We got the gig as a result of web work I had already done for the company. I already had some experience with arduino, so they were happy to let me take it on.

    They know that the transition from prototype to production will require outside expertise, but fortunately I know some gurus who can assist if/when we get to that stage.


  • Registered Users Posts: 586 ✭✭✭Aswerty


    I recently did a Masters project which involved using PIC's and ZigBee transmitters. I enjoyed using them and looked to find a graduate position in embedded software development but I didn't have any luck.

    I've been meaning to start putting together a tool-kit to start doing some home projects. The arduino's look great, haven't used one but know plenty of guys who have. They seem like cheating though due to the rapid development speeds compared to PIC's.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    Aswerty wrote: »
    I've been meaning to start putting together a tool-kit to start doing some home projects. The arduino's look great, haven't used one but know plenty of guys who have. They seem like cheating though due to the rapid development speeds compared to PIC's.

    ah now not really cheating. can't say that using MPLAB C & ICD3 is any slower than an arduino to develop on with all the libraries it has. mplab is a bit of a pig of a piece of software to work with and its an expensive setup but I think you can also program arduinos in assembly easily enough, even break into assembly from the arduino IDE although I havn't tried


  • Registered Users Posts: 5,369 ✭✭✭DublinDilbert


    I've been quite impressed with the microchip mplab & picstart 3 programmer recently. Have used on a few 18f projects and it works really well.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    I've been quite impressed with the microchip mplab & picstart 3 programmer recently. Have used on a few 18f projects and it works really well.

    o rly? what kind of stuff have you been making? what language?


  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    Daegerty wrote: »
    ah now not really cheating. can't say that using MPLAB C & ICD3 is any slower than an arduino to develop on with all the libraries it has. mplab is a bit of a pig of a piece of software to work with and its an expensive setup but I think you can also program arduinos in assembly easily enough, even break into assembly from the arduino IDE although I havn't tried

    Yeah, but that's sortof like buying a Mini to pull a plough.
    The whole point of the arduino is to not do assembly or even C.
    (Which, granted, is one reason why I never bothered with them)

    Also, don't forget that if the Arduino is the kind of approach you want to take, there are also platforms like the BASICStamp out there, where you code directly in BASIC, and the Javelin Stamp where you code directly in Java, and others like that.

    I will say this though - the best coders I know are the coders who play with these things. Knowing how stuff works down on the silicon is one of the fundamental skills that the really great coders have in spades.


  • Registered Users Posts: 586 ✭✭✭Aswerty


    Daegerty wrote: »
    ah now not really cheating. can't say that using MPLAB C & ICD3 is any slower than an arduino to develop on with all the libraries it has. mplab is a bit of a pig of a piece of software to work with and its an expensive setup but I think you can also program arduinos in assembly easily enough, even break into assembly from the arduino IDE although I havn't tried

    As I said before I haven't got around to using an arduino yet but am somewhat familiar with them. I'm just basing it on the fact that projects I've seen using arduino's have a much faster/easier coding stage than projects using PIC's. This is due to the much longer ramp up time in getting familiar with PIC's as well as PIC users having to code at a much lower level. Even using c is a fair bit closer to the bit level than what I've seen of arduino code.

    Of course arduino's aren't actually cheating. I suppose it's just my dislike of moving up into the more abstract levels of coding. I'm an engineer as opposed to a coder at heart. I do think the arduino is a great tool but maybe it moves the user away from having to understand the hardware they are using. Maybe an inevitable move though since PC based coding has already done it.

    The arduino has some great extensibility though like USB, LCD and ethernet shields.


  • Advertisement
  • Registered Users Posts: 1,922 ✭✭✭fergalr


    Aswerty wrote: »
    As I said before I haven't got around to using an arduino yet but am somewhat familiar with them. I'm just basing it on the fact that projects I've seen using arduino's have a much faster/easier coding stage than projects using PIC's. This is due to the much longer ramp up time in getting familiar with PIC's as well as PIC users having to code at a much lower level. Even using c is a fair bit closer to the bit level than what I've seen of arduino code.

    Of course arduino's aren't actually cheating. I suppose it's just my dislike of moving up into the more abstract levels of coding. I'm an engineer as opposed to a coder at heart. I do think the arduino is a great tool but maybe it moves the user away from having to understand the hardware they are using. Maybe an inevitable move though since PC based coding has already done it.

    Oblig:
    real_programmers.png



    First off, you could make the same argument about microcontrollers in general, and not just arduinos.
    Working with a microcontroller CPU, and programming it, is much more abstract than going and implementing each piece of logic using ICs (or even analog circuits).



    Anyway, more holistically, I think Arduino is having the opposite effect to the one you are concerned with.


    Rather than moving developers away from the hardware, so that they learn less about whats going on - Arduino is actually bringing them back to it.
    The fact that you can acomplish fairly impressive hardware interfacing, quickly and easily, with an arduino, encourages people to go and play with hardware.
    People who would otherwise have avoided it, now go and get their hands dirty.

    Just look at the huge number of arduino projects out there to see the effect this is having.


    In turn, the number of other people doing cool projects, increases the amount of resources out there, the easy access to information, tutorials, etc.
    And the end result is people learning lots of low level concepts, that they'd otherwise probably never deal with.

    You still do acquire and use a lot of low level knowledge - Arduino makes the start of the learning curve much more accessible, but as you want to do progressively more things, you have to cover the harder stuff too.
    Its easier to get started with an arduino, and use it to drive the guts of your project, but controlling the hardware is still a long way from VB6.

    Aswerty wrote: »
    The arduino has some great extensibility though like USB, LCD and ethernet shields.


  • Posts: 0 [Deleted User]


    fergalr wrote: »
    Oblig:
    Rather than moving developers away from the hardware, so that they learn less about whats going on - Arduino is actually bringing them back to it.
    The fact that you can acomplish fairly impressive hardware interfacing, quickly and easily, with an arduino, encourages people to go and play with hardware.
    People who would otherwise have avoided it, now go and get their hands dirty.

    +1

    As a software head, I'd never have gone near electronics if it weren't for the arduino making it so accessible.


  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    As a software head, I'd never have gone near electronics if it weren't for the arduino making it so accessible.
    See, if by "electronics" you mean LEDs, resistors, capacitors, and so on, cool.
    If by "electronics" you really mean "microcontrollers and assembly", then dude. Go play with the electronics now. It'll make you a better coder.

    Why we gave up on the idea of handing out a bunch of wire and a handful of chips and saying "go build a PC" on the first day of first year in a CS course, I'll never know. I mean, after you do assembly, pointers, arrays, linked lists, callbacks, pretty much every code-level concept that takes a while to first introduce to someone, they're all far far simpler in your mental model.

    Well, until you get to C++ and pointers to references anyway :D


  • Posts: 0 [Deleted User]


    Sparks wrote: »
    See, if by "electronics" you mean LEDs, resistors, capacitors, and so on, cool.
    If by "electronics" you really mean "microcontrollers and assembly", then dude. Go play with the electronics now. It'll make you a better coder.

    Why we gave up on the idea of handing out a bunch of wire and a handful of chips and saying "go build a PC" on the first day of first year in a CS course, I'll never know. I mean, after you do assembly, pointers, arrays, linked lists, callbacks, pretty much every code-level concept that takes a while to first introduce to someone, they're all far far simpler in your mental model.

    Well, until you get to C++ and pointers to references anyway :D

    Current project has an arduino, LCD screen, 10k pot, some push buttons, some resistors. There will be more discrete components for the battery backup circuitry - unless I can buy that functionality prepackaged in a chip :-)

    There's a lot to be said for knowing things from the ground up. Electricity, silicon properties, transistors, registers, Von Neumann architecture, etc. I'd have done a certain amount of that at college, and read up on it further later.

    That being said with the number of layers of abstraction between the code and the hardware on a modern PC these days, there's no point in being a luddite for the sake of it. i.e. use assembly code where necessary for speed critical functions, use higher level code elsewhere and don't lose sleep if you use an IDE, third party frameworks and libraries :pac:


  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    I don't lose sleep over people who do that, knowing the tradeoffs and costs involved. I do get rather annoyed at people who do that because they know no other way to approach the problem. People like that make work for everyone else around them :(


  • Registered Users Posts: 1,922 ✭✭✭fergalr


    Sparks wrote: »
    See, if by "electronics" you mean LEDs, resistors, capacitors, and so on, cool.
    If by "electronics" you really mean "microcontrollers and assembly", then dude. Go play with the electronics now. It'll make you a better coder.

    Why we gave up on the idea of handing out a bunch of wire and a handful of chips and saying "go build a PC" on the first day of first year in a CS course, I'll never know. I mean, after you do assembly, pointers, arrays, linked lists, callbacks, pretty much every code-level concept that takes a while to first introduce to someone, they're all far far simpler in your mental model.

    Well, until you get to C++ and pointers to references anyway :D


    I've a lot of sympathy for this point of view, but recently I've been wondering.


    By about the end of second year, in CS in TCD, we'd built most of the parts of a computer, working from the level of the transistor upwards.
    Not all at once, but we'd covered each core conceptual piece - built gates using wires, adders from transistor ICs, ALUs in circuit maker, pipelines etc.

    Its really nice to have a good conceptual model of the main parts in an electronic computer, when it comes to programming an electronic computer. More importantly, while I am not familiar with what exactly is happening in a modern chip, I have the confidence that I could learn it, if I need to; and I have some sort of an informed intuition to guide me, whenever I have to work at a low level.


    But at the same time, I feel we did too much hardware in our course. I stopped paying detailed attention to it around 3rd year, as I felt it got needlessly detailed.
    I thought spending time reading about things like software engineering and architecture, which I felt were neglected in our course, made more sense. In retrospect, I think that outlook was correct.



    Recently, I've been thinking if students should be thought even less hardware than we were.
    (As an aside - I absolutely don't mean dumbing down. On the contrary, the standard must rise here. It really pisses me off in the 'dumbing down' debates that people don't see this. The standard in technical disciplines is rising globally - if the goal is to maintain standards, then we've already failed.)



    A digital electronic computer is only one physical manifestation of the abstract idea of a computer. Why do we put so much focus on it?

    I mean, in these days, when a dev is writing Java, to be executed, massively in parallel, on Google's App Engine, what's really going on?

    They are writing code for a virtual machine, that has little relation to the underlying hardware. This code is then massively distributed across a host of machines, on each of which the JVM executes. These machines, may, in turn, possibly be virtual, running on geographically distributed physical server farms.
    What the underlying physical architecture is, at that point, is really starting to become irrelevant.
    A good understanding of idiosyncrasies of the JVM is probably more useful.


    So, that's one thing that makes me think.


    We've also an increasing use of (inherently quite abstract) functional languages. Languages like Clojure and Scala are gaining traction. Haskell, even, is growing.
    The intersection between computer programming, and mathematics, seems to be increasing, as we use functional languages, and execute more in virtual environments.


    A lot of the cool kids these days are writing code, using very abstract functional paradigms, executing on heterogeneous and physically distributed platforms.


    I wonder if perhaps the way to approach modern computer science education should involve much less of the electronic engineer, and hardware; and instead come from the direction of the mathematician, or statistician - from formal logic, algebra; and mathematical tools such as the lambda calculus etc.

    Also, there's an ever increasing role played by the tools of statistics; fundamentally, computers deal with information and data, and statistics must play a role, especially as developers want to achieve goals (be they business, or scientific) that deal with the more fuzzy, more noisy real-world data.


    I dunno - there's a lot of stuff to learn, to be good at CS these days.

    The world is changing - we need to solve fuzzier problems, and acomplish more, using higher level tools. We need to solve harder problems, and need more powerful paradigms.

    Is it still possible, in a 4 year course, to equip someone with sufficient theory to use the more powerful tools available to us, and also teach them a thorough understanding of the underlying hardware?

    I wonder if perhaps a much more mathematical and statistical approach is needed.

    The hardware has been becoming less and less important, for a long time.

    All that said, today, when I have to work with a graph thats 10s of GB in size, every byte of representation counts.


  • Registered Users Posts: 586 ✭✭✭Aswerty


    fergalr wrote: »
    Oblig:
    First off, you could make the same argument about microcontrollers in general, and not just arduinos.
    Working with a microcontroller CPU, and programming it, is much more abstract than going and implementing each piece of logic using ICs (or even analog circuits).

    Well a mu is an abstraction from the hardware but then the arduino board is another layer of abstraction. I think the likes of a PIC being programmed in c is a very good balance of abstraction with keeping the lower level design pertinent. I'd definitely rather to develop in c than assembly though.

    You have a very good point about arduino's allowing for an easier introduction to mu development which in turn brings about a broader community and increased information availability.


  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    fergalr wrote: »
    We've also an increasing use of (inherently quite abstract) functional languages. Languages like Clojure and Scala are gaining traction. Haskell, even, is growing.
    The intersection between computer programming, and mathematics, seems to be increasing, as we use functional languages, and execute more in virtual environments.
    A lot of the cool kids these days are writing code, using very abstract functional paradigms, executing on heterogeneous and physically distributed platforms.

    And meanwhile, all the code that actually runs our society (banks, hospitals, public and emergency services, city management software, embedded software, just-in-time delivery systems for food and goods, etc, etc) is all in COBOL, C, C++ and FORTRAN. Maybe with a little Java in the newer bits.

    I'm all for new languages - I'm particularly fond of Python personally, but I can grok the value in LispScala and those with more unusual conceptual models - but we're not turning out enough people today that can fix the bits our society requires to keep functioning. And the people who do fix those bits today are dying out and their skillset is being lost. And the depth of those skillsets are quite dependant on knowing the hardware.

    And that's only looking at the "computer" stuff and not the "appliance" stuff. Embedded controllers are the lion's share of all deployed computer hardware and computer code in the world today, and that's not going to change anytime soon. It's almost all exclusively written in assembly and C, it's only just recently started to happen in bus widths above 16 bits, it's all seriously hard-limited in cpu horsepower, memory, and every other resource you can think of, and a lot of the time, someone dies if a bug isn't caught before production. And none of the graduates I've seen in the last few years from our undergrad courses know enough to work in the area at all, and apparently, that's endemic.

    We're going to see a serious manpower crisis in our industry in the next decade, one that will make the current crisis look blissful by comparison. Haskell's fun, but it won't fix that problem.


  • Closed Accounts Posts: 1,864 ✭✭✭Daegerty


    Sparks wrote: »
    Yeah, but that's sortof like buying a Mini to pull a plough.
    The whole point of the arduino is to not do assembly or even C.
    (Which, granted, is one reason why I never bothered with them)
    .

    If you want to get into AVR assembly why would the arduino not be a good place to start? they are cheap and cheerful. The arduino IDE is a handy yoke to wire something up and get it working fast but there is no reason it should exclude you from the more complicated stuff


  • Advertisement
  • Registered Users Posts: 40,038 ✭✭✭✭Sparks


    Didn't say a mini couldn't pull a plough Daegerty, just that there are better things for the job out there...


Advertisement