一乐电子

一乐电子百科

 找回密码
 请使用微信账号登录和注册会员

QQ登录

只需一步,快速开始

快捷登录

手机号码,快捷登录

搜索
查看: 14274|回复: 0
收起左侧

Compact flash with nios II

[复制链接]
发表于 2008-12-14 21:31 | 显示全部楼层 |阅读模式
Readme - Compact flash monitor/debug demonstration
: A; F% W2 w3 j. mGENERAL DESCRIPTION:" p) y( O  }$ Y' g
This distribution contains hardware and software examples suitable for: [" B% B7 S4 U! U6 D
operation of the the Compact Flash interface (True IDE mode) peripheral
+ r2 |1 A0 k; R4 }, F% Jincluded in the Nios II 5.0 development kit. This peripheral's register " i4 @! N+ r0 O
map is equivalent to the compact flash interface previously posted to the % l# H1 d# p" g$ i. C, O) ]* n" W, z
www.niosforum.com "Tested IP" area by Microtronix.
8 ?7 `- k5 ~+ DHARDWARE EXAMPLE DESIGNS
5 p2 x$ X9 u7 ~0 m; f- p/ nIncluded with this distribution are several hardware example designs " T: y3 [# U9 |: ?7 i' g
illustrating how to connect Compact Flash pins to the I/O exported from2 L, }& ]& h8 h
the peripheral. The examples supplied are pre-built and tested on the
% V: Y! `. I* \' ^8 E+ w4 N! Gfollowing development boards:
  K" j2 e# Z; N% l4 ~9 g6 {) b2 W - Nios Development Board, Cyclone Edition (EP1C20)
9 ]! p1 a0 Y/ R - Nios Development Board, Cyclone II Edition (EP2C35)
% _5 e- B3 K0 {0 r6 X - Nios Development Board, Stratix Edition (EP1S40): i: l' K, k) r* C" ^7 z2 |, ^
- Nios Development Board, Stratix II ES Edition (EP2S60ES)% ?4 P) K' T% b9 r2 E

; n* _: [* x1 Y: x: |4 sFor users of the Nios Development Board, Stratix Edition (EP1S10 or EP1S10ES/ c6 t9 J8 S& [6 j2 ]6 c. U
Altera devices), it is suggested that you start with the EP1S40 example design
  o1 U  J, ~: i) m) Q" ^' y, `and change SOPC Builder board component & Quartus device assignment, and then: {+ L$ E. T1 w+ k
re-compile the design. Do not remove I/O assignments; the I/O assignments for
6 Y" u4 x; z& G' ~. c" L  i, t* T2 Rthese three development boards are identical.
- X4 x# g' w6 F/ a+ |In addition, the the Quartus project setting (.qsf) files included with each of
. P- T2 l9 f; T8 cthe above hardware examples includes pin-assignments for Compact Flash that you
8 M% o9 E" K  U& s' Gmay easily copy to your own custom design that uses Compact Flash.1 V* ?" R" R( B4 N& y9 ?. G0 V. z
Note: Hardware example designs in Nios II 5.0 included these same pin 1 K% @! _1 H! P8 O
assignments in each design.7 r' i; C% n" r* J+ g0 p
SOFTWARE EXAMPLES: A. @& E7 s8 Y- F/ d& e
The software included in this package allows rudimentary IDE access to+ h+ m& g( R4 _, ^6 d
Compact Flash, including debug routines, hot-swap capability, and , N& M' }: [; g+ p/ |
the ability to read/write compact flash in either LBA or CHS addressing3 Q- i: A4 j' o
modes. No file system support is provided, though this example would 2 E9 s! F7 u- i
serve as a fine starting-point for a higher-level file-system interface.) |- s! y7 r- \
Additional software support for the Compact Flash interface is included- z* |7 A" e5 q1 q, q- @/ v+ f
in the eCOS release for Nios II 5.0, and Micrium MicroC/FS file system,
3 I' o8 U/ J6 r* ~6 Tboth of which have been tested with the Compact Flash interface % S) Y$ l% G8 q+ F0 Z2 m  T
peripheral. These software interfaces do NOT require the software included* `  G1 T) z: N, `
with distribution, but may be used with the hardware example designs, R2 J/ F) s8 T* @* x: N- d1 ?
included with this distribution.
5 y3 D/ Z9 Q* i  STo build the software example design, open the Nios II IDE, create a new Nios
$ a1 \. e6 M1 {8 a/ S# \$ NII C/C++ application (it is suggested that you start with a template such as 6 i$ T! U+ T2 o9 g; v6 A4 u& o
"Hello World" or "Blank Project"), then, copy the source-files to the newly
* e# Q& H% p+ k$ \( L: ncreated project directory and "refresh" the project contents in the IDE (F5).) J0 \' d% D0 ]2 l
Following this, you may build the application. The main() routine is located8 G! _2 o+ `! @- P, V: i
in file cf_test.c
: j! ]3 T" M: F6 z- [4 ^8 `Note: If you start with hello world, be sure to remove hello_world.c to prevent
5 k! w. a, A8 W4 N) n$ K) fconflicts during compilation.
! L9 A2 s7 f5 ?0 W; uREQUIREMENTS:& ~2 p2 h5 g' u- k6 N$ a
The example software requires an altera_avalon_cf peripheral named "cf" 1 F* ~6 ^8 X  j. r5 P
instantiated in your SOPC Builder design. In addition, the default LCD
0 n5 y1 W0 P9 C! x2 Zinterface that is included in "standard" and "full_featured" Nios II example ! v" U9 T1 t* h
designs may not be used, as it shares pins with the compact flash socket. ' M% x! m5 B5 o6 W! i7 ~
The hardware example designs included with this distribution conform to the
' f  x) ^$ X  F; B8 n' s" Yabove requirements.% F; H4 y+ X: i3 J: }
KNOWN ISSUES & WORKAROUNDS:* H- ]& \5 ^$ z
Every effort has been made to make both the Compact Flash interface peripheral) J. |5 F% y, q+ }& b5 f7 p
and software examples perform without flaws. However, certain known issues0 f& R! Y# w0 T7 C- \8 o$ w2 R5 S/ L. j
may prevent Compact Flash card access. / L' [6 U+ _* @2 h0 r: V; V$ ?
The following are relevant excerpts from the Nios II 5.0 errata discussing
9 [$ u, A- C2 ?/ C, |) e9 ^Compact Flash:
8 G. j3 O1 t7 }7 \) e - Intermittent failures while accessing Compact Flash card; Z& V# d5 H/ R: T
; b+ {- a1 B# V9 z6 I
    Nios II 5.0 includes a Compact Flash controller peripheral suitable for
  F. m7 Z- v: T  j    interfacing to Compact Flash cards in True IDE mode on Nios development 2 V. G) E* q/ y
    boards. In order for True IDE mode to operate, Compact Flash cards require 9 k  j4 r$ f: a# g/ w
    that the "ATASEL_N" input be driven to ground during power-up.
