Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC-NAND flash memory of s1mp3 (not SD or MMC !!!)

Status
Not open for further replies.

loup-garou

New Member
hi,


i'm working in a project in which I'm exploiting IC of s1mp3 mp3 player, this kinfd of mp3 players has a SoC (System On Chip) called ATJ2085 which manage a NAND flash memory (a SAMSUNG k9f2G08U0M, it's not SD or MMC) through parallel links and use the FAT16 as a file system for it. in this project I have to share this memory with the PIC (18F4525) to write, read and display with an LCD -connected to the PIC-the content of the flash memory (songs, texts,etc....), and here I get a big problem cause all application notes and C programms for PIC that I did found in internet were made for SD, MMC cards or CF (Compact Flash) who communicate with the memory for R/W through the SPI bus !!!!


I'll be very grateful to anybody who will give me eany kind of advice, cause I'm turning around for days now without finding any solution.

--------------
useful links:

ATJ2085 brief presentation

**broken link removed**

connexion between the NAND Samsung memory flash and ATJ2085

Memory structure of MMC/SD card
 
I think you are SOL. The 18F4525 does not have an external memory interface so you will have to synthesize one using 8 port pins for a data bus and a couple of more pins for control signals. The ATJ2085 expects to be the bus master and I did not see any pins that would lead me to believe that it will stand for interference from another bus master when it wants to read or write data. That leaves you with the need to construct a robust, simultaneous access, dualport memory. There are not all that many designers on the planet who can pull this off. I hope you are one of them. Of course you could use an actual dualport chip but the size is likely to be way smaller than you might be comfortable with.
 
Papabravo said:
I think you are SOL. The 18F4525 does not have an external memory interface so you will have to synthesize one using 8 port pins for a data bus and a couple of more pins for control signals. The ATJ2085 expects to be the bus master and I did not see any pins that would lead me to believe that it will stand for interference from another bus master when it wants to read or write data. That leaves you with the need to construct a robust, simultaneous access, dualport memory. There are not all that many designers on the planet who can pull this off. I hope you are one of them. Of course you could use an actual dualport chip but the size is likely to be way smaller than you might be comfortable with.

hi,

thank you Papabravo for your help, :)

by the way, do you have any reference in mind ?

also, what do you think about differences in the Memory Driver between SD/MMC and this kind of Flash memory (k9f2G08U0M), would it be basic ?
 
Last edited:
loup-garou said:
hi,

thank you Papabravo for your help, :)

by the way, do you have any reference in mind ?

also, what do you think about differences in the Memory Driver between SD/MMC and this kind of Flash memory (k9f2G08U0M), would it be basic ?
I've never seen the subject of dualport memory design discussed in print. We always just wrote the requirements and did the design. Your ATJ2085 expects a memory interface with a parallel design. You provide an address and a read strobe for reading, or an address, data, and a write strobe for writing. This kind of parallel access has nothing to do with any of the serial or nybble wide interfaces used on the SD/MMC cards. Now the PIC with its synthesized memory bus can afford to be held off with ready/busy signal and that is the way I would start the design.

I would set things up in such a way that the actual memory could run 2 memory cycles for every cycle of the fastest master. That way nobody will ever get held off for more than half a cycle even in burst mode with simultaneous requests.
 
Hi papabravo,

thank you for your reply :) ,


I did not understand all what you recommend me but I'll try to figure out the problem by modifying the low-level code of the Microchip application note ( functions that use SPI) in order to adapt it to the transfer mode of my flash memory (SPI ---> parallell) .

what do you think ?, are there other things to change ?
 
loup-garou said:
what do you think ?, are there other things to change ?

The obvious thing is how are you going to disconnect the existing processor from the memory?, you can't have two outputs joined together trying to address the same memory.
 
Nigel Goodwin said:
The obvious thing is how are you going to disconnect the existing processor from the memory?, you can't have two outputs joined together trying to address the same memory.

hi,


with using 2 buffers (74AC245) switched (enabled) by the PIC.

??
 
I'm trying now the write the low-level C program code for writing/reading in/from the Flash memory.
 

Attachments

  • Samsung Flash Memory.pdf
    598.3 KB · Views: 492
Nigel Goodwin said:
It depends what the device is expecting, at best it's likely to output rubbish.

I'll take a look in the ATJ2085 datasheet, may be I will found something talking about.

thank you for the advice.
 
Nigel Goodwin said:
If the memory is being treated as a kind of disk drive, then obviously it will flag an error if it's not connected.

may be I will face this in simulation, but when reaching this step, how can I simulate the reading/writing in Proteus ISIS since almost all memories that I found in the library are Serial ones ? :confused:
 
loup-garou said:
may be I will face this in simulation, but when reaching this step, how can I simulate the reading/writing in Proteus ISIS since almost all memories that I found in the library are Serial ones ? :confused:

I never use simulators anyway, and how do you propose to simulate the ATJ2085, which is presumably a mask-programmed micro-controller?.
 
Nigel Goodwin said:
I never use simulators anyway, and how do you propose to simulate the ATJ2085, which is presumably a mask-programmed micro-controller?.

So , what do you do to be sure that your C code is functional before programming the PIC ??


firstly,I'll simulate the reading/writing in the flash memory (if I'll find one on the internet with pins configuration below:


8 I/O : bit0-->bit7 of ext. memory data bus.

/CE : ---> Boot up Nand Flash chip enable
/WE: ----> Ext. memory write strobe
/RE : ----> Ext. memory Read strobe
CLE : ----> Command Latch Enable for NAND type Flash
ALE : ----> Adress Latch Enable for NAND type Flash



I'll simulate switching between Buffers without the ATJ2085 connected to one of them.
 
Last edited:
loup-garou said:
So , what do you do to be sure that your C code is functional before programming the PIC ??

Depends, MPLABs PIC simulator is pretty handy. Or I'll prototype the device on a breadboard and run it through the debugger.
 
loup-garou said:
So , what do you do to be sure that your C code is functional before programming the PIC ??

Well I don't use C, I use assembler - but basically you write it more carefully :D

I simply debug at a hardware level, with normal old techniques like LED's fed from a spare pin, or an LCD display, or a serial feed to a PC.
[/QUOTE]
 
Hi,


i'd like to know whether there are some specific functions to use in C compilers (CCS, Hi-Tech,...) when writing or reading in or from a flash memory like that one I'm using (parallell, see pins functions above) cause all those I found in CCS C manual are for designd for EEPROM's with I2C protocol
----> (write_configuration_memory (dataptr, count) , write_eeprom (address, value), write_external_memory( address, dataptr, count ), write_program_eeprom (address, data),write_program_memory( address, dataptr, count )).


enclosed: a reading timing from the datashet of my flash memory. ( violet:commands , blue:adress, orange:data)




thanks in advance
 

Attachments

  • Read operation.JPG
    Read operation.JPG
    41.5 KB · Views: 292
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top