Flash Mem Library

General discussion on mikroBasic.
Post Reply
Author
Message
yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Flash Mem Library

#1 Post by yo2lio » 24 Jun 2007 22:24

This is a implementations of Flash Library for PIC18F MCU, writed by me.

Explanation of procedures and functions :

' Erase ...( depends of MCU ) block at address ... (64 or 1024 bytes, see datasheet of MCU)'
' For PIC18F452,Pic18F4520, ..., PIC18FxxJxx '

Code: Select all

sub procedure Flash_Mem_Erase(dim address as longint)
' Write 8 bytes block at address ... '
' Only for PIC18Fxx2 series, see datasheet of MCU '

Code: Select all

sub procedure Flash_Mem_Write_8(dim address as longint, dim byref data as byte[8])   
' Write 64 bytes block at address ... '
' Only for PIC18F4520, ..., PIC18FxxJxx, see datasheet of MCU '

Code: Select all

sub procedure Flash_Mem_Write_64(dim address as longint, dim byref data as byte[64]) 
' Erase and write 64 bytes 8x8 block at address ... '
' Only for PIC18Fxx2 series, see datasheet of MCU '

Code: Select all

sub procedure Flash_Mem_Erase_Write_64(dim address as longint, dim byref data as byte[64])
' Erase and write 64 bytes block at address ... '
' Only for PIC18F4520 series, see datasheet of MCU '

Code: Select all

sub procedure Flash_Mem_Erase_Write_64A(dim address as longint, dim byref data as byte[64])
' Erase and write 1024 bytes block at address ... '
' Only for PIC18FxxJxx, see datasheet of MCU '

Code: Select all

sub procedure Flash_Mem_Erase_Write_1024(dim address as longint, dim byref data as byte[1024]) 
' Read 1 byte at address ... '
' For all type of MCU '

Code: Select all

sub function Flash_Mem_Read(dim address as longint) as byte
' Read N bytes (user can define this) at address ... and put them in data dim... '
' For all type of MCU '

Code: Select all

sub procedure Flash_Mem_Read_N_Bytes(dim address as longint, dim byref data as byte[max_read], N as word)

User must choose between this procedures and functions depending of MCU.

The source cod You can download here:

http://www.microelemente.ro/MikroBasic/ ... ibrary.zip

Enjoy

Best regards Florin Medrea
Last edited by yo2lio on 25 Jun 2007 05:25, edited 1 time in total.

xor
Posts: 5465
Joined: 18 May 2005 00:59
Location: NYC
Contact:

#2 Post by xor » 25 Jun 2007 03:20

Nice routines... thanks. :D
[color=darkred][b]xor[/b][/color]
[url=http://circuit-ed.com]CircuitED -[/url]

Post Reply

Return to “mikroBasic General”