Tuesday, May 17, 2011

Multipurpose development board with ATxmega64A1 / ATxmega128A1


Features:
  1. Main processing unit ATxmega64A1 or ATxmega128A1.
  2. Audio decoder VS1011,1033,1053 with stereo jack 3.5mm female connector & external speakers 3 pin connector(optional).
  3. DS1307 real time clock with battery pads.
  4. PDI & JTAG connectors.
  5. LB1936 dual driver for asynchronous motors (optional).
  6. AD7414 temperature sensor for motor driver (optional).
  7. External motors driver connector with I2C bus.
  8. Two micro SD connectors ( one is optional ).
  9. Four connectors with 2x3 pin to control eight servo motors, two servomotors for each connector, each connector is power interruption to minimize power consumption.
  10. Two power jack connector 5.5/2.1mm put in series to connect two photovoltaic panels and with static commutator controlled by software to charge main accumulator.
  11. High power step down stabilizer from accumulator voltage to 3.3V.
  12. On-board 512KB static ram for minimizing power consumption in sleep mode.
  13. BTM-222 Bluetooth for communication with PC or mobile phones (optional).
  14. RFM12BP at 434Mhz for communication with one remote control for huge distance up to 5Km (optional).
  15. RFM12BS at 868Mhz to control other wireless modules (optional).
  16. All modules from point 13, 14 & 15 can work at the same time without interferences.
  17. Five connectors with four pins with I2C bus and 3.3V power for future extensions.
  18. External extension bus connector to connect future external modules to ATxmega parallel data bus, such as Displays, more motors controllers, image sensors etc.
  19. Possibility to monitor power consumption from main accumulator.
  20. Possibility to monitor generated power by the photovoltaic panels.
  21. Possibility to monitor voltage of the main accumulator.
  22. Possibility to monitor power consumption of each motor powered by on-board driver.
Applications:
  1. Robots: contain on-board dual asynchronous motor driver and four connectors to control eight servomotors, powered from an Li-Ion accumulator and support to charge the accumulator from two photovoltaic cells or from an external source, several communication modules: Bluetooth Class1, EFM12BP for long distance communication up to 5Km and RFM12BS for low power and short distance communication up to 300m.
  2. Audio player: contain on-board VS1011, VS1033 or VS1053, single or dual micro-SD memory card connectors with push.
  3. Audio/Video(low quality) player.
  4. General development application because has all possibility to connect with another controller or another peripherals to the expansion bus, the expansion connector work to speed of the external ram memory, because the expansion peripherals is mapped to address space 524288 to 1048576, maximum number of expansion peripherals is 65536.


Power supply input between 3.4V and 9.5V
Maximum supported input voltage on photovoltaic connectors and the main accumulator: 9.5V, Maximum absolute 10.5V.
Board dimension: 66.83 x 130.78mm.

Friday, February 25, 2011

Intel HEX to binary HEX converter

This is an utility for programmers to convert Intel .hex files generated by AVR studio for example to binary hex data file, to create static or dynamic library like image of flash ROM and can be imported like data file to a project.

V1.0.5In this version the files that is not modified ,is not recompiled, in this case if you work on memory stick not take the number of writings / deletions of memory stick for files that is not modified, or if you work with many files will not be useless to compile the files were not changed
This version can be downloaded from here.

V1.0.4In this version I added to automatically put the "#ifndef FileName" to include only one time a library if is declared on multiple files.
This version can be downloaded from here.

V1.0.3


Added:
Now can include header file with definition constants in hex image file, in this case is no longer case to include hex image file and header file separately, you can include only hex image file, if the name of .hex file is "AA.hex" the name of header file is necessary to be "AA_Headers.inc".

When hi finish to compile all files, auto close the thread, this feature allow to include this compiler on Pre Assembling section of AVR Studio, in this case before the compilation of AVR studio, AVR Studio can launch this compiler to actualize the images of libraries, and after can compile the project with updated libraries.

Fix:
On start up auto load the path where is.

This version can be downloaded from here.

V1.0.2

Fix: no filter to .hex in 1.0.1 version.
The last version of this utility can be downloaded from here (Internet explorer only).

V1.0.1
New:
Added:
  1. On program open you can choose the base directory where is the source folder.
  2. You can always change the working directory.
  3. Automatic checking and downloading updates.


V1.0.0

This utility get all of the .hex files from directory that the utility has been opened /source and put converted files include directory structure to /bin.

For example the project is placed to C:/source/, and the utility in C:/

The directory structure is this:
C:/source/Math.hex
C:/source/IO_Port_Driver.hex
C:/source/IO_Uart_Driver.hex

