Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Implementing rock-paper-scissors-spock-lizard game with gesture recognition

Rock-paper-scissors-spock-lizard game is quite popular game which is more complex than rock-paper-scissors. There are five gestures used instead of two. Each gesture can beat two other and two remaining gesture can bet the particular one. Students from Cornel ECE 4760 class decided to push this game to new limits – make computer to recognize gestures and play along. They used OV7670 digital camera with Atmega1284 microcontroller which captures images and sends them to Matlab for faster processing. Feedback is displayed on VGA screen. So the hardware mainly deals with getting images, sending them to PS via USART and displaying results on screen. It takes two AVR microcontrollers to do that. The limitation here is sending images to Matlab for processing, because of serial port limitations. They used run-length coding to improve transmission. Matlab does the heavy load on recognizing gestures by scanning pixel changes. Algorithm isn’t very efficient and not immune to noise, but works. Continue reading

Generating VGA with AVR without overclocking it

There are plenty VGA generating projects on AVR micros. But almost everyone uses overclocked chips to generate required signals. To be more specific- in order to generate 640×468 pixels at 60 fps you need to clock pixels at 25.175MHz. AVR microcontroller’s safe margin is 20MHz. So how to do this without overclocking AVR and still get proper VGA. PK has shared his project skeleton, where he was able to achieve this with AVR microcontroller clocked at 16Mhz. The trick he used was to double clock frequency with digital logic circuit. So he got 32MHz instead of 25.175MHz which lead to rough 27% error, but still VGA picture is quite clean and useable. Each pixel is encoded with 3 bits which yields to total 8 colors. Continue reading

DIY VGA generator

The guys at the resistor network has developed an AVR based VGA generator, and the good thing about it is that its open source. The entire source code is available to download. VGA stands for Video Graphics Array and was first developed by IBM around 1987. The generator uses an ATMEGA1284p which has 16KB of ram and 128Kb of program memory. The hardware will be running at overclocked frequency of 25MHz to get 640 clock cycles per line. This allowed a higher resolution time buffer. The entire VGA generation and buffer is implemented in assembly under the GNU tool chain. The only problem with this version of VGA generator it has no scope for dynamic graphics and that is what has to be developed in the upcoming version. For generating dynamic graphics, there will be a need of another microcontroller that will send commands to the VGA controller. The project has a RGB222 colour gamut which has a space for 64 colour each of the colour occupying two bits with 6 and 7 bit as unused. One could even use… Continue reading

Windows manager for AVR

Generating VGA signals on AVR microcontrollers is possible, but it takes heavy load and there is not much resources left to do other intensive tasks. And there is no talk about higher resolution images. If you want to do something amazing with VGA and stick with AVR then it is better to use a dedicated hardware for generating video signals. uVGA is a great choice for this. Andrew has been playing with uVGA II which takes all graphics drawing load. Leaving controller free to do what ever you want. These include an Audio Player, Theme Manager and Window Factory which is used to create new windows. He caught an idea to make a windows manager similar to PC. For user input he used mouse. He collected several applications to play with. The code still needs polishing in order to get rid of some blurring during windows transition, but over all program model looks really promising and fun to try. Continue reading

Avr VGA implementation

Driving VGA signals with small micros like AVR is quite a challenge. First thing is that VGA standard is strict to timings and they are beyond the AVR speed limits. Andrew who decided to build a generic VGA interface on AVR, faced the speed problem. The thing is that AVR’s can run at maximum 20MHz, but for proper VGA clock needs to be a bit higher. So he’ve chosen overclocking instead of grabbing faster chip. The microcontroller of choice was Atmega1284p, because it has 16MHz of RAM and plenty of program memory. He wanted to build a generic buffered VGA implementation instead of application specific output. Since RAM still was a limiting factor, instead of 640×480 display size he had to go with 128×96 which would fit in to internal buffer memory. In order to make it fast and efficient Andrew built a simple color system where each color of RGB was coded using two bits. So all color information easily fits in to single byte and can be sent using single instruction during single clock cycle. The program is… Continue reading

Atmega644p VGA generator

VGA signals are still common among computers and seems that they are gonna stay for a while. Hook up your microcontroller project to VGA monitor and you’ll have a plenty area for displaying multiple characters and graphics. LucidScience takes us through process of building an Atmega324P based VGA signal generator which can be used for many purposes including games. End result of this is a flicker free 256×240 256 color image on screen. By following tutorial you will get a better understanding of how VGA signal works and how to get correct signal timings with AVR microcontroller. In order to generate 256×240 256 color images there is a 128K SRAM used where image data is loaded. Microcontroller reads each pixel value and then draws it on screen. If you are ready for this – prepare for quite long reading and experimenting that leads to AVR based computer system not worse than any retro PC. Continue reading