Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Use of Visual C++ in Expert kit

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
5 postsPage 1 of 1
5 postsPage 1 of 1

Use of Visual C++ in Expert kit

Post by radiocar » Tue Apr 01, 2008 11:12 am

Post by radiocar
Tue Apr 01, 2008 11:12 am

Hi all,

I noticed that CM-5 can run .hex files which is composed by the use of C++, does anyone know that how the .hex file can be generated?

I am currently amending the "PC controller" example, by adding more buttons on the .exe window. How can I generate .exe file in C++?

I tried to debug it, and a warning description appear. (Original example)
fatal error LNK1104: cannot open file 'LIBC.lib'

I can't find LIBC.lib inside the example, what is the problem?


Please Help, Thx a lot!
Hi all,

I noticed that CM-5 can run .hex files which is composed by the use of C++, does anyone know that how the .hex file can be generated?

I am currently amending the "PC controller" example, by adding more buttons on the .exe window. How can I generate .exe file in C++?

I tried to debug it, and a warning description appear. (Original example)
fatal error LNK1104: cannot open file 'LIBC.lib'

I can't find LIBC.lib inside the example, what is the problem?


Please Help, Thx a lot!
radiocar
Robot Builder
Robot Builder
Posts: 9
Joined: Sat Nov 17, 2007 8:44 am
Location: Hong Kong, China

Re: Use of Visual C++ in Expert kit

Post by siempre.aprendiendo » Tue Apr 01, 2008 1:30 pm

Post by siempre.aprendiendo
Tue Apr 01, 2008 1:30 pm

radiocar wrote:Hi all,

I noticed that CM-5 can run .hex files which is composed by the use of C++, does anyone know that how the .hex file can be generated?


You can use WinAVR. I think it's included in the Expansion CD of the expert version. But it is mainly c, WinAVR is very limited for c++.

In the expert manual you have "2-1. CM-5 BASED ROBOT PROGRAMMING" (page 17), where you can find a lot of help to install and create your first CM-5 program :)

radiocar wrote:I am currently amending the "PC controller" example, by adding more buttons on the .exe window. How can I generate .exe file in C++?

I tried to debug it, and a warning description appear. (Original example)
fatal error LNK1104: cannot open file 'LIBC.lib'

I can't find LIBC.lib inside the example, what is the problem?


Please Help, Thx a lot!


I'm not sure, but I think that you have not created a correct visual c/c++ project... 'LIBC.lib' is the visual c/c++ library.

Hope it helps :)
radiocar wrote:Hi all,

I noticed that CM-5 can run .hex files which is composed by the use of C++, does anyone know that how the .hex file can be generated?


You can use WinAVR. I think it's included in the Expansion CD of the expert version. But it is mainly c, WinAVR is very limited for c++.

In the expert manual you have "2-1. CM-5 BASED ROBOT PROGRAMMING" (page 17), where you can find a lot of help to install and create your first CM-5 program :)

radiocar wrote:I am currently amending the "PC controller" example, by adding more buttons on the .exe window. How can I generate .exe file in C++?

I tried to debug it, and a warning description appear. (Original example)
fatal error LNK1104: cannot open file 'LIBC.lib'

I can't find LIBC.lib inside the example, what is the problem?


Please Help, Thx a lot!


I'm not sure, but I think that you have not created a correct visual c/c++ project... 'LIBC.lib' is the visual c/c++ library.

Hope it helps :)
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona

Post by StuartL » Tue Apr 01, 2008 9:36 pm

Post 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...
StuartL
Savvy Roboteer
Savvy Roboteer
Posts: 350
Joined: Mon Jun 04, 2007 3:46 pm
Location: Thatcham, Berkshire, UK

Post by limor » Wed Apr 02, 2008 1:33 am

Post by limor
Wed Apr 02, 2008 1:33 am

you can find several C libraries for interfacing with the Bioloid bus.
for a couple of example links, see the Bioloid wikipage.
you can find several C libraries for interfacing with the Bioloid bus.
for a couple of example links, see the Bioloid wikipage.
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by radiocar » Wed Apr 02, 2008 7:43 am

Post by radiocar
Wed Apr 02, 2008 7:43 am

Ah...I got some clue, thx a lot.

WinAVR should be used to run files for CM-5 to run

However, I am currently doing PC Based Robot Programming and the manual said Visual C++6.0 or above compiler should be used.

I use MS Visual Studio to run the example program and that error message appear. I simply use the default debugger Win32 to run, but it's not successful.

Sorry for explaining not good enough.

Thx
Ah...I got some clue, thx a lot.

WinAVR should be used to run files for CM-5 to run

However, I am currently doing PC Based Robot Programming and the manual said Visual C++6.0 or above compiler should be used.

I use MS Visual Studio to run the example program and that error message appear. I simply use the default debugger Win32 to run, but it's not successful.

Sorry for explaining not good enough.

Thx
radiocar
Robot Builder
Robot Builder
Posts: 9
Joined: Sat Nov 17, 2007 8:44 am
Location: Hong Kong, China


5 postsPage 1 of 1
5 postsPage 1 of 1