After running of the utility all files is compiled on C:/bin/ and well see like that:

C:/bin/Math.asm
C:/bin/IO_Port_Driver.asm
C:/bin/IO_Uart_Driver.asm

The result is files .asm with data in hex format.

To create static or dynamic library's is necessary to put links to the integrated functions on top of the library, for example:

File: Math.asm

.Org 0
MathLibrary: // This is the base address of the links
Rjmp Add8x8_8
Rjmp Add16x16_16
Rjmp Add 32x32_32
Rjmp Sub 8x8_8
Rjmp Sub 16x16_16
Rjmp Sub 32x32_32
;--------------------------------//End of links
//Begin of routines
Add8x8_8:
Code......
Ret
;--------
Add16x16_16:
Code......
Ret
;--------
Add32x32_32:
Code......
Ret
;--------
Sub8x8_8:
Code......
Ret
;--------
Sub16x16_16:
Code......
Ret
;--------
Sub32x32_32:
Code......
Ret
;--------
//End of library

To define the offsets of links you can create another file with this, for example:

File: Math.inc

#define _MathLibrary (0) //Offset of base of links

#define _Add8x8_8 (0) //Link 1
#define _Add16x16_16 (1) //Link 2
#define _Add32x32_32 (2) //Link 3
#define _Sub8x8_8 (3) //Link 4
#define _Sub16x16_16 (4) //Link 5
#define _Sub32x32_32 (5) //Link 6

To import a library, on end of main file include "Math.asm" file from bin directory.

For example:

_MathLibrary_:
.Include "Math.asm"


All of the function from this library can be called like that:

Rcall _MathLibrary_ + _MathLibrary + _Sub8x8_8
Or if "_MathLibrary" base address of links is 0:
Rcall _MathLibrary_ + _Sub8x8_8

"_MathLibrary_" is address of the imported library assigned by the compiler when you build the project, and "_Sub8x8_8" is the offset of the link of the included routine in library defined in
"Math.inc"



Sunday, February 20, 2011

Development board 1 for ATXMEGA A1 microcontrollers

This is a very simple board to test and develop firmwares for ATXMEGA A1 micro-controllers.

This board contains only strictly necessary components for the ATXMEGA A1 micro-controller and only one extra module is added, the USB to serial adapter, the rest of modules can be added to a mother board.

This board has 89x74mm.




This is a very simple board to test and develop firmwares for ATXMEGA A1 micro-controllers.

This board contains only strictly necessary components for the ATXMEGA A1 micro-controller and only one extra module is added, the USB to serial adapter, the rest of modules can be added to a mother board.

This board has 89x74mm.



You can download gerber files and schematic from here.

Monday, July 5, 2010

NGW100 AVR32 SDK modified from tolchain216

I recently started programming for avr32, for this reason I bought a motherboard NGW100, searching the internet for AVr32 AP7000 documentation I found the package libraries and drivers tolchain216, looking through it I noticed that this is not too arranged, so i begin to arrange libraries and drivers by category and the result can be downloaded below.
NGW100 AVR32 SDK from tolchain216 V1.0

Thursday, May 20, 2010

Mp3 player with ATmega64, Vs1011 & Samsung E700 display

This MP3 player is an upgrade to this player . New in this player is a new nice interface with bitmaps from media player windows 7 and windows 7 battery icons.





I preferred to use bitmaps for interface because in future i want to be possible to change the skin interface from SD card, in this case is more simple to create skins for this player.

V1.0.1A

A little correction for used times for back light, keyboard and battery showing.

Download MP3 PlayerV1.0.1A

V1.0.1

This version player is made to use ASM_SDK V1.0.4 and prepared to work with multiple opened files.

Download MP3_PlayerV1.0.1

From here you can download ASM_SDK.
With ASM_SDK 1.0.5 or newest version you can play from SDHC high capacity > 4GB, at the frequency of only 6 MHz you can play 320Kb/s bit rate melody's.

V1.0.0From here you can download the first source code for this player.To compile this player is necessarily to download and include ASM SDK from here, this version is made to use ASM_SDK V1.0.3.

Thursday, May 6, 2010

Micro Hex Bootloader for ATmega microcontrollers

New in 1.1 version:

The boot loader from microcontroller can report 5 different errors:
  1. LineDefError = One line is not have the defined destination.
  2. SecondHexCharNotFound = If first hex char is found but second hex char is not found or is not one hex char.
  3. CheckSum = If in one line is detected one check sum error.
  4. LineMismach = After conversion from hex to bin If total length line - 5 is not equal to data bytes contained by that line.
  5. NoMemorySelected = If user is trying to write in memory but the user is not sends the command to select Flash or EEProm memory.
Resources:
  • Flash = 852 Bytes For Atmega8( The fusible for jumping in boot loader is necessarily to set to 512 Words ).
  • Flash = 860 Bytes For Uart0 Atmega64-128( The fusible for jumping in boot loader is necessarily to set to 512 Words ).
  • Flash = 878 Bytes For Uart1 Atmega64-128( The fusible for jumping in boot loader is necessarily to set to 512 Words ).

From this moment the source code is ready to download for free.
To compile this boot loader is necessarily to use last ASM SDK.
This Bootloader has maximum 512Words(1KB) of flash and can work on controllers listened down:

ATmega48 Not Tested
ATmega48P Not Tested
Atmega8 Not Tested
Atmega8A Not Tested
ATmega88 Not Tested
ATmega88A Not Tested
ATmega88PA Not Tested
ATmega16 Not Tested
ATmega16A Not Tested
ATmega162 Not Tested
ATmega168 Not Tested
ATmega168A Not Tested
ATmega168PA Not Tested
ATmega32 Not Tested
ATmega32A Not Tested
ATmega64 OK
ATmega64A Not Tested
ATmega640 Not Tested
ATmega128 OK
ATmega128A Not Tested
ATmega1281 Not Tested
ATmega1280 Not Tested
ATmega2561 Not Tested
ATmega2560 Not Tested

Download Bootloader V1.1 ASM Source code and PC uploader C# source code.


First version V1.0

This is an utility that eliminate the ISP programmer for ATmega Microcontrollers and he work even on Windows Vista and Windows 7.

This boot loader is created to upload data in hex format no bin like others boot loaders, to convert from hex to bin is used an function integrated in boot loader not in up loader.

Version ( V1.0 ) is capable to write flash and eeprom (.hex and .eep) generated by AVR Studio and AVR GCC.

The .eep file is detected automatically by the program from the name of .hex file, for this reason is necessarily to select only .hex file.

When this boot loader is present on an ATmega microcontroller ,at reset is booting in boot loader and is programed to stay and wait for "BootInit" + Cr for entering in programed mode for 2 seconds, if "BootInit" + Cr is not received the boot loader jumps to address 0 in flash.

If communication is interrupted more than 2 seconds this boot loader jump to address 0 of flash.

The boot loader from microcontroller can report 4 different errors that can be appear:
  1. LineDefError = One line is not have the defined destination.
  2. SecondHexCharNotFound = If first hex char is found but second hex char is not found or is not one hex char.
  3. CheckSum = If in one line is detected one check sum error.
  4. LineMismach = After conversion from hex to bin If total length line - 5 is not equal to data bytes contained by that line.
Resources:
Flash = 952 Bytes For Uart1 ( The fusible for jumping in boot loader is necessarily to set to 512 Words ).

Down is ready to download 2 Hex demo files that contain the boot loader for ATmega64 at 16Mhz and 8Mhz at Baud rate 19200b/s for Uart1

Download PC uploader V1.0
Download BootLoader for ATmega64 8Mhz Uart1 19200b/s V1.0
Download BootLoader for ATmega64 16Mhz Uart1 19200b/s V1.0

Complete File to Hex converter

I've made this converter because I've searched on the internet looking for a converter that converts one file.bmp with header in decimal or hex and i didn't find it. This converter convert a file.bmp in a file.asm with all the additions ".db" for declaration constants.

The result file contains all the bytes converted without exception.
The name of the result file is: 'name of file converted.asm' for AvrASM ex: test.bmp is saved test.bmp.asm









Because I've been asked about a AvrGcc converter, i have created a program for converting in .h files
The name of the result file is: 'the name of file converted.h' for AvrGCC ex: test.bmp is saved test.bmp.h










This is the result for AvrASM:
















This is the result for AvrGCC:















FileConverterToHexAvGCC_V1.1.zip

Multifunctional 20 Band Audio Spectrum Analyzer V3.0.x

This project is a version 3 firmware and hardware upgrade spectrum analyzer with 20 audio band of 20 levels each and includes other functions and utilities improvements.


From Digital electronics and programing
From Digital electronics and programing



On future:
  1. Option to put five, ten or more of this boards, each board filtering one frequency, rotated by ninety degrees to obtain large size of panel for disco or other purposes.
  2. Ability to display a text message received on the serial unit.
  3. Ability to display time during sleep.
  4. Function to adjust the signal level manually.
  5. Ability to wake up from standby function if signal input is detected.
  6. Ability to enter standby mode in the absence of input signal.
  7. Ability to export using the serial unit, the levels displayed on the local display.
