I now want to trial a pre-release of WebbotLib Version 2 - PM/email me if you are interested in being a guinea pig having read the following !What is it?
Well its a new download of WebbotLib (not yet in SourceForge - so if you enroll then I'll send you the link)
Yes - you can install it into another directory. So you can keep the existing WebbotLib version 1 as well as the new Version 2
The edit box in Project Designer (which asks you to locate the WebbotLib directory) decides if its Version 1 or Version 2 and then generates code, AVR Studio file, makefile accordingly. So the same Project Designer can cope with both versions.
Yes its an alpha release so may have some issues - but you can still use your Version 1 download as well.Why would I want it?
In summary - it produces much smaller code.Yep - but I have an ATMega mega with mega amounts of mega program space. So why would I care if the code is smaller when I've got lots to spare?
Well small code normally = more efficient code.
And the main point here is in interrupt handling - ie since the interrupt code is more efficient/quicker then it leaves more time for your application to run or more 'things' that the interrupts can do in the same time - like control more servos via software PWM for example.So what's the catch?
In order to create more efficient code then the library needs to know what devices you've got connected. With Version 1 then it only knew this at runtime and so had to assume that you might
do anything. With version 2 then you must
use Project Designer (from my site http://webbot.org.uk
) so that it knows ahead of time what you actually want to do. This allows WebbotLib to throw away code it knows you will never use - as well as generate some highly optimized code for the devices you ARE using.Ok - but I'm an advanced geek and want to add my own code to tap into timer overflows, compare match, and capture interrupts to handle devices not supported directly in Project Designer! Can I still do that?
Sure. All the old calls are still there - but using these advanced features will bring in extra code and cut down on the memory savings.Do you still support AVRStudio ?
The build process for Version 2 is quite complex to try and squeeze out every bit of non-used code to make the executable as small as possible.
This means setting different compile options for different files. Version 2 even creates a library (.a file) for your project.
Some of these things are achievable in AVRStudio - but not everything. In the meantime, until I find a better solution, then I would suggest that before you regenerate the code form within Project Designer that you close the project in AVRStudio and delete the '.aps' and '.apw' files. Failure to do so may mean that AVRStudio doesn't pick up the latest changes since it doesn't scan these files to see if they have been updated by another thread like Project Designer.
The toolchain in AVRStudio is also rather limited. So to squeeze the last bit of memory in your program then I suggest you use the 'makefile' generated by Project Designer. From a command prompt: move to the project directory and just type in 'make' (without the quotes) and press return.
Alternatively: in AVRStudio go into the project settings and tell it to use an external makefile instead. What boards do you support?
Since the whole 'sys/' folder has disappeared then you can only use Version 2 if there is a board file for Project Designer to work with. If you have a custom, or unlisted, board then I suggest using my Board Designer to create your own board for subsequent use in Project Designer. Since the resultant code is smaller then Project Designer will now support the ATMega8 - and a 'bare bones' project that does almost nothing, but has the whole WebbotLib harness, only needs about 2.5k.Why keep AVRStudio?
Well this is one for the future really. Project Designer generates all your skeleton code and a 'makefile'. So it could also run the 'makefile' - ie build your code. So all that is left is a 'text editor' and executing something like 'avr-dude' or 'fboot' to upload it to the chip. The only missing piece is the AVRStudio simulator/debugger.Summary
The main difference is that you must use Project Designer. If you are using the Axon, Axon II, $50 Robot, or any other board currently supported then this is not an issue.
If you have an unlisted board, or a home made board, then you will need to use Board Designer to make it available to Project Designer. Whilst this may be a hassle - it is a one off process. If you are using Board Designer to describe an unlisted commercial board then let me know - I could add the board design to future releases of Project Designer to allow everyone to benefit.