Author Topic: the CFCARD in the mcf52259evb  (Read 10199 times)

Offline tr111

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
the CFCARD in the mcf52259evb
« on: July 03, 2009, 09:48:55 AM »
     the MQX have given the cpld logic to the CFCARD,how can the utasker to use the CFCARD,I think the CFCARD is about the flexbus using at file system!

//*******************************************************************************************************************************************
  // Minibus CPLD
  // 8-bit Non-Muxed Mode
//*******************************************************************************************************************************************
//Top module

module cpld_8bit(
         address,
         data,
         reset,
         ale,
         rw_b,
         clk,
         oe,
         cf_ce,             //Active low Card select signal
         cf_oe,            //Active low Output enable strobe
         cf_reset,         //Reset the compact flash card
         cf_reg,            //Low during I/O operations,in memory mode used to distinguish betwen common and attribute memory
         cf_we,            //Active low signal used for writing configuration registers
         cf_address,
         cf_data,
         cf_cd
         );
      
      output [10:0] cf_address;
      output [7:0] cf_data;
            
      input [19:0] address;
      input reset;
      input ale;
      input rw_b;
      input clk;
      input oe;
      input [1:0] cf_cd;
      
      output [7:0] data;
      output cf_ce;
      output cf_we;
      output cf_reg;
      output cf_oe;
      output cf_reset;
      
      reg  cf_we;
      reg  cf_ce;
      reg  [7:0] data_reg;
      
// initial settings
initial
   begin
      cf_we = 1;
      cf_ce = 1;
      data_reg  = 8'b10101101; // card is not connected (173 dec)
   end   
      
// connect reset directly
assign cf_reset = ~reset;

// on every cs1 change cf_ce and cf_we generation
always @(ale) begin
   // if active ce1- then connect rw to cf_we signal
   if ((rw_b == 0) && (ale == 0)) begin      //write
      cf_we = 0;
   end else begin                      //read or cs1 was changed to 1
      cf_we = 1;
   end
   cf_ce = ale;
end

// card detection
always @(cf_cd) begin
   if (~cf_cd[0] & ~cf_cd[1]) begin
      data_reg  = 8'b11100101; // card is connected send (229 dec)
   end else begin
      data_reg  = 8'b10101101; // card is not connected (173 dec)
   end   
end

// addr n.13 is used for card detecting
assign data = (~ale & ~oe & address[13])  ? data_reg : 8'bz;

// connect directly oe for (active - zero during read)
assign cf_oe = oe;

// connect first 11 addr bytes directly on output
assign cf_address = address[10:0];

// connect addr bit n.12 directly on reg cf pin
assign cf_reg = address[12];



//Debug signals on J19
assign cf_data[0]=cf_reset;
assign cf_data[1]=cf_oe;
assign cf_data[2]=cf_we;
assign cf_data[3]=cf_ce;
assign cf_data[4]=cf_reg;
assign cf_data[5]=address[12];
assign cf_data[7:6]=2'b11;

endmodule

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: the CFCARD in the mcf52259evb
« Reply #1 on: July 03, 2009, 09:27:50 PM »
Hi

I am sorry that I can't give an exact answer since I have no experience with it.

However I presume that the CPDL is turning the card into an easy memory mapped device for the MiniFlexBus. It would probably be possible to use this with the uFileSystem (once any read/write interfaces are adapted as required) but I think that - due to its large size - it is better to use a FAT to work with it.

In the second half of the year (although not this month just yet) the project will turn its attention to some support for large file system (for SD card, mass storage, etc.) and then such an interface may also be interesting to look at.

Regards

Mark

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: the CFCARD in the mcf52259evb
« Reply #2 on: August 09, 2009, 06:50:24 PM »
Hi Mark,
 Do you recon you will have SD memory card filesystem within utasker this year?  And will it be the same as file system currently used in flash memory?

Rgrds
Neil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: the CFCARD in the mcf52259evb
« Reply #3 on: August 09, 2009, 08:30:25 PM »
Hi Neil

I certainly hope that there will be such support this year - I am just about ready to start some serious work on it, although I am not exactly sure of the order of things just yet.

Probably it also makes sense to test the hardware interface with the existing uFileSystem since there is no reason why it can't be used together with it (the uFileSystem's limit on the number of files may be a limitation with such large storage space available but this doesn't mean that it will always be inappropriate). Therefore I would also suggest that a system which doesn't need FAT compatibility would be quite efficient to get running. The same is probably valid for mass storage on a USB stick, which is also an important goal.

Regards

Mark

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: the CFCARD in the mcf52259evb
« Reply #4 on: August 09, 2009, 08:51:07 PM »
Hi Mark,
  That sounds great. I dont need FAT file system, the uFileSystem is excellent for my project. Maybe the hard bit would be working out the size of files, as the size of SD Card varies. I am using 1GB card, but, simply reading/writing to a page at a time,no file system at all.

I look forward for this :)

Rgrds
Neil

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: the CFCARD in the mcf52259evb
« Reply #5 on: August 16, 2009, 12:39:08 PM »
Hi Mark,
  When you have support for the SD card (I would only use uFileSystem), would it be possible to have the option to update firmware from this?

Rgrds
Nei;

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: the CFCARD in the mcf52259evb
« Reply #6 on: August 16, 2009, 01:14:01 PM »
Hi Neil

I believe that SD cards are very similar to SPI FLASH and so the boot loader would just need to be configured for SPI FLASH (with some possible driver adaptions). It should then be able to copy any new firmware on the card to its program memory.

Regards

Mark


Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: the CFCARD in the mcf52259evb
« Reply #7 on: August 16, 2009, 02:40:27 PM »
Hi Mark,
  Thats excellent.  Seeing that it is similar to the spi flash, will be long until the ufilesystem feature is available  ;?

Regards
Neil