And many many other functions...........

V3.2
On this update has been added AGC function(Automatic Gain Control), this function allow the spectrum analyzer to work with signals between 80 and 1000mV without external signal conditioner or external signal regulator.
This function can not be turned off from menu settings.

With this update you can download an update for PC client of the up-loader for  this spectrum analyzer, please go here to download this software.


V3.1
Is renamed because is one big step from filters combined (digital & analog) to completely digital filtering.
Added functions:
  1. Ability to enter in standby from menu.
  2. Change from help of analog circuits to filter audio bands to completely digital filtering bands, without the help of analog filtering circuits ( this improve the stability of the displayed bands ) .

V3.0.3

Added functions:
  1. Improve speed of way to display levels of frequencies 0,1 & 2.
  2. Ability to set the start-up light when is connected to power supply.
  3. Ability to set-up the horizontal way to display the levels of frequencies, normal or mirrored for stereo use, the way is memorized for start-up config.
V3.0.2

Functions:
  1. Eleven different ways of displaying the levels of frequencies.
  2. Five modes(ways) of display luminance.
  3. Ability to set the star-up mode when is connected the power supply.
V3.0.0 & V3.0.1 generic versions( discarded ).

Wednesday, May 5, 2010

ASM SDK

V1.0.5Added functions:
  1. "IO_Driver_20x20LedDisplay.asm" Added function "_PaintVerticalBarToVideoRamDnLeft" display one bar with R16 col pozition and R18 Length.
  2. "IO_Driver_20x20LedDisplay.asm" Added function "_PaintVerticalBarToVideoRamUpLeft" display one bar with R16 col pozition and R18 Length.
  3. "IO_Driver_20x20LedDisplay.asm" Added function "_SleepDisplay" to sleep display to deactivate scanning of matriceal display.
  4. "IO_Driver_20x20LedDisplay.asm" Added function "_WeekDisplay to resume from sleep.
  5. "IO_Driver_20x20LedDisplay.asm" Added function "_DisplaySecondaryRam" I added a secondary ram buffer to prevent flicker when you write to video ram.
  6. "IO_Driver_20x20LedDisplay.asm" Added function "_Display_TransferDataToDisplay_True" This allow to transfer data from secondary buffer to video ram buffer.
  7. "IO_Driver_20x20LedDisplay.asm" Added function "_Display_TransferDataToDisplay_False" This block transfersof data from secondary buffer to video ram buffer.
  8. "IO_Adc.inc" Added function ".Macro _Macro_Adc_Sleep" to sleep internal ADC.
  9. "IO_Adc.inc" Added function "_Macro_Adc_Week" to resume from sleep internal ADC.
Optimizations:
  1. "IO_SdDriver.asm" Added support for SDHC High capacity > 4GB ( tested with one Kingston SDC4/16GB 02, MicroSD 16GB Class 4)
V1.0.4Added functions:
-In "Drivers/IO_Driver_20x20LedDisplay.asm" non multiplexed 20x20 led display.

Options:
-In "Lib/Util.inc" Option to eliminate non used memory type.

Optimizations:
-In "System/SoftTimers.asm" optimized tick function.
-One important optimization on Fat32 FFS
may allow programmers to work with allocation table management library and data management library fully dynamic, now with this optimization the use can mount infinite discs on single microcontroller, the limit is only the ram memory.

Added library:
-"System/Vectors.inc"is a macro functions to help programmers to place vectors more simply.
-"Drivers/IO_ADC.asm" and "IO_ADC.inc"is a generic driver to work with internal hardware ADC.

Bug fix:
-"IO_VS1011a.asm" fix an error that "VS1011GetBitrate" function return's 0 if the table of bitrate constant is called one part on Zh and another part on Zh+1


An example to use Fat32 FFS with multiple disks:
_Fat32_IndexManagement_RamAlloc IndexManagementLibraryRamDisk1
_Fat32_IndexManagement_RamAlloc IndexManagementLibraryRamDisk2
_Fat32_DataManagement_RamAlloc RamToFat32DataPlayerDisk1
_Fat32_DataManagement_RamAlloc RamToFat32DataPlayerDisk2
_Fat32_Mount IndexManagementLibraryRamDisk1
_Fat32_Mount IndexManagementLibraryRamDisk2
_Fat32_SesionInit IndexManagementLibraryRamDisk1, RamToFat32DataPlayerDisk1
_Fat32_SesionInit IndexManagementLibraryRamDisk2, RamToFat32DataPlayerDisk2

