山楂可以和什么一起泡水喝| 持续是什么意思| 百岁山和景田什么关系| 什么血型是万能血型| 脚气是什么原因引起的| 凌空什么| 米酒是什么酒| 褒义词和贬义词是什么意思| 虚构是什么意思| 食管反流用什么药效果好| 找工作上什么网| 肚子里有积水是什么病| 吃饭后胃疼是什么原因| 尿酸高是什么引起的| 陈皮有什么功效作用| 香菜什么时候种| 庙是什么意思| 养什么能清理鱼缸粪便| 灰色鞋子搭配什么颜色裤子| zqsg是什么意思| 59年属什么生肖| 缺维生素b吃什么食物| 羊水透声欠佳什么意思| 藏红花是什么| 怀孕第一个月最怕什么| 10月6日什么星座| 隐形眼镜什么牌子好| 脚上长疣是什么原因| 发烧输液输的是什么药| 炒作是什么意思| 广东第一峰叫什么山| 血管属于什么组织| 肺气肿是什么病严重吗| 这是什么颜色| 蜻蜓点水的目的是什么| 食管裂孔疝是什么原因造成的| 甲状腺炎吃什么药好得快| 为什么小孩子经常流鼻血| 7月15日是什么节日| 在所不辞是什么意思| 肌酐清除率是什么意思| 天津古代叫什么| 古丽是什么意思| 梦见好多死人是什么征兆| 什么叫囊性结节| 好难过这不是我要的结果什么歌| 尿酸偏高是什么原因| 无忧是什么意思| 始祖鸟是什么鸟| 法西斯是什么意思啊| 白羊座上升星座是什么| 朱元璋什么星座| 坏垣是什么意思| 非亲非故是什么意思| 西瓜什么时候种| 45岁属什么的生肖| 观音菩萨的坐骑是什么| 画蛇添足什么意思| 采是什么意思| 附件炎吃什么药最好| 依赖一个人是什么意思| 为什么有的人晒不黑| 17年属什么| 蚊子为什么吸血| 自限性疾病是什么意思| 预防医学是干什么的| 肠梗阻是什么症状| 电轴不偏是什么意思| 老年人吃什么水果对身体好| 豆浆喝多了有什么坏处| 蛋糕粉是什么面粉| rh血型D阳性是什么意思| 蚊子吸血是为了什么| 致字五行属什么| 5月30是什么星座| 高炮是什么| 女人吃猪肝有什么好处| 杀生电影讲的什么意思| 经常流鼻涕是什么原因| 糖尿病人早餐吃什么最好| 排暖期出血是什么原因| 为什么都说头胎很重要| 活检是什么检查| 抑菌是什么意思| 细菌性阴道病用什么药| 梦见别人掉牙齿是什么征兆| 坪效是什么意思| 调御丈夫是什么意思| 铜绿是什么| 蓦然回首什么意思| 甲状腺功能三项查什么| 12.24是什么星座| 一个山一个脊念什么| 明媚是什么意思| 梦见自己把蛇打死了是什么意思| 各的偏旁是什么| 左眼跳什么| 十月二十五是什么星座| 牙为什么会疼| 颈动脉强回声斑块是什么意思| 爱的真正含义是什么| 晚上9点到11点是什么时辰| 截胡什么意思| 腹胀吃什么药| 散光轴位是什么| 为什么精子是黄色的| 灰指甲挂号挂什么科| 大尾巴狼是什么意思| 托腮是什么意思| 爱而不得是什么感觉| 脖子上长痘痘什么原因| 没有润滑油用什么代替| 为什么得带状疱疹| 急性胰腺炎是什么病| 尿比重偏高是什么原因| 书的五行属性是什么| 香奶奶是什么牌子| e代表什么| 心肌缺血吃什么补得快| 脸上长黑斑是什么原因引起的| 吃什么可以去湿气| 半什么半什么| 世界大同是什么意思| 海柳什么颜色最贵的| 早上起来心慌是什么原因| 扬长避短什么意思| 乳腺纤维瘤有什么症状表现| 水疱疹什么药最快能治好| 1959年属什么生肖| 1953年属蛇的是什么命| 暖心向阳是什么意思| 媚骨是什么意思| 什么歌最好听| 海南属于什么气候| 吃什么才能提高免疫力| 减脂喝什么茶最有效| 梦见大象是什么预兆| 口加大是什么字| 糜烂性胃炎有什么症状| 出库是什么意思| 10.17是什么星座| 没有白带是什么原因| 什么叫湿气| 玛咖是什么| 同字五行属什么| 什么粉一沾就痒还看不出来| 什么是桥本病| 相得益彰什么意思| 螳螂捕蝉什么意思| 撒西不理是什么意思| 白带有点黄是什么原因| 举世无双什么意思| 什么叫阴阳水| 茔是什么意思| 用什么泡脚可以活血化瘀疏通经络| 日本为什么要侵略中国| 晚上看见蛇有什么预兆| 胆毒是什么原因引起的| 什么东西护肝养肝| 供给侧改革什么意思| 久坐脚肿是什么原因| 袢是什么意思| 干细胞是什么| 盆腔积液是什么原因引起的| 来月经前头痛什么原因| 塑料水杯什么材质好| 气虚吃什么药| 今天过生日是什么星座| 肌肉疼是什么原因| 汾酒属于什么香型| 狐狸的尾巴有什么作用| 彩虹是什么形状| 大队书记是什么级别| 子宫切除后要注意什么| 现在买什么股票好| 梦见自己搬家是什么意思| 百合和什么一起煮可以治失眠| 孩子不好好吃饭是什么原因| 白天尿少晚上尿多什么原因| 左手大拇指麻木是什么原因| 抖腿是什么毛病| 女人喝胶原蛋白有什么好处| 什么的荷花| 为什么来大姨妈会拉肚子| 梦见飞机是什么意思| 82年的拉菲是什么意思| 全身发麻是什么原因引起的| 相顾无言是什么意思| 吃菌子不能吃什么| 口苦口干吃什么药好| 付之东流是什么意思| 黑话是什么意思| 荟字五行属什么| 为什么光吃不拉大便| 什么人容易得老年痴呆| 心脏病吃什么食物好| pd1是什么意思| 产后为什么脸部松弛| 类风湿因子高说明什么| 咳出痰带血是什么原因| 64属什么| 鱼加它是什么字| 杜甫是什么朝代的| 精子发黄是什么原因| 金牛男喜欢什么样的女生| 结肠炎不能吃什么食物| 吃一个海参相当于吃了什么| 牛大力是什么| 充电玩手机有什么危害| 嘛哩嘛哩哄是什么意思| 李登辉是什么人| 前列腺钙化是什么原因引起的| 椰子不能和什么一起吃| 雪茄为什么不过肺| 大腿抽筋是什么原因引起的| 高丽参和红参有什么区别| 龙的五行属性是什么| 宝宝dha什么时候吃最好| 手指关节痛是什么原因| 5月8号是什么星座| 妊娠纹长什么样| 考试前吃什么提神醒脑| 满月送什么礼物好| 掉马是什么意思| 什么忙什么乱| alt医学上是什么意思| 身上痒是什么情况| 抗链球菌溶血素o偏高是什么原因| 6月22是什么星座| 乙肝看什么科| 社保缴纳基数是什么意思| 扑朔迷离什么意思| 什么样的人容易得结石| 肺火吃什么中成药| 嘴巴里苦是什么原因| 红细胞分布宽度偏高是什么意思| 男性吃什么增强性功能| 象牙塔比喻什么| 为什么会想吐| p2是什么意思| 吃什么能提高免疫力| 低压低吃什么药| 咖啡有什么好处| 经常催吐有什么危害| 玻璃体混浊用什么药| ifashion是什么意思| 麻烦的意思是什么| 鹅喜欢吃什么草| gdp是什么意思啊| 眼压高用什么眼药水| 手指关节发黑是什么原因| 周瑜是一个什么样的人| 花生碎能做什么食物吃| 磷脂是什么东西| 妈祖是什么意思| 强直性脊柱炎什么症状| 冰岛说什么语言| 什么是211大学| 售馨是什么意思| 做美甲师容易得什么病| 双肾钙化灶是什么意思| 大钱疮抹什么药膏好使| 七一是什么节| 什么app可以买烟| 百度
工业控制 | 能源技术 | 汽车电子 | 通信网络 | 安防监控 | 智能电网 | 移动手持 | 无线技术 | 家用电器 | 数字广播 | 消费电子 | 应用软件 | 其他方案

