by StuartL » Tue Apr 01, 2008 9:36 pm
by StuartL
Tue Apr 01, 2008 9:36 pm
Siempre is right, libc isn't what you want. libc is the library that C uses to access all of the standard library functions (e.g. printf, getc, etc). These won't be available for the AVR and in fact will be largely useless as they're compiled and optimised for modern processors, not 16MHz 8 bit microcontrollers. Even if you could compile it (because you wanted to use sprintf, for example) it'll be incredibly bloated and would seriously threaten the performance of your application.
Stick with WinAVR. It's well known, the constants provided with WinAVR map perfectly to the Atmel documentation so you can literally take the microcontroller PDF file (let me know if you need it) and write code from it.
I suggest that for your first application (assuming you haven't done microcontroller programming before) you stick with something straightforward like flashing an LED.
Things you'll need to look up in the ATMega128 documentation are:
- Timers (TCCR, TCNT).
- GPIO (general purpose input output) ports and their data direction registers (DDRA, DDRB etc).
You'll also need to dig around here and the rather superb bioloid.info site that Jon is putting together to find the circuit diagrams for the CM-5 so you can figure out which LED is connected to which port on the microcontroller.
There are a few of us who have scratch written libraries for you to use, mine is largely complete but is not yet released due to a bug I haven't had the time to investigate (interrupt driven serial IO for PC comms causes dynamixel serial comms to crash when interrupts are triggered simultaneously).
If you're new to microcontroller programming I do recommend you familiarise yourself with how to do some of the basic stuff before using someone elses library. Otherwise when their (my?!) library goes horribly wrong you won't know how to investigate, fix or report the bug...
Siempre is right, libc isn't what you want. libc is the library that C uses to access all of the standard library functions (e.g. printf, getc, etc). These won't be available for the AVR and in fact will be largely useless as they're compiled and optimised for modern processors, not 16MHz 8 bit microcontrollers. Even if you could compile it (because you wanted to use sprintf, for example) it'll be incredibly bloated and would seriously threaten the performance of your application.
Stick with WinAVR. It's well known, the constants provided with WinAVR map perfectly to the Atmel documentation so you can literally take the microcontroller PDF file (let me know if you need it) and write code from it.
I suggest that for your first application (assuming you haven't done microcontroller programming before) you stick with something straightforward like flashing an LED.
Things you'll need to look up in the ATMega128 documentation are:
- Timers (TCCR, TCNT).
- GPIO (general purpose input output) ports and their data direction registers (DDRA, DDRB etc).
You'll also need to dig around here and the rather superb bioloid.info site that Jon is putting together to find the circuit diagrams for the CM-5 so you can figure out which LED is connected to which port on the microcontroller.
There are a few of us who have scratch written libraries for you to use, mine is largely complete but is not yet released due to a bug I haven't had the time to investigate (interrupt driven serial IO for PC comms causes dynamixel serial comms to crash when interrupts are triggered simultaneously).
If you're new to microcontroller programming I do recommend you familiarise yourself with how to do some of the basic stuff before using someone elses library. Otherwise when their (my?!) library goes horribly wrong you won't know how to investigate, fix or report the bug...