On every change of working disks is necessary to point in Zl:Zh the data management library allocated ram like that:
_Fat32_DataManagement_GetRamAddress RamToFat32DataPlayerDisk1
Code to work with this disk...................
_Fat32_DataManagement_GetRamAddress RamToFat32DataPlayerDisk2
Code to work with this disk...................

This is cool because you can copy one file from one disk to another.

With this new optimization you can open two or more files on same disk, one example is this:
_Fat32_IndexManagement_RamAlloc IndexManagementLibraryRamDisk1
_Fat32_DataManagement_RamAlloc RamToFat32DataPlayerDisk1
_Fat32_DataManagement_RamAlloc RamToFat32DataPlayerDisk2
_Fat32_Mount IndexManagementLibraryRamDisk1
_Fat32_SesionInit IndexManagementLibraryRamDisk1, RamToFat32DataPlayerDisk1
_Fat32_SesionInit IndexManagementLibraryRamDisk1, RamToFat32DataPlayerDisk2
_Fat32_DataManagement_GetRamAddress RamToFat32DataPlayerDisk1
Code to work with this disk................... Get byte from file 1
_Fat32_DataManagement_GetRamAddress RamToFat32DataPlayerDisk2
Code to work with this disk................... Write byte to file 2



Download SDK 1.0.4


V1.0.3
-Added battery paint with 9 bitmap levels and charge bitmap,this function can be called from Dx.asm, before calling this function in R16 is necessarily to lead level:

  1. BatteryEmpty
  2. Battery1
  3. Battery2
  4. Battery3
  5. Battery4
  6. Battery5
  7. Battery6
  8. Battery7
  9. BatteryFull
  10. BatteryCharge
-Verified software timers from one hardware timer: this function is like timers from C,C++,C#,Delphi and others programing languages, example:

.Dseg
TimeToEsantionBattery: .Byte 8; Reserve ram for this timer
TimeToTurnOffLight: .Byte 8
; Reserve ram for this timer
.Cseg


Ldi R16,Low(1000); Hardware timer tick /1000
Ldi R17,Byte2(1000)
Ldi R18,Byte3(1000)
Ldi R19,Byte4(1000)
Ldi Yl,Low(TimeToEsantionBattery)
Ldi Yh,High(TimeToEsantionBattery)
CallLib _SoftTimer,_SoftTimer_Init

Ldi R16,Low(10000); Hardware timer tick /10000
Ldi R17,Byte2(10000)
Ldi R18,Byte3(10000)
Ldi R19,Byte4(10000)
Ldi Yl,Low(TimeToTurnOffLight)
Ldi Yh,
High(TimeToTurnOffLight)
CallLib _SoftTimer,_SoftTimer_Init

Main:
Wdr
Ldi Yl,Low(TimeToTurnOffLight)
Ldi Yh,
High(TimeToTurnOffLight)
CallLib _SoftTimer,_SoftTimer_Tick
Rcall TurnOffLight

Ldi Yl,Low(TimeToEsantionBattery)
Ldi Yh,
High(TimeToEsantionBattery)
CallLib _SoftTimer,_SoftTimer_Tick
Rcall EsantionBattery
Rjmp Main

TurnOffLight:
; Routine to execute tick
Ret
EsantionBattery:
; Routine to execute tick
Ret


To disable one timer use this example:
Ldi Yl,Low(TimeToTurnOffLight)
Ldi Yh,
High(TimeToTurnOffLight)
CallLib _SoftTimer,_SoftTimer_Disable

To enable one timer use this example:
Ldi Yl,Low(TimeToTurnOffLight)
Ldi Yh,
High(TimeToTurnOffLight)
CallLib _SoftTimer,_SoftTimer_Enabled



This timers is enabled when is initiated.

Download SDK 1.0.3


V1.0.2-Added SDHC support in SD card driver,
-Added support for dynamically MBR location in Fat32 Filesystem library.

Download SDK 1.0.2

V1.0.1A
This litle update is a modification in Internal EEProm Driver file to work with more microcontrollers.

Download SDK 1.0.1A

V1.0.1
  1. Fat32file system Read and write with 3 modes of ram allocation. OK Doc RO
  2. BTM bluetooth driver. Not finished ( Some functions not proved )
  3. Samsung E700 TFT color display driver. OK Doc RO
  4. Nokia 6100 display driver. Not completed (No 24Bit ink support ) Doc RO
  5. HD44780 display driver. Not completed ( no optimization )
  6. External I2C EEProm driver. OK
  7. Internal eeprom driver. OK
  8. Macro eeprom driver. OK
  9. Joystick 5 direction driver. OK
  10. General IO utility driver. OK
  11. SD card driver in SPI mode. OK
  12. Hardware SPI driver Macro mode. OK
  13. Software SPI driver macro mode. Not tested
  14. Uart hardware driver in macro mode. OK
  15. VS 10xx driver. OK
  16. (Added) 20x20 multiplexed matrix led display with 5 x 74hc574.