电路设计->微机单片机电路图->单片机制作电路图->SST89C58电子盘电路及代码

地产中介责任不可推卸 监管加码加速行业洗牌

发布人:dolphin 时间:2025-08-05 收藏

百度 不久之前,马来西亚的“华四代”李政威如愿以偿。

Reference design for SST ATA-Disk Chip into 8051 microcontroller

Application note

Abstract: this application note introduces the hardware and firmware of reference design for SST ATA-Disk Chip SST58SD/LDxxx into SST FlashFlex51 SST89C54/58 (8051 compatible microcontroller).

1.Hardware connections:

Please reference to attached schematic diagram for hardware connections.

SST ATA-Disk Chip (ADC) SST58SD/LDxxx only supports one working mode, ie. ATA/IDE mode, all control signals are connected based on Table 2-8, Page 14 on datasheet. After executed Set Feature Command to enable 8-bit data transfers, all higher 8 bit data bus ( D8-D15) are don’t care and can be No Connect. RESET# (pin1) is optional, it can be tied up to Vcc if not used. After power-up, ADC will automatically be reset internally, it doesn’t need external reset input. But it’s a good practice to connect RESET# to one of I/O pins such as P1.4, in case ADC is out of control for any unknown reasons, host MCU has capability to reset ADC. DASP# is connected to an emitting diode through a resistor to Vcc, LED provides user a visibility of ADC’s internal operation. When ADC is active busy on operation, LED will be on. Please be noted that master/slave selection at CSEL pin won’t take effect until Next reset, in other words, if you change the jumper setting of master/slave selection, you MUST reset ADC once.

