AirsoftMechanics.com
July 30, 2010, 02:14:05 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the NEW AirsoftMechanics.com Discussion Forums!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: How to program the SW-COMPUTER platforms. (Read 4403 times)
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1579



WWW
« on: September 20, 2008, 08:36:06 PM »

Hi,

Forgive but this is just a "note" so far to put on my todo list to clean up...

----


I have enclosed a list of the parts.  The bottom one is the one you want.

The ARV DRAGON is this:

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=ATAVRDRAGON-ND

You need to wire it up for the specific IC being programmed:

http://www.instructables.com/id/Help%3a-An-Absolute-Beginner_s-Guide-to-8-Bit-AVR-Pr/

But just get these two extra parts:

   * (1) AMP 40-Position, 2-Row, .100 Straight Breakaway Header
     Connector (Digi-Key; A26525-20-ND $1.61)

   * (1) ARES 40-Pin ZIF Socket (Digi-Key; A306-ND $12.02)

The others are a waste of money.  The WM2512-ND with heat shrink does perfectly fine.

You also need an AE1493-ND USB cable.

There is a tutorial here:

http://unconventional-airsoft.com/2008/04/08/how-to-develop-for-the-trigger-master/

You need two bits of free software:

AVR Studio 4 which is the main program:

http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725

And WINAVR which is the C code interpreter:

http://winavr.sourceforge.net/

It all sounds harder than it really is Smiley

BTW - Here is a note about how to optimize ATMEL C code!

http://extreme-fire.com/SW-COMPUTER/AVR%20Optimization.pdf

Eighteen Hints to Reduce Code Size

                  1. Compile with full size optimization.
                  2. Use local variables whenever possible.
                  3. Use the smallest applicable data type. Use unsigned if applicable.
                  4. If a non-local variable is only referenced within one function, it should be
                      declared static.
                  5. Collect non-local data in structures whenever natural. This increases the possi-
                      bility of indirect addressing without pointer reload.
                  6. Use pointers with offset or declare structures to access memory mapped I/O.
                  7. Use for(;Wink { } for eternal loops.
                  8. Use do { } while(expression) if applicable.
                  9. Use descending loop counters and pre-decrement if applicable.
                  10. Access I/O memory directly (i.e., do not use pointers).
                  11. Declare main as C_task if not called from anywhere in the program.
                  12. Use macros instead of functions for tasks that generates less than 2-3 lines
                      assembly code.
                  13. Reduce the size of the Interrupt Vector segment (INTVEC) to what is actually
                      needed by the application. Alternatively, concatenate all the CODE segments
                      into one declaration and it will be done automatically.
                  14. Code reuse is intra-modular. Collect several functions in one module (i.e., in one
                      file) to increase code reuse factor.
                  15. In some cases, full speed optimization results in lower code size than full size
                      optimization. Compile on a module by module basis to investigate what gives the
                      best result.
                  16. Optimize C_startup to not initialize unused segments (i.e., IDATA0 or IDATA1 if all
                      variables are tiny or small).
                  17. If possible, avoid calling functions from inside the interrupt routine.
                  18. Use the smallest possible memory model.

Gandolf
« Last Edit: February 07, 2009, 05:51:48 AM by Gandolf » Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1579



WWW
« Reply #1 on: February 09, 2009, 06:20:36 PM »

Big note!!

The new version of WINAVR has some kind of problem that makes the HEX code about 30% larger!!

See the thread (and before) here about how to use the old version.

http://forums.airsoftmechanics.com/index.php?topic=1250.msg13392#msg13392

The known good version of WINAVR is here:

http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/w/wi/winavr/WinAVR-20070525-install.exe

Gandolf

UPDATE:  They broke it.  There is a serious bug in the new version with how the ld.exe does "inlining".  The optimization does not work right.  Just use the older version till they get it fixed.

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=73593

 
« Last Edit: February 09, 2009, 08:38:43 PM by Gandolf » Logged
Gandolf
High Voltage Guru
Global Moderator
Colonel
*

Reputation Power: 98
Reputation: Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.Gandolf has an aura about them.
[view reputation]

Offline Offline

Posts: 1579



WWW
« Reply #2 on: February 12, 2009, 12:35:39 AM »

And here is the full buggy list  Shocked

http://www.nongnu.org/avr-libc/bugs.html

We all "owe" this folks our entire 'hearts' even if we don't understand or can't help them at all...

They are truly are our software Gods!!!

Bless them all!!!!!!!!!

Gandolf
Logged
Pages: [1]
  Print  
 
Jump to:

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!