FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-16-2007, 10:24 AM
kron
Guest
 
Posts: n/a
Default Fighting with Compact Flash

Hi,

I need to implement a fairly simple Compact Flash Interface on a
Spartan 3 400.
The only thing it needs to do is write incoming data on the card,
nothing else.

I want to do this with a simple state machine, and
the rough plan for this looks like this:

1. Check status register (mustn't be busy or request data (bits 7 and
3 = 0))
2. write sector number and LBA address
3. write the "write sector" command
4. write data

I have problems with point 1.
The card works in trueIDE mode.
I wanted to start the whole thing in pio mode 1 to see if it works at
all,
and then find the max. speed for the cards (maybe 4).
Anyway, I follow the timings for trueide mode from the cf paper:

[url=http://img442.imageshack.us/my.php?image=timingsgw1.png]
[/
URL]

I checked the timings with modelsim (they are ok), and also with a
oscilloscope:

[url=http://img459.imageshack.us/my.php?image=osziscanik5.jpg]
[/
URL]

I monitored one of the address-signals to see when the address is
valid, and the iord-signal (low active).
My problem is, that I get bullshit from the registers.
I tried reading different registers, and here are some results
(with a small 16mb card and a big 2gb card):

feature register: 1111 1110 1000 0100 - FE84 - small
feature register: 0100 0000 0100 0000 - 4040 - big
Status register: 1111 1110 1000 0100 - FE84 - small
Status register: 0100 1000 0100 1000 - 4848 - big
LBA1: 0100 0000 0100 0000 - 4040 - big
0100 1000 0100 1000 - 4848 - groß 2nd turning on
LBA1: 1111 1110 1000 0100 - FE84 - small
Sector count: 0100 0000 0100 1000 - 4048 - big
Sector count: 0100 0000 0100 1100 - 404C - 2nd big
Sector count: 0000 0100 0000 0000 - 0400 - big next morning
Sector count: 1111 1110 1000 0100 - FE84 - small

As you can see, I get totally different values, and they don't seem to
make sense.
Here's my slightly cut code for the state machine.
This does only read the status register and show the results on some
led:

http://www.mikrocontroller.net/attachment/25436/CF_SM.vhd

Any help/hint is highly appreciated.

Reply With Quote
  #2 (permalink)  
Old 08-16-2007, 11:00 AM
Antti
Guest
 
Posts: n/a
Default Re: Fighting with Compact Flash

> Any help/hint is highly appreciated.

there is one simple generic hint:

before doing the VHDL statemachine etc, just connect the CF to
Microblaze GPIO and write simple C program that bit bangs the CF, when
that works on your board you know the HW connections are all ok, and
that you know the interface. when that works then proceed with VHDL
implementation

Antti


Reply With Quote
  #3 (permalink)  
Old 08-16-2007, 06:31 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: Fighting with Compact Flash

kron wrote:


> My problem is, that I get bullshit from the registers.


let's have a look at the synthesis warnings:

Warning: Design contains 34 input pin(s) that do not drive logic
Warning: No output dependent on input pin "START
Warning: No output dependent on input pin "RW_N
Warning: No output dependent on input pin "DATA_INPUT[0]
....
Warning: No output dependent on input pin "DATA_INPUT[31]

Consider running a vhdl sim to debug this controller.

-- Mike Treseler
Reply With Quote
  #4 (permalink)  
Old 09-11-2007, 04:01 PM
kron
Guest
 
Posts: n/a
Default Re: Fighting with Compact Flash

This file is part of a bigger design which contains the ins and outs
to the pins.
I did work a lot with modelsim and built the whole timings nicely.
Any other ideas?
I don't have microblaze, so I can't use it.
Can I do sth. with picoblaze?

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing compact flash????????? [email protected] FPGA 5 04-10-2006 01:33 AM
Accessing compact flash????????? [email protected] FPGA 3 04-07-2006 04:21 PM
C H S in a Compact flash [email protected] FPGA 2 04-07-2006 02:43 PM
Accessing compact flash????????? [email protected] FPGA 0 04-07-2006 06:27 AM
WIFI Compact Flash [email protected] FPGA 2 02-17-2006 03:09 AM


All times are GMT +1. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved