Arduino IDE is so much hated editor by many programmers. When it comes to bigger source code, complex algorithms – managing it becomes pain. People usually go with it and waste time or move to different IDE. There are many attempts to replace Arduino IDE with another including Eclipse or even Visual Studio. Kathy Yang found that Sublime Text editor is lightweight and feature rich editor that might work as better Arduino IDE. Among features there is better navigation between files, it shows line numbers, it is easier to jump to line where error was found and code text seems to be better visible.
To set up the environment all you need is to download Sublime Text and ST2-Arduino package from git source. Then copy its contents to installation directory. Additionally you will need to run script that imports necessary packages to work with Arduino tools. After this you will have Arduino menu item where you can select your board and do other usual tasks as in Arduino IDE. Hopefully this editor will give better project management and better focus on coding.
When going down into Ethernet or any other signal, you find that there is nothing more than ones and zeros. So practically any programmable device theoretically can send any information in any format. The only limit is RAM space, speed and signal conditioning. Cnlohr was able to squeeze Ethernet functionality in to small Attiny85 microcontroller. He was able to do so without external circuits – twisted pair was directly attached to microcontroller pins. This is really dangerous way to do, because Ethernet signal this way is forced to be tied to mcu ground. Ifthere is a DC offset in the line, it can cause damage. Normally there is a magnetics involved in signal line.
Anyway this is great hack showing that anything is possible with minimal component count and small processing power. Attiny is clocked at 20Mhz and uses one twisted pair for network connection. IT is recognized as 10MBit Ethernet switch that can send hard-coded packets once one of couple buttons is pressed. To get 10MBit from 20MHz micro thee is an assembly language involved. As it is said, this project is more for playing but strictly not for production as it is dangerous and not reliable.
Not long time ago we featured simple Arduino wav player that played music stored in internal microcontroller RAM. Due to memory limitation, you can play only couple of seconds of sound on Arduino UNO. To remove this limitation Kathy Yang extended player by adding SD card, where any size and length music files can be loaded.
Before you can listen for music, wav files need to be converted in to appropriate format so Ardiuno could play them correctly. This is done by special software provided by author. In order to select file and play it, you need to connect to Arduino via serial port debugger, where list of files are visible and with several control commands you can play file, stop, pause or switch to next file. Having this you shouldn’t have problem implementing you own user interface to control player. But more practical way of using it would be embedding sound effects in to project – think of educational child toy or other.
Today all C compilers generate very optimal code for microcontrollers. In most cases is not worth trying to optimizing it by writing assembly lines. But there are one factor left that lead to less efficient code – the guy who writes code. If you have programmed for PC writing code same way not always is the best way to do. Microcontroller oriented compilers like AVR GCC is adapted to generate optimal code for AVR devices. If you will go to other micros, then you will see that programming ARM microcontrollers with C in some cases require special code structure to get most of hardware. To be a pro on those things you actually need to know how hardware works in one or in other situation, but simple general tricks may save a day by reducing code size ans so speeding up the execution. Improper coding may generate excess code. So Atmel has prepared an application note where they take through several key coding tips.
One part is more dedicated to reducing code size by doing simple decisions on selecting variable types, making them global or local. Then move towards loops, where counter increment and decrement generate different code size. Storing constants in program memory instead of loading to RAM helps saving RAM space. Other part goes to improving execution speed. Simple tricks like loop enrolling, control flow, can significantly speed up your program. Sometimes code space can be sacrificed to gain speed. So it is up to you what you are looking.