Library:
  1. Variable conversion library. OK
  2. Direct X library to work with display drivers included in this SDK. OK
  3. Mathematics library. Not finished ( Some functions not proved )
  4. Utility library. OK Doc RO Doc EN
System:
  1. Internal EEProm file system. OK
  2. Software ram disk file system. OK
  3. Software timers created from one hardware timer. Not tested
Dx.asm is more important graphic management file from this sdk, because this file has an numerous utility functions to display:
  1. Function to display characters in 8x6 pix format with variable weight.
  2. Function to display strings using function from point 1.
  3. Function to create menu bar with catted corners full or empty, one color for margins and one for internal.
  4. Function to paint an line with an color (not finished).
  5. Function to paint an bitmap in 8 or 24 bit format, stored in Internal Ram memory, Internal EEProm memory, Internal Flash memory, external serial flash memory(not finished), external serial EEprom memory(not finished) or SD memory card(not finished), is necessary to store entire bitmap not converted to bin or others formats( one utility to convert an entire bitmap to hex asm or c for avr can be found here ).
  6. Function to display an progress bar created only from bitmaps stored in one of memories from point 5, this progress bar looks like progress from last MP3 player created by me and found here.
Download SDK 1.0.1

V1.0.0
This ASM SDK created by me is a group of library and drivers that contain:
Version 1.0
Drivers:
  1. Fat32 file system Read and write with 3 modes of ram allocation. OK Doc RO
  2. BTM bluetooth driver. Not finished ( Some functions not proved )
  3. Samsung E700 TFT color display driver. OK Doc RO
  4. Nokia 6100 display driver. Not completed (No 24Bit ink support ) Doc RO
  5. HD44780 display driver. Not completed ( no optimization )
  6. External I2C EEProm driver. OK
  7. Internal eeprom driver. OK
  8. Macro eeprom driver. OK
  9. Joystick 5 direction driver. Not tested
  10. General IO utility driver. OK
  11. SD card driver in SPI mode. OK
  12. Hardware SPI driver Macro mode. Not tested
  13. Software SPI driver macro mode. Not tested
  14. Uart hardware driver in macro mode. OK
  15. VS 10xx driver. OK
Library:
  1. Variable conversion library. OK
  2. Direct X library to work with display drivers included in this SDK. Not tested
  3. Mathematics library. Not finished ( Some functions not tested )
  4. Utility library. OK Doc RO Doc EN
System:
  1. Internal EEProm file system. OK
  2. Software ram disk file system. OK
  3. Software timers created from one hardware timer. Not tested
Download SDK 1.0.0


Wednesday, April 29, 2009

DiY: MP3 player with ATmega64 VS1011a and Samsung E700 color Display

This is my new mp3 player.

For this MP3 player is new: the display and a new graphical interface explorer.

Knowing that the display of the Nokia 6100 is an old and extremely poor quality, I thought to exchange it with one TFT display ( higher quality ) , by doing this I thought I make an new interface, and this is the result:

-File type played (VS1011): Decodes MPEG 1.0 & 2.0 audio layer III
(CBR, VBR, ABR); layers I & II optional;
WAV (PCM + IMA ADPCM)

-File type played (VS1033): Decodes MPEG 1 & 2 audio layer III (CBR
+VBR +ABR); layers I & II optional;
MPEG4 / 2 AAC-LC-2.0.0.0 (+PNS);
WMA4.0/4.1/7/8/9 all profiles (5-384 kbps);
WAV (PCM + IMA ADPCM);
General MIDI / SP-MIDI format 0 files
-File type played (VS1053): Decodes Ogg Vorbis;
MPEG 1 & 2 audio layer III (CBR +VBR
+ABR); layers I & II optional;
MPEG4 / 2 AAC-LC(+PNS),
HE-AAC v2 (Level 3) (SBR + PS);
WMA4.0/4.1/7/8/9 all profiles (5-384 kbps);
WAV (PCM + IMA ADPCM);
General MIDI 1 / SP-MIDI format 0 files

For bitrate higher than 320Kb/s is necessary to increase the CPU frequency from fuses for 4Mhz to fuses for 8Mhz internal RC