6 [# ]/ \. }7 C    The Compact Flash controller peripheral includes a configurable power ) x7 N; ?* g- o2 C1 D+ z' q8 d
    register used to power-cycle Compact Flash cards in Nios II software
: E' p1 d& ^4 _" {  F4 c    through a MOSFET on the Nios development boards. However, in certain 9 H, G# c  b' q$ n$ \
    development boards, power to the Compact Flash card will not be turned
9 z7 c9 L" x, f+ v: o" I/ t    off completely during this power-cycle operation. Because of this, the
% h) r* V7 k; ~7 E1 N5 `6 h    "ATASEL_N" pin may not be sampLED during the power-cycle operation after
1 o" B& Z" W, G3 E    FPGA configuration when this pin is driven to ground. Instead, "ATASEL_N" & I* A( n* v3 h7 @
    may be sampled by the Compact Flash card when power is first applied to ) i, h9 {  K& J! i) D
    the development board, when I/O are not yet driven by the FPGA (before $ q$ M' m* P2 ?6 G/ Y2 [8 G
    FPGA configuration).
& w5 ]1 g! o7 ]/ s. D    Workaround:  If you encounter errors with Compact Flash when using the
5 Q& d% Q0 q. a' e    Nios development boards, please try one of the following workarounds:% Z' S- p/ e) {8 Y8 k% j+ Z
        * Try a different Compact Flash card -- Certain cards are more
& Q6 f4 G& ?" L6 R0 s: i          susceptible to the power-cycling issue than others.3 g* V& \6 M/ t$ E
        * Modify the Nios development board -- This is recommended for 2 c. F# G% ^2 A+ }# J
          users who are familiar and comfortable with board-level ) I7 B; x( [6 |& V! u
          modifications. Disconnect pin 9 (ATASEL_N) on the Compact Flash
6 P# e7 ]; `# [3 z. {. d: j; ?3 x          socket on your Nios Development Board and tie this pin to ground.   E/ T, b. f) d( ?
          Note that the Compact Flash socket uses a staggered numbering on 1 I- I1 h0 A8 `4 \* e) }. K; c
          the pins (starting from pin 1: 1, 26, 2, 27, ...); please refer : ~6 v  w# w8 H; J1 f" j
          to the Compact Flash Association specification for right-angle ( e8 G2 m' Q6 K4 u/ X
          surface-mount connectors for exact specifications on this connector. ' k& J- i: @9 n$ `8 L( d9 _
          Caution: This will permanently enable True-IDE mode operation.
, |  R  e) j  j8 b8 R8 j* w4 o! t - Compact Flash card and LCD screen do not work concurrently
  X$ E* P8 M9 p, |0 z7 i    If there is a Compact Flash card inserted in the development board, the # t4 W! @- \0 e  H  x% G9 Y
    LCD and other devices connected to the PROTO1 header might not work.
; U/ I. C% V' j, V; K3 v    Workaround: Remove the Compact Flash card to ensure proper operation of 9 X2 B3 }' z% w8 U9 g& @
    the PROTO1 header, or vice versa.) G$ q. Z( L' X1 ~5 x+ h+ n
8 n* T9 E5 {3 r" v& U
3 b" I* P" A6 ~, H
在网上找到一个相当不错的CF控制器有兴趣可以研究一下

cf5_0.zip

1.53 MB, 下载次数: 697, 下载积分: 一乐金币 -1

本版积分规则

QQ|一淘宝店|手机版|商店|电子DIY套件|一乐电子 ( 粤ICP备09076165号 ) 公安备案粤公网安备 44522102000183号

GMT+8, 2025-4-28 19:04 , Processed in 0.045766 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表