Ifyour application system expands any other I/O or data memory, please modify the reference design: (1)change CS3FX# to Vcc, (2)connect the output of address decoder to CS1FX#.When both CS1FX#and CS3FX# are high,ADC is de-selected and be standby state, all data bus are in high-z. When CS1FX# is low, ADC is selected and be operational. So CS1FX# acts as Chip Select (/CS) in most common peripherals.

2.Firmware design guide:

It’s important to know that ATA/IDE standard doesn’t permit access only one byte at a time to its media such as HDD or ADC, firmware must read or write data sector by sector, 1 sector has 512 bytes of data,system design engineer must design data buffer to support random access to ADC. Reference design uses the secondary block (4Kbytes x 8bit) of on-chip flash in SST89C54/58 as data buffer.

After power-up or external reset, ADC is default to be 16-bit operation. As SST89C54/58 is 8-bit MCU, firmware must enable 8-bit operation by Set Features Command, please reference to page 32 on datasheet.

If ADC is set as Slave, other than Master, you need to change the bit4 in Drive/Head Register to be 1 when writing Command to ADC, see page 17 on datasheet.

After power-on or reset,ADC will be ready to read / write operation after 200ms (typical), 500ms (maximum), see page 1 under Start Up Time in Features on datasheet.

3.Conclusion:

It’s easy to modify this reference design to any other embedded controllers as long as you follow above design guidelines.

4.Schematic diagram:

5.8051 Source code:

; all commands supported by ADC.

ChkPwrEqu0E5h; 98h

DiagnosticEqu90h

FormatEqu50h

IdentifyEqu0ECh

IdleEqu0E3h; 97h

IdleImmEqu0E1h; 95h

InitializeEqu91h

ReadBufEqu0E4h

ReadLongEqu22h; 23h

ReadMultiEqu0C4h

ReadSctrEqu20h; 21h

ReadVerifyEqu40h; 41h

RecalibrateEqu10h; 1xh

SeekEqu70h; 7xh

SetFeatureEqu0EFh

SetMultiEqu0C6h

SleepEqu0E6h; 99h

StandbyEqu0E2h; 96h

StandbyImmEqu0E0h; 94h

WriteBufEqu0E8h

WriteLongEqu32h; 33h

WriteMultiEqu0C5h

WriteSctrEqu30h; 31h

WriteVerifyEqu3Ch

;=============================================================

; ADC Drive Register Set definitions

Data_RegEqu8000h; Data Register for read / write

Error_RegEqu8001h; Error Register, read only

FeaturesEqu8001h; features Register, write only

Sectr_CntEqu8002h; Sector Count Register ( R / W )

Sectr_NoEqu8003h; Sector Number Register, or LBA0:7 ( R / W )

Cylinder_LowEqu8004h; Cylinder Low Register or LBA8:15 ( R / W )

Cylinder_HiEqu8005h; Cylinder High Register or LBA16:23 ( R / W )

Drv_HeadEqu8006h; Drive Head Register ( R / W )

StatusEqu8007h; Status Register, read only

CommandEqu8007h; Command Register, write only

Alt_StatusEqu4006h; Alternate Status Register, read only,

; reading Alt_Status doesn't clear interrupt pending flag. Not used in this demo.

Device_CtrlEqu4006h; Device Control Register, write only. Not used in this demo.

Drive_AddrsEqu4007h; Drive Address Register, read only. Not used in this demo.

;=================================================================

; SST FlashFlex51 microcontroller related SFR's definition

SFCFDATA0B1H; SuperFlash Configuration

