Go Down

Topic: Please can you help me? Freetronics leostick vs the Arduino Pro mini (Read 1 time) previous topic - next topic

topa

Hello all, I have a sketch that was written by someone else, it was intended to be used on the Pro mini.
I could only get my hands on the leostick today (I have a Pro mini on order).
My question is can the leostick run the pro mini sketch?

I have the leostick installed and running fine, I've tested the blink sketch and all is good.

I did try to upload the skecth but i get a message say wrong board found use -f

Sorry I am new to this and just starting. :smiley-roll:
Neil

CrossRoads

Got a link to the leostick?
Isn't that based on the processor the Leonardo uses, Atmega32U4?
While the promini uses Atmega328.

So  you'd need the source sketch, recompile it in the IDE for the different uC (Tools:Board), fix any things that are hardware specific, and reload.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

topa

Hello CrossRoads,

Thank you for your reply.
I believe the leostick is based on the Leonardo and you have confirmed my thoughts regarding having to recompile the sketch for this particular board and fix any coding issues that come up, this is my first encounter with Arduino and coding in general, I think I have a bit of learning to do.

I'm going to try and understand the source sketch and use it to hopefully get a quicker understanding f the coding side of things,

It's amazing the more I look into things the more ignorant I feel.
Thank you so much for your reply, it's good to know there are others prepared to help the newbies.
Thanks again.

Neil

topa

Here is the link for the leostick

http://www.freetronics.com/products/leostick#.UEqkMmthiK0

Thanks
Neil

Jonathan Oxer

It'd help a lot of you provided a link to the sketch you're wanting to run, or paste it into a post. If there's nothing unusual in it, it may be as simple as selecting the correct board type before clicking "upload" and it'll all just work. Without knowing what you're trying to run, though, it's hard to provide specific assistance. It sounds like you already have the board profile working OK if you've uploaded Blink to the LeoStick, so the rest should be pretty easy.
--
Jon

topa

Hello Jon,

Thank you for the reply. (Please know I am new to this cool stuff).

I didn't include the code because its not mine and I didnt want to upset the aurthor, its actually in the public domain so I guess on reflection its ok.
The Arduino Pro Mini is used to mod the AR Drone, it enables a standard RC transmitter/reciever to control the drone rather than the onboard wifi network and iphone/ipod.

http://www.rcgroups.com/forums/showpost.php?p=18311773&postcount=260

I do have the leostick configured correctly but this code wasn't written for the leostick, I figured I'd give it a go anyway.
When I tried to complie the code I get the following
rx2atp.c.c: In function 'uart_setup':
rx2atp.c.c:61: error: 'UBRR0' undeclared (first use in this function)
rx2atp.c.c:61: error: (Each undeclared identifier is reported only once
rx2atp.c.c:61: error: for each function it appears in.)
rx2atp.c.c:62: error: 'UCSR0A' undeclared (first use in this function)
rx2atp.c.c:67: error: 'UCSR0B' undeclared (first use in this function)
rx2atp.c.c:68: error: 'UCSR0C' undeclared (first use in this function)
rx2atp.c.c: In function 'USART_RX_vect':
rx2atp.c.c:558: error: 'UDR0' undeclared (first use in this function)
rx2atp.c.c: In function 'USART_UDRE_vect':
rx2atp.c.c:589: error: 'UDR0' undeclared (first use in this function)
rx2atp.c.c:593: error: 'UCSR0B' undeclared (first use in this function)
rx2atp.c.c:593: error: 'UDRIE0' undeclared (first use in this function)
rx2atp.c.c: In function 'sio_sc':
rx2atp.c.c:604: error: 'UCSR0B' undeclared (first use in this function)
rx2atp.c.c:604: error: 'UDRIE0' undeclared (first use in this function)
rx2atp.c.c: In function 'main':
rx2atp.c.c:1103: error: 'UCSR0B' undeclared (first use in this function)
rx2atp.c.c:1103: error: 'RXCIE0' undeclared (first use in this function)
rx2atp.c.c:1103: error: 'RXEN0' undeclared (first use in this function)
rx2atp.c.c:1103: error: 'TXEN0' undeclared (first use in this function)
rx2atp.c.c:1105: error: 'PCIE2' undeclared (first use in this function)
rx2atp.c.c:1108: error: 'PCIE1' undeclared (first use in this function)
Neil

dxw00d

You'd need to get the datasheet for the Leo's processor, and see if you can match up the registers and ports used in the code with those on the processor.

topa

Thanks dxwOOd,

I just dowloaded the datasheets for both the leostick and the pro Mini, I take a good look and see if i can learn anything from them.
Thanks for the suggestion.
Neil

Jonathan Oxer

Ah, I see, thanks for the link to the code. That's a pretty neat project!

@dxw00d is right, you'll need to reconcile the I/O ports and registers on the ATmega168 (used on the Pro Mini) with those on the ATmega32u4 (used on the LeoStick) which may be tricky.

For example, on line 558 of rx2atp.c there's a reference to UDR0, data register for the serial port on the ATmega168. The 32u4 uses UDR1 instead because of the built-in USB support, so you'll need to replace references in the source to "UDR0" with "UDR1".

That's just one of the changes you'll need to make, but if you can match up the 168 and 32u4 ports you should be able to work through the errors and fix them up.

You've selected quite a complex project to get started with if you're just beginning with Arduino!
--
Jon

topa

Hi Jon,

Thanks for taking a look and your direction.
Its is a complex project and one I'm sure I'll learn alot from.

I have a pro Mini on order to complete the actual drone conversion (just have to wait for Australian post).
I'm gonna carry on and do the mapping to see what I can learn from it.
Should be a pretty cool thing to do.
I also hope to be able to learn a bit more about the sketch/C/C++ language.

Thanks again
Neil

Jonathan Oxer

Hi @topa, I see you're in Melbourne (I am too) so perhaps a good step would be to hook up with the Connected Community Hackerspace. There are a bunch of Arduino enthusiasts there and there have also been some interesting AR Drone projects, like this one I did with CCHS president Andy Gelme in January 2010:

http://www.youtube.com/watch?v=mREorv0hbY8
http://www.youtube.com/watch?v=yyYu4h7ZXF8

As part of that project Andy wrote Cockatoo, which is a software layer to interface with the Parrot and allow it to be controlled via external sources (such as the gesture recognition code I was using with the Kinect).

Check out www.hackmelbourne.org
--
Jon

Go Up