This project is under develop.
Last update 14-06-2009
Download source code
Download the board .max and gerber files
Download orcad schematick
Download PDF schematick




Mp3 Player with Winamp skin

Mp3 Player with Synthetic skin

Mp3 Player with Media Player skin Download demo hex fileThe fuse bit be set for 4Mhz Internal RC Oscillator

Mp3 Player with Half Life skin

This player run 2 threads , one for navigating and one for serving data to VS1011.

The last rectify of compatibility of Fat32 filesystem library and Player data service library has increase the transfer rate , in this moment the player is capable to read 256Kbit/s melody at 4Mhz internal RC clock with osccal=199(default), and 320Kbit/s at 4Mhz and osccal=255 (approximately 5Mhz) internal RC clock.

Now i work to one explorer configured from skin file like XML file.

This navigator display the short filename if the long file name is not writed on the name of file.

For support post a comment






This project was abandoned for another more powerful.

Thursday, April 23, 2009

DiY: most tiny MP3 player with ATmega8 VS1011a and Nokia6100 Display

This is a complete mobile MP3 player and first mp3-player with ATmega8 and Nokia 6100 color display.

An demo firmware and gerber file for board will be available soon.

This player has capability to play wav and mp3 files and view BMP files on 8 or 24 bits/pixel from a MicroSD card with maximum capacity 2GB, the format of the SD is FAT32 with clusters from 512 Bytes to 32768Bytes, the filesystem has no limits in number of directories and files.
For future i want to adapting the SD driver for SDHC because the filesystem is designed to use all capacity of fat32 ( 2TB in 512Bytes/sector)

List of features:
Play Wav and MP3 Files because the VS1011a only this files is capable to decode( but for future in this project i want to include the VS1053 chip to play more file formats.
View Bitmap files on 8Bit and 24 bit/pixel

This project is in asm language and my 100% own libraries









For the moment the project has 5172Bytes of Flash , 663Bytes of Ram and 0Bytes of EEprom

I work to another MP3 player:
New MP3 Player Link

Saturday, February 28, 2009

Fat32 complete library in asm language

Observing that the file system created by me is almost identical to FAT32, i decided to convert to FAT32, this library work with clusters from 256 bytes to 32768 bytes autodetect from storage device.

This library is in asm language.

This file system is designed for double buffered (a buffer to the Allocation Table and a data buffer) this method of using separate buffers increase the rate of transfer to the storage device.

The buffer’s separation between allocation table and the data, makes that at each change of the data cluster not to charge the next cluster index from storage device. In this case, the index is token from allocation table’s buffer, if this is inside the sector memorized inside buffer. If this is not inside the sector of the buffer, then will be saved the buffer in allocation table (in case that inside the buffer has been made a modification), and then will be loaded in the sector where the index is.

In this way can be made with the data buffer. The pointer can be putted at an particular offset from open file, and then, from the address of the pointer can be read byte with byte, the pointer been incremented automatically. The same will be the sectors inside the buffer, those will be changed automatically. It doesn’t matter for user which cluster or bit must be read, because everything is done automatically. User must set the address of the file needed and the pointer of the address of the byte inside the file.

Done functions:
-Go to file/folder ( address in clusters )
-Go to next file/folder in current directory ( this function return Flag T in Sreg = 0 if the pointer is on bottom of the list else return 1)
-Go to forward file folder in current directory ( this function return Flag T in Sreg = 0 if the pointer is on top of the list else return 1)
-Read address on pointed file/folder ( in clusters )
-Read short name of pointed file/folder ( string 11 char )
-Read full name of pointed file/folder ( string max 128 char )
-Read byte by byte the file opened ( offset of byte in file ) with autoincrement pointer
-Write byte by byte in the file opened ( offset of byte in file ) with autoincrement pointer ( this function work with append in file and have property to enlarge the size of file )
-Read pointed file size (in bytes)
-Write pointed file size = current pointer
-Read pointed file attribute
-Write pointed file attribute
-Read pointer in opened file
-Write pointer in opened file
-Create file with short name converted from long name( Creating with long name not completed )
-CloseFile ( when the file is closed if the pointer in file is bigger to actual size of file , the actual size of file = pointer position in file ( in read mode is not possible to point to an byte address bigger to file size but in write mode this is possible because the file is auto enlarged )

The terminal have next functions:
+ :
Go Down one file folder and read short and long file name.
- :
Go Up one file folder and read short and long file name.
Enter :
1) Go to selected folder,
2) Open selected file,
3) Close opened file.
Esc :
Close opened file
p :
Enter in write long file name, and Enter will convert from long filename to short filename
c :
Create file with converted short filename


