BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Oct 23, 2018 3:07 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Arduino
PostPosted: Wed Jul 28, 2010 11:29 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
I looked at it long enough to know I didn't want to do anything with it.

But if you can make a LIB to work with their boards, so much the better! And C can also gain from a new LIB or two.

the C shouldn't change, just refining of the LIB files.

Good H files with comments can go a long way to setting up a project with new hardware. I don't know why that's such a difficult task/concept for new (casual) programmers to grasp. But then BASIC was originally written so that one wouldn't have to think about what type of variables he/she wanted...

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Thu Jul 29, 2010 12:21 am 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
I don't want to get into a set of religious wars, but I am a C kind of guy... Before you shoot me, I like your products too, or I would not have stuck with them this long... :)

Some reasons why I think Arduino have been successful.
1) It is pretty simple to start out to use. Here is a complete simple hello world sketch
Code:
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("Hello World!");
}

2) Performance and capability wise they probably blow the socks off of a Basic stamp. I think the low end Arduino probably have 32K or program space and 1 or 2 K of memory run at 16 or 20mhz. The Arduino Megas have 128K or program space, 4 usarts, 12 PWM channels, 16 Analog inputs. 50+ digital inputs ...

3) Cost: You can get a simple Arduino for $20, one with USB $30, a Mega which also has USB for $65 (these are all sparkfun). You can get other versions of a Mega for under $50 from other vender's.

4) Ease to expand the environment. For example in another thread you ask for ideas on what commands to add to Basic. Up in the Arduino world, if there is a need for some new commands, it can be done by anyone. (Yes I know this can be a double edged sword), But for example recently someone saw that there was no standardized easy to use PS2 code on the Arduino. So he created it and posted it. Now all you have to do is to copy the .c++ and .h files for the new library into the appropriate Arduino directory and then in any sketch you wish to use it, you simply tell the system that you wish to use it and you are free to use its methods. He created a really nice version that takes care of remembering the previous states of the buttons and the like, so you can write code and simply ask if a button has just been pressed...

Also since you have the source file available for the new objects, you are fee to customize it to make it work in your environment, fix bugs and learn how to do things...

5) Also if you wish to return to be strictly a C/C++ kind of guy you still have all of the GNU GCC stuff available to you (again free). You can simply use AVRDUDE to program the boards outside of the Arduino environment. You can easily port your sketches back to C with the main line looking something like:
Code:
int main(void)
{
   init();

   setup();
   
   for (;;)
      loop();
       
   return 0;
}


Yes, I know there are downsides as well, like there is no debug mode to make it easy to debug your programs... I hate that the normal boards do not have servo connectors, but it is a different mindset. Their idea is it is great for prototyping things. One of these boards, a wireless breadboard and some wire is all you need...

My main point is to say that they do have a lot of interesting stuff going for them, so I can understand their popularity.

Kurt

P.S. - Again I am not wanting to get into religious war, like C versus basic!!!


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Thu Jul 29, 2010 6:48 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Good points Kurt!

I totally agree, and am similarly interested primarily in C.

But the convenience of the Atom Pro for R/C servo motor control, and PS/2 support is hard to beat! Besides, a little BASIC won't hurt, and it's easier to share projects if they are based on BASIC.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Fri Jul 30, 2010 4:08 am 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
There is a C interpreter, PicoC, that runs on my BlackFin Camera. It runs in either an interpreter or loaded (EEPROM) mode. It doesn't use includes or a main() either.

The source is available, maybe it would be a good candidate for an AtomPro.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Tue Aug 10, 2010 8:50 am 
Offline
Master

Joined: Mon Jul 17, 2000 6:00 pm
Posts: 155
Yes all that hardware sure is pretty, but with out the math hardware and 32bit registers I'll pass. As a user I would want an upgrade not a down grade ;-)

If C is your thing GNU has been around allot longer and for better processors.

_________________
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Tue Aug 10, 2010 3:14 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Basic Micro wrote:
Yes all that hardware sure is pretty, but with out the math hardware and 32bit registers I'll pass. As a user I would want an upgrade not a down grade ;-)
Hi Dale, I totally understand your position here! :D I hope I made this clear earlier. I really like the H8 architecture! I enjoy having 32 bit registers and the math that goes with it. I find it far easier to program it in assembly language. I can totally understand your decision to stick with H8 based systems.

As for upgrade versus downgrade, good question, everything is a trade off... :lol:

Basic Micro wrote:
If C is your thing GNU has been around allot longer...

I totally agree here. There are far better free IDEs than what comes with the Arduino, but I suppose, many may decide when in Rome do...

Kurt


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Tue Aug 10, 2010 9:56 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Dale,

Not suggesting another processor is better, just noting that there is a C interpreter (PICOC) with source available, that might make an interesting port to the Renisys parts.

I know, how about a Renisys camera!

Actually, I'm not to keen on GNU. I prefer good "canned" commercial products ($$).

Alan KM6VV

Basic Micro wrote:
Yes all that hardware sure is pretty, but with out the math hardware and 32bit registers I'll pass. As a user I would want an upgrade not a down grade ;-)

If C is your thing GNU has been around allot longer and for better processors.

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Tue Mar 22, 2011 10:51 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Wow! Last post on this thread is about 6 mo. old!

Since then, I've been absorbed up into the HBRobotics club 'bot project. We intend to teach an introductory class in robotics. While I tried my best to steer them towards a BM processor/board, the committee went with the Arduino UNO (I even made up a 'bot for them using a BM board).

The UNO is not all that bad. And my fears (?) about the "corruption" (bent) of C? Turns out, you can write all the C/C++ you want, it's just that you're given the setup() and loop() functions instead of a good'ol main() to start with.

You CAN do all the prototyping you want.
you CAN use #includes for REAL header files.
you CAN have other source files linked in for you (just no MAKE, they do that by grabbing all of the files in the directory...)
The preprocessor and all the stuff of 'REAL' C is there!

I do miss a full printf(), but that's not uncommon for a "tiny" C.

So no worries. And the install of the GNU stuff amounts to unpacking a ZIP file. Big, 'tho.

So I've got C code running on the Arduino UNO, and I'm happy.

Now to figure out pin assignments a little better.

What should S_OUT be for the 3687? I seem to remember having to assign S_OUT for one of the compilers to 0x2F. I've seen 0x21, that must be for the Basic Atom. I looked at the h8367 hardware manual, it's different! TDR seems to be at H'FFAB, memory mapped I guess. Can't correlate to 0x2F yet.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Wed Mar 23, 2011 4:50 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The pin numbers of pins doen't correlate to the port register addresses for those pin. s_in and s_out are always pin numbers 32 and 33 on all current AtomPro processors.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Wed Mar 23, 2011 5:39 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
If you are interested in some of the different mappings, I have them in my C Libraries, which are now part of the thread: http://www.lynxmotion.net/viewtopic.php ... 050#p70050

It is in the baplib in the file iopins.c

Kurt


Top
 Profile  
 
 Post subject: Re: Arduino
PostPosted: Wed Mar 23, 2011 9:04 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Thanks, I'll check it out.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO