圣龙扬特-AVR电子

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1261|回复: 5

BASCOM-AVR利用AVR-DOS库读写SD卡

[复制链接]

67

主题

4

好友

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
2
帖子
343
精华
0
注册时间
2013-2-20
在线时间
366 小时
发表于 2013-3-2 13:49:01 |显示全部楼层
  根据http://members.aon.at/voegel/index.html网站上提供的资料,试验了用BASCOM读写SD卡,完全可以把SD卡当作磁盘来操作,与VB/QB语法兼容,编程非常简单。

  AVR-DOS介绍
  Features:
        ·  Read and write ASCII-Files
        ·  Read and write Binary-Files
        ·  Drivers available for Compact Flash Cards, Hard disk, MMC, SD etc.
        ·  Completly integrated in BASCOM-AVR Compiler
        ·  QB/VB compatible syntax
        ·  Completly written in AVR-Assembler (fast and compact)
  It works with:
        ·  DOS-FAT16 and FAT32 formatted partitions
        ·  Files in Root directory and sub directories
        ·  Short DOS File names (8.3)
        ·  Sector Size of 512 Bytes (nearly all CF-Cards and HD)
        ·  Linear sector addressing (LBA-Mode). (all newer CF-Cards and HD). C/H/S-Mode of old HD is not supported.
  Please note: AVR-DOS is only free for non commercial use. For commercial use, or when you are interested in ASM-Code and complete documentation please check License directives
  Functions:
  Here is a list of all in BASCOM-AVR integrated statements, which uses AVR-DOS functionality.

  Disk/Directory:
           
·  InitFileSystem (<Partition#>)
           ·  DiskSize
           ·  DiskFree
           ·  Kill <FileName>
           ·  Dir ([ <FileName> ])
           ·  FileLen ([ <FileName> ])
           ·  FileDateTime ([ <FileName> ])
           ·  FileDate ([ <FileName> ])
           ·  FileTime ([ <FileName> ])
           ·  GetAttr ([ <FileName> ])   
           ·  Name<OldFileName> As <NewFileName>   
           ·  ChDir <PathName>])   
           ·  MkDir <PathName>])   
           ·  RmDir <PathName>])   
  File create, open, read, write, close:
           ·  FreeFile
           ·  Open <FileName> For Input/Output/Append/Binary as #<File#>
           ·  Close <File#>
           ·  Flush [<File#>]
           ·  Print #<File#>, Variable1; Variable2; …
           ·  Write #<File#>, Variable1, Variable2, …
           ·  Input #<File#>, Variable1, Variable2, …
           ·  Line Input #<File#>, StringVariable
           ·  Get #<File#>, <Variable> [,<Position>]
           ·  Put #<File#>, <Variable> [,<Position>]
           ·  Seek #<File#> [,<New Position>]
  Infos about opened files:
           
·  EOF (#<File#>)
           ·  LOC (#<File#>)
           ·  LOF (#<File#>)
           ·  FileAttr (#<File#>)

  Others:
           
·  Bload <FileName>, <SRAM-Address>
           ·  Bsave <FileName>, <SRAM-Address>, <Length>

SD卡与AVR数据信号电平转换示意图:


我做的转换电路板:Vcc使用2个二极管降压。


BASCOM源程序下载




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

回复

使用道具 举报

1

主题

0

好友

547

积分

高级会员

Rank: 4

UID
51
帖子
15
精华
0
注册时间
2013-2-28
在线时间
4 小时
发表于 2013-3-2 15:31:39 |显示全部楼层
老大好作品啊,我要慢慢研究了,
回复

使用道具 举报

8

主题

0

好友

161

积分

初级会员

Rank: 2

UID
353
帖子
45
精华
2
注册时间
2013-4-10
在线时间
9 小时
发表于 2013-4-10 16:55:52 |显示全部楼层
收藏了,下来研究一下。
回复

使用道具 举报

0

主题

0

好友

20

积分

新手上路

Rank: 1

UID
696
帖子
4
精华
0
注册时间
2021-2-8
在线时间
0 小时
发表于 2021-2-9 13:07:16 |显示全部楼层
感谢admin无私奉献,先下载学习
回复

使用道具 举报

0

主题

0

好友

20

积分

新手上路

Rank: 1

UID
696
帖子
4
精华
0
注册时间
2021-2-8
在线时间
0 小时
发表于 2021-2-9 13:26:26 |显示全部楼层
老大,粗略看了下,CONFIG_AVR-DOS.bas、Config_MMC.bas这2个似乎是配置用的,但是怎么用不明白,请指教。M8是否可用?
回复

使用道具 举报

67

主题

4

好友

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
2
帖子
343
精华
0
注册时间
2013-2-20
在线时间
366 小时
发表于 2021-2-17 20:06:50 |显示全部楼层
yyj679 发表于 2021-2-9 13:26
老大,粗略看了下,CONFIG_AVR-DOS.bas、Config_MMC.bas这2个似乎是配置用的,但是怎么用不明白,请指教。M ...

主程序里引用。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|手机版|圣龙扬特-AVR电子 ( 鲁ICP备05022832号 )

GMT+8, 2024-3-29 23:40 , Processed in 0.242220 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部