Performance obtained with ATmega640 at 16 Mhz and SPI hardware at 8Mhz:

Write SD Card with 512 Bytes/cluster = 48659 Bytes/s
Write SD Card with 4096 Bytes/cluster = 40163 Bytes/s
Read SD Card with 512 Bytes/cluster = 70286 Bytes/s
Read SD Card with 4096 Bytes/cluster = 56229 Bytes/s

Transfer rate depends on the device storage and on fragmentation.
The flash used not include the terminal

Resources for maxim 512 bytes/cluster:
Flash= 3220 Bytes ( Only read section )
Flash= 5042 Bytes ( Read and write sections )
Ram for allocation table management= 542
Ram for data management= 629 (512Bytes (Data Buffer)+ 64 (Bytes String Long Name) + 11Bytes (String Short Name) + Variables )
Total Ram= 1171Bytes

Resources for maxim 4096 bytes/cluster:
Flash= 3220 Bytes ( Only read section )
Flash= 5042 Bytes ( Read and write sections )
Ram for allocation table management= 542
Ram for data management= 4213 (4096Bytes (Data Buffer)+ 64 Bytes (String Long Name) + 11Bytes (String Short Name) + Variables )
Total Ram= 4755 Bytes

The ram size is set by user because the maximum size of cluster is set by ram buffer data cluster

The data management library is a dynamic library ( That means this library can be open multiple times, and when you call the library in Z must be the beginning address of RAM to work with ) for this i wrote the ram size table occupied by allocation library and data management library separately

In conclusion we can work with multiple open files using a single library written in flash that can work with multiple sections of ram

Operating principle:
This block function is one example only for 512 Bytes/Cluster Fat32 formats for other cluster dimension the ram allocation is different.


Fig1


In this moment i work to create and allocation table library from static library to dynamic library

These two libraries ( allocation table and data section ) will be in 2 variants:
1) A library will have only buffer for data which can be put on the controllers with ram more than 655Bytes
2) A library that does not include buffers (will lose the stats of dynamic library) but which can be put on the controllers that have the minimum 128Bytes of ram
____________________________________________________________________

This library is concept to work with only one buffer and work fine to my MP3 players at 5Mhz with 320Kb/s melody with one artifice, and from this moment this library is open source
This library use 3016Bytes of flash and 655Bytes of ram memory
The up bloc description in Fig1 can by applied and for this library

1)Fat32_DataInit
2)Fat32_ReadByte
3)Fat32_GoToRoot
4)Fat32_GoToFile
5)Fat32_ResetDirPointer
6)Fat32_IncrementDirPointer
7)Fat32_DecrementDirPointer
8)Fat32_GetShortFileName
9)Fat32_GetLongFileName
10)Fat32_GetFileAdress
11)Fat32_ReadFileSize
12)Fat32_ReadFileAttr
13)Fat32_WritePointerInFile
14)Fat32_ReadPointerInFile
15)Fat32_OpenPointedFileFolder
16)Fat32_CloseFile

Last update 17-06-2009
Download fat32 read only library for atmega64
Download fat32 read only library for atmega8

Now this driver is updated and included in my ASM_SDK here

For support post a comment

Thursday, January 29, 2009

4x25W amplifier with internal usb control

This is a 4x22W amplifier 4Ohm which is young for a PCI Desktop slot and can be diagnosed and controlled by an internal USB connector.
This project is still in development stage
This card is made with a specialized circuit in Class D with I2C control interface produced by TexasInstruments TAS5414 QFP64 and a ATmega8 controller

Wednesday, January 14, 2009

USB Unipolar 3 in 1 Motor Stepper Controller

This is a usb controller for 3 engines unipolar step by step, you can move completely independent, and in terms of speed of rotation sense and the coordinated which should be.

The position of engine can take value between -2147483648 and 2147483647
Minim velocity = 0.015 steps/second
Maximum velocity = 1000 steps/second

Here i posted a brief presentation of the controller in the prototype phase, it will arrive in stores in a short period.

It is designed around an ATmega8 microcontroller with USB1.1 software interface and drivers that are used is ULN2003

This is the interface for the PC, to control in real-time the controller:








And this is the prototype controller board:


















In the next image is described command method :

From Digital electronics and programing

Update for PC program, add new function:


















Wednesday, November 12, 2008

3in1 unipolar motor steper controller

This project is designed for control 3 motors stepper independently with only one ATmega8 mocrocontroller

This project has been designed for unipolar engines

The interface is Serial 19200b/s

For Bipolar engines






















Download entire project