SFCMDATA0B2H; SuperFlash Command

SFALDATA0B3H; SuperFlash Address Low

SFAHDATA0B4H; SuperFlash Address High

SFDTDATA0B5H; SuperFlash Data

SFSTDATA0B6H; SuperFlash Status

WDTCDATA0C0H; Watchdog Timer Control

WDTDDATA86H; Watchdog Timer Data/Reload

;=================================================================

; constantdefinition

FlashAddrsEqu0F800h; start address to store data from ADC

;===========================================

org0000h

ljmpstart

org0100h

start:clrP1.4; reset ADC

nop

nop

nop

nop

setbP1.4

movr4, #5; delay 0.5 second

loadr5:movr5, #200; delay 0.1 second

loadr6:movr6, #250; delay 0.5ms for 12MHz crystal

djnzr6, $

djnzr5, loadr6

djnzr4, loadr5

acallEnable8bit; First of all, enable 8 bits operation!

;========================================

orlSFCF,#40h; IAPEN=1

movSFAH,#high(FlashAddrs)

movSFAL,#low(FlashAddrs)

movB,#8; erase 8 sectors (512 bytes)

;========================================

erase:movSFCM,#0Bh; sector erase!

acallDone?

mova,SFAL

adda,#64;64 bytes / sector in Block 1 of SST89C54/58

movSFAL, a

mova,SFAH

addca,#0

movSFAH, a

djnzB,erase

anlSFCF,#0BFh; disable IAP

;========================================

main:acall Write_Sctr

acall Read_Sctr

acall Compare

jbF0, fail

clrP1.4; indicates successful operations.

setbP1.5

sjmp$

fail:clrP1.5; flags failed comaprison.

setbP1.4

sjmp$

;========================================

Function:acallBusy

movdptr, #Sectr_Cnt

mova, R2; R2 is Sector Count

movx @dptr, a

movdptr, #Sectr_No

mova, R3; R3 contains LBA0:7

movx @dptr, a

movdptr, #Cylinder_Low

mova, R4; R4 contains LBA8:15

movx @dptr, a

movdptr, #Cylinder_Hi

mova, R5; R5 contains LBA16:23

movx @dptr, a

movdptr, #Drv_Head

mova, R6; R6 contains LBA24:27

anla,#00001111b

orla,#11100000b; bit4=0 as MASTER-p.htm" target="_blank" title="MASTER货源和PDF资料">MASTER, 1 as Slave; bit6=1, enable LBA.

movx @dptr, a

movdptr, #command

mova, R7; R7 is command code.

movx @dptr, a

ret

;========================================

Busy:movdptr, #status

movx a, @dptr

jbacc.7, Busy

jbacc.0, errors

;jnbacc.6, Busy

clra; acc=0 when successful

clrC; C=0, ADC is not busy (BUSY=0) and no error (ERR=0)

ret; and is ready to accept commands (RDY=1)

errors:movdptr, #Error_Reg

movx a, @dptr

setb C; C=1 flags error codes contained in ACC register

ret

;========================================

WaitDRQ:movdptr, #status

movx a, @dptr

jbacc.7,WaitDRQ; if BUSY=1, then WaitDRQ

jnbacc.3, WaitDRQ; if DRQ=0, then WaitDRQ

jbacc.0,errors; if ERR=1, then read errors code and set flag C

;jnbacc.6, WaitDRQ

clra

clrC; C=0, ADC is BUSY=0, DRQ=1, ERR=0.

ret

;========================================

Done?:mova, SFST

jbacc.2,Done?

ret

;========================================

Enable8bit:acall Busy

movdptr, #Features

mova,#01h; enable 8 bit data transfer

movx@dptr, a

movdptr, #Drv_Head

mova,#11100000b; bit4=0 as MASTER-p.htm" target="_blank" title="MASTER货源和PDF资料">MASTER, 1 as Slave ; bit6=1, enable LBA

movx@dptr, a

movdptr, #COMMAND

mova,#SetFeature; #0EFh

movx@dptr, a

ret

;========================================

Write_Sctr:movR2,#1; write 1 sector at a time.

movR3,#0Ah; suppose LBA to be 000000Ah

movR4,#0

movR5,#0

movR6,#0

movR7,#WriteSctr

acallFunction

acallWaitDRQ

acallWrite512

ret

;========================================

Write512:movR0,#high(message) ; get the higher address of message

movR1,#low(message); get the lower address of message

movR7,#2; 512 bytes = 2 * 256

movB,#0

write:movdph,R0; get the address

movdpl,R1

clra

