Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 27, 2024, 06:55:48 18:55


Login with username, password and session length


Pages: [1]
Print
Author Topic: How to interface PIC with sst memory (JEDEC standard)?  (Read 4569 times)
0 Members and 1 Guest are viewing this topic.
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« on: November 21, 2007, 07:03:23 19:03 »

Hi all,
somebody has some C code library for interface a PIC with an sst memory that works with Jedec standard like 39SF020 memory?

Thanks a lot Wink
« Last Edit: November 22, 2007, 06:36:21 06:36 by Kova » Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #1 on: November 22, 2007, 06:48:26 06:48 »

You are use this Memory Programm or for Fixdata? What Controller you are using ? 

The better solution for Datastorage ist a 16-Bit 24FJ-Controller with Parallel Master Port or
you can also use a PIC18F with external Memory Bus, for Memory over 64 kByte you must
use extra Portpins to select the upper memory (Bankswitching).

C-Code is easy i can send a code-snipped at weekend or you can search the web. Take
a look at the Microchip-Homepage fore more Info.

Greetings, Prommer
Logged
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« Reply #2 on: November 22, 2007, 03:39:11 15:39 »

you can also use a PIC18F with external Memory Bus, for Memory over 64 kByte you must
use extra Portpins to select the upper memory (Bankswitching).

I Prommer,
thanks for the answer.
Then I haven't choose yet the pic but I can use the 18F2550 or 18F4550.

The sst memory is the 39SF020A version--->2Mbit (256KB).
It has the A0-A17 for the address (I can use 18 pins of PIC otherwise I can command it with two 4015 IC).
8 pins for the A0-A7 data IN/OUT and others 3 pins for OE,WE, CE.
Right?

I'm at the begin of the project Smiley
I'm waiting for the code Smiley
Thanks a lot bye Wink
« Last Edit: November 22, 2007, 04:08:33 16:08 by Kova » Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #3 on: November 24, 2007, 06:23:46 06:23 »

Hi, Kova !

Oh !? You will use an high density flash memory. It is more complex as an EPROM i.e. 27x64.... 27x1024.

I take a look in the Data Sheet of the SST39SF020A. If you wish to use Byteprogramming the controller
must take 4 Adress and 4 Data Cycles (1. Write "0xaa" on Addr. "0x5555", 2. Write "0x55" on Addr. "0x2AAA", 3. Write "0xa0" on Addr. "0x5555", 2. Write "Data" on Addr. "Data Address"). For using with PIC18F4550 you must take a minimum of 12 Programmcycles and waiting for Programming is ready >> ~ 15 us.

