Introduction to lower level programming

I recently found this: http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,403&Cat=11 and found that it might be a nice way to introduce me to MPlab and programming at a lower level. Since MPide is pretty much like writing Arduino sketches, I thought that I could easily get used to the microcontroller and later learn how to use Mplab with the same microcontroller. However, I’m clueless when it comes to register stuff and lower level programming and the support that the microcontroller has to learn MpLab programming doesn’t look very good.

Any recommendations? All I want is a microcontroller that would enable me to go more in-depth in MCU programming, to the point where I could maybe get to learn assembler code (maybe that’s asking for too much). I’d then use this to implement it with the Vex Robotics kits that I have.

and found that it might be a nice way to introduce me to MPlab and programming at a lower level. Since MPide is pretty much like writing Arduino sketches, I thought that I could easily get used to the microcontroller and later learn how to use Mplab with the same microcontroller. However, I’m clueless when it comes to register stuff and lower level programming and the support that the microcontroller has to learn MpLab programming doesn’t look very good.

Any recommendations? All I want is a microcontroller that would enable me to go more in-depth in MCU programming, to the point where I could maybe get to learn assembler code (maybe that’s asking for too much). I’d then use this to implement it with the Vex Robotics kits that I have.

This is a pretty deep/wide question, with lots of room for differing opinions. You should start with a common 8-bit SOC (system-on-a-chip). There are lots to choose from, but PIC (from Microchip) and AVR (from Atmel) are the most popular architectures. The original VEX microcontroller used a PIC part, and Arduino uses an AVR part.

The PIC and AVR product lines are comparable in terms of device capabilities, available tools, pro to boards, and community support. They both offer parts in “DIP” packages that are easier to prototype with, if you decide you want to breadboard some projects.

So, it comes down to personal preference. I prefer AVR because I find the peripheral registers make more sense to me, and the Harvard architecture used on the PICs needlessly complicates the instruction model (which is why you need “rom” storage qualifiers in PIC C code). I’m sure other folks will have solid reasons they prefer PIC.

As for Arduino, don’t write that off as too high-level. Most Arduino boards include a 6-pin ICSP header that lets you directly program the AVR part. That lets you bypass the Arduino IDE and directly control every byte the executes on the chip. Have a look at [this board as an option for a Vex-compatible Arduino board (you just need F-F gender changers for the port pins).

After you’ve mastered 8b, you can move on the 32b processors if you want; most of the 8b lines have “big brother” chips in the 32b range, though it seems that ARM is the only 32b SOC that the industry is using in volume these days. All of these 32b options will build on what you learn from 8b parts, though they will offer much more power and flexibility at the expense of more complicated peripheral/register sets.

If you can talk a bit more about projects you want to accomplish, I can probably give you some more directed advice rather than just running on :wink:

Cheers,

Thanks for the advice! I simply want this to be a learning experience. I’d like to apply what I’ve learned to make a simple robot. As I get used to it I’ll probably start adding more sensors and mechanisms. But I think I’ll definitely start with 8b and since I’ve already used arduino boards I’m probably better off with AVR. Where do you think I should start with this?

Which Arduino board do you have?

Atmel has a reasonable (free) development environment called AVR studio. I’m currently using this on a project with an AVR32 processor, but I believe it also supports some of the 8 bit devices. The same project also has an 8 bit AVR device but, to be honest, I’m using the arduino environment to program this as it’s very simple code and really does not need much more. The arduino environment is really just a simple GUI on top of a conventional compiler and you can program at the register level if you want to. I have not found the Atmel documentation to be that good and the programming style of their examples can be inconsistent, however, any so called “professional” dev environment has a learning curve so be prepared to struggle, we all do.

Don’t forget to check out www.sparkfun.com, they have lots of lower cost boards.

Atmel has just released AVR Studio v6 which supports all their 8b micros (tinyAVR, megaAVR, XMEGA), their 32b micros (AVR UC3), as well as their ARM products.

If you’ve already got an Arduino board, then you can already use it with pretty much all the Vex electronic components. You just need to interface the pins on the Arduino to the 3-pin ports that Vex devices use. You can do that easily enough with some jumpers like these.

However, this is why I recommended the Roboduino, since they’ve already done that for you by making each Arduinio I/O pin into 3-wire Vex-like port (wrong gender, though).

The only thing you have to watch out for is that the motor ports are intermixed with the sensor ports - if you plug a sensor into a motor port you may damage it. Have a look at this page - you plug motors/servos into the red+pink ports - you plug sensors into the blue+yellow ports. Roboduinio seems to be out of stock most places, but this vendor seems to have it in stock.

Cheers,

  • Dean

That’s a pretty nice board at a good price. Another “robot” friendly, arduino compatible board is this one Wild Thumper Controller Board, more expensive but also has the capability to drive some large motors if needed.

Also be aware that Atmel is entering the robotics competition arena this year with the Atmel robotics competition (university students only). The original deadline for entries was May 18 but it looks like it was extended to June 11. They are selling discounted kits and eval boards as part of this promotion.

I have the arduino mega and I’ve already used it with Vex Robotics sensors and motors, but I really doubt that jumping from an 8 bit device to the mega will be a good idea, so I’ll probably end up buying one of your recommended boards. This will also save me a lot of bothersome time using breadboads.

However, since I’m not starting off with any of those yet, I recently found this and this. I also found tutorials on arduino with AVR Studio but they’re all very shallow. What do you guys think?