movca,@a dptr; get the data in message

incdptr; point to next byte in message

movR0,dph; save the address

movR1,dpl

movDPTR, #Data_Reg; point to ADC

movx@dptr, a; write 1 byte data into ADC

djnzB,write

djnzR7, write; write all 512 bytes to ADC

ret

;========================================

Read_Sctr:movR2,#1; read 1 sector at a time.

movR3,#0Ah; suppose LBA to be 000000Ah

movR4,#0

movR5,#0

movR6,#0

movR7,#ReadSctr

acallFunction

acallWaitDRQ

acallRead512

ret

;========================================

; read 1 sector of 512 bytes data and write into flash on chip of SST FlashFlex51 MCU

Read512:movR7,#2; 512 bytes = 2 * 256

movB,#0

movdptr,#Data_Reg

movSFAH, #high(FlashAddrs)

movSFAL, #low(FlashAddrs)

orlSFCF, #40h; set IAPEN=1 to enable IAP

read:movxa,@dptr; read 1 byte data from ADC

movSFDT, a; program into on-chip flash

movSFCM, #0Eh; issue Byte-Program command

acallDone?; wait until done

mova,SFAL; adjust the address of flash

adda,#1

movSFAL, a

mova,SFAH

addca,#0

movSFAH, a

djnzB,read

djnzR7, read

anlSFCF, #0BFh; disable IAP

ret

;========================================

Compare:movdptr,#message;point to message

movSFAH,#high(FlashAddrs)

movSFAL,#low(FlashAddrs)

orlSFCF, #40h; IAPEN=1

clrF0

movR7,#2

movB,#0

verify:clra

movca,@a dptr; getoriginal data in message

incdptr

movSFCM, #0Ch; issue BYTE-VERIFY command

nop

xrla, SFDT; SFDT contains datain flash, these data come from ADC

jzskip

setbF0; set flag F0 (PSW.5) if any discrepancy.

skip:mova,SFAL; increase the address of flash

adda,#1

movSFAL, a

mova,SFAH

addca,#0

movSFAH, a

djnzB,verify

djnzR7, verify

anlSFCF, #0BFh; disable IAP

ret

;========================================================================

message:DB"This demo program demonstrates how easy to design "

DB"SST ATA-Disk Chip into SST FlashFlex51 embedded microcontroller. "

DB"After you understand how to use the basic WriteSector and ReadSector "

DB"functions, it's easy to try any others."

DB"The hardware connection between ADC and MCU is also very simple,"

DB"just like you expand any I/O or data memory in your application system. "

DB"After power-on, ADC is default to be 16 bit operation as all EIDE "

DB"standards, firmware needs enable 8 bit operation before "

DB"further write / read operation."

end


关键词: SST89C58 电子 代码

评论

技术专区

裤裙搭配什么上衣好看 野生刺猬吃什么 你会不会突然的出现是什么歌 菠萝蜜什么时候成熟 酸梅汤不适合什么人喝
附件炎是什么引起的 失眠是什么 国家发改委主任什么级别 手掌发麻是什么原因 女人右手中指有痣代表什么
1990年属马的是什么命 振水音阳性提示什么 淋雨了喝什么驱寒 为什么老是肚子疼 合肥古代叫什么
蚕屎做枕头有什么好处 吃什么能解决便秘 什么东西不能吃 海马是什么类动物 甲状腺有什么反应
四月四号什么星座hcv9jop0ns3r.cn 百合和什么一起煮可以治失眠xscnpatent.com 卒中中心是干什么的hcv7jop6ns9r.cn 孔子孟子什么关系luyiluode.com 经常口腔溃疡是什么原因hcv9jop7ns0r.cn
血小板压积偏低是什么原因hcv9jop4ns7r.cn 油菜花什么颜色jasonfriends.com 恭敬地看的词语是什么hcv8jop5ns8r.cn 文殊菩萨是保佑什么的hcv8jop3ns3r.cn 荷尔蒙是什么hcv9jop6ns7r.cn
骨头属于什么垃圾hcv7jop4ns8r.cn 阑尾炎是什么hcv7jop6ns2r.cn 白细胞偏高是什么意思hcv8jop2ns4r.cn 蜈蚣咬了用什么药hcv8jop3ns2r.cn 注会什么时候考试fenrenren.com
仟字五行属什么hcv8jop5ns3r.cn 等回声结节是什么意思hcv8jop6ns7r.cn 91年什么命hcv9jop0ns2r.cn 瑜伽垫什么材质的好hanqikai.com 拔罐有什么好处和坏处hcv7jop4ns5r.cn
百度