I think the better solution for the use in an PIC18F4550 solution is the use of an Serial Dataflash i.e.
Atmel AT45Dx021...81 (5V or with 3V3 Interfacing >> Ub via 2 1N4148, the IO's 5V compliant) Via the SPI. Interface the interfacing is easier and you have better write performance. Byte Streaming is also avaiable.
AT45DBxxxx PIC-Code ist ready to use and you can find in the web. I'm using this Dataflash for Audiostreaming with 22050 Samples per Second. A lot of High Performance Serial Dataflash on the market (SST,......) In my WAV-Player-Solution i'm using an ATmega32 with an AT45DB161 mith 16 MBit.

I will write a Code and will send the code to you at the today afternoon, for using two 74xx373
(Adressmultiplexing) and the correct read write timing. >>> 13 IO Pins using for Parallelflash.

Greeting, Prommer
Logged
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« Reply #4 on: November 24, 2007, 09:09:32 09:09 »

Hi, Kova !
Oh !? You will use an high density flash memory. It is more complex as an EPROM i.e. 27x64.... 27x1024.
I take a look in the Data Sheet of the SST39SF020A. If you wish to use Byteprogramming the controller
must take 4 Adress and 4 Data Cycles (1. Write "0xaa" on Addr. "0x5555", 2. Write "0x55" on Addr. "0x2AAA", 3. Write "0xa0" on Addr. "0x5555", 2. Write "Data" on Addr. "Data Address"). For using with PIC18F4550 you must take a minimum of 12 Programmcycles and waiting for Programming is ready >> ~ 15 us.

Hi Prommer,
I know that the best solution is to use another memory Cheesy
But I must use these memories Sad Sad.

Thanks a lot for your help and for your time Wink

Bye!
Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #5 on: November 24, 2007, 10:27:54 10:27 »

Hi, Kova !

Now is the code ready. The programming, read and erase cyle's how is about in the Data Sheet.
The Simulation in MPLAB is ok. For a better performance i dont know what i can realy to.
Takes you a look at the code and feel free to work with it.

King regards; Prommer

Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #6 on: November 24, 2007, 10:41:05 10:41 »

Hi, Kova !

Sorry no attachement allowed in the forum.
The Link ist http://www.rapidshare.com/files/71905820/ParallelFlash.zip

Greetings, Prommer
Logged
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« Reply #7 on: November 24, 2007, 03:36:57 15:36 »

Oh my god...thanks for the code Prommer!
I test it as soon as possible Smiley

Only some questions:
Which compiler you used?

About the scheme:
PortD is used for Data.
For the Address: have you used the RB3-RB4-RB5 ports with two 74xx373 (or 4015) for the multiplexing, right?
Have you the scheme Smiley?

Thanks another time for your works and for your time!!
Sorry for my bad english!

Bye

P.S. another question  Grin:
I don't understand very well this piece of code:
      
DATAPORT = iWAddr >> 16;
ALEH = 1;
Nop();
ALEH = 0;

DATAPORT = iWAddr >> 8;
ALEM = 1;
Nop();
ALEM = 0;
      
DATAPORT = iWAddr;
ALEL = 1;
Nop();
ALEL = 0;

 Kiss Kiss
« Last Edit: November 24, 2007, 04:38:04 16:38 by Kova » Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #8 on: November 26, 2007, 07:11:52 07:11 »

Hi, Kova !

I'm using MPLAB-C18 for this code. It is ANSI-C Standard and you can port it easy to an another
compiler i.e. Hitech or CCS. In the headerfile you can defenine the ports. I'm using PORTD and PORTB
for this small project and for testing. I using three 74HC373 for Addressmultiplexing. The code ist
a little compacter as mit a use of extra Portpins for A16 and A17.

DATAPORT ist PORTB in the at the define in the headerfile you can use an another complete 8-Bit wide
Port. I'm using allway a headerfile for processorspecific defines. The code is more portable. You must
change only the defines in the headerfiles. It isn't a allacolable code for universal lib's. I have not the
experience for this procedure.

iWaddr ist the long word (32-Bit) Addressvariable and with ">>16" and ">>8" i shift it to the 8-Lower
8-Bit Location (PORTB) >> 16 ist for the HighByte (Bit 24 ... Bit 16) to Bit 7 ... 0, >> 8 ist for MiddleByte
(Bit 15 ... Cool to Bit 7 ... 0. 

ALEH ist Latchpulse for the HighByte 74HC373, ALEM ist Latchpulse for the Middlebyte
74HC373 and ALEL is Latchpulse for the LowByte 74HC373. ALE = Address Latch Enable i.e. MCS51
The NOP's are a little Waitstate for the Pulse to give the Port a little of time to switch. When the test with the
hardware is ok you can delete those lines for a new test.

I can draw the schematic today and can send this snipped to you.

Best regard, Prommer
Logged
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« Reply #9 on: November 29, 2007, 09:50:27 09:50 »

I can draw the schematic today and can send this snipped to you.

Hi Prommer,
I'm waiting for the scheme Tongue
Thanks a lot
Bye
Logged
Prommer
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 55
-Receive: 24


« Reply #10 on: November 29, 2007, 12:25:56 12:25 »

Hi Kova,

sorry for delay !
But now have i the Snipped from the Schematic for you.

Link: http://www.rapidshare.com/files/73086419/Address_and_Dataport.pdf
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC