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


3 comments:

Research Term Papers said...

The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!

Anonymous said...

Hi, let me say that your blog is very very nice :-).
Please, thake a moment to verify all link in ASM SDK because all link are broken, like this http://download.avrdevboardshop.hostzi.com/ASM_SDK/MorgothAvrAsmSdkV1.0.3.rar

Thank You.
Luigi

Whitney D said...

Great reading yoour blog