6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 10:20 am

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 55 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: [85.46] Tip of the day
PostPosted: Wed Jan 31, 2001 5:12 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
Do you have any website references to these serial flashparts ?

For Atmel, go to www.atmel.com/atmel/products/prod108.htm and you'll see the different Dataflash parts you can download data sheets on, in three different file types including .pdf for Acrobat Reader.  The AT45DB642 is at the bottom of the list.  That's the 8Mx8 serial flash memory.

Sandisk ( www.sandisk.com ) supposedly has a 64Mx8 serial flash chip now, but I went to their website after seeing an ad for it, and all I can find is a couple of articles about it (TriFlash) plus info on their memory cards and things like that, and how to buy those things.  I E-mailed them twice in the last two weeks asking the same thing, and they have not responded.  I asked about the IC that was advertised, saying I don't want a module, a card, a socket, or any of that—"I want the IC.  Can I get just the IC you advertised?"  I'm still interested, but the fact that they don't get back to customers (or potential customers in this case) in two days or better speaks very, very poorly of a company.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.47] Tip of the day
PostPosted: Wed Jan 31, 2001 5:32 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
Until I read your Tip I really never thought of connecting a crystal directly to the 6502.

My data books don't recommend it for NMOS 6502's, but I never looked into what the reason might be.  I've done it with the CMOS 65c02 though.

Edit: I have a section on clock generation, with diagrams, at http://wilsonminesco.com/6502primer/ClkGen.html.

For a product in the late 80's, we switched an extra resistor in the RC clock circuit in and out with an output bit so that the computer would save battery power running at 200kHz most of the time, and then go to 1MHz temporarily to keep the customer from waiting when it had to do a string of lengthy floating-point calculations.  Another edit: I quit using floating-point years ago for most applications, preferring instead the scaled-integer method described at the beginning of my index page about large look-up tables for hyper-fast math, at http://wilsonminesco.com/16bitMathTables/index.html.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.48] Tip of the day
PostPosted: Thu Feb 01, 2001 4:14 am 
Offline

Joined: Sun Oct 06, 2002 3:46 pm
Posts: 50
I checked out the Atmel parts. They look interesting. What's the avalibility & price of these parts ? Are you using them for DATA storage only ? Or is there some way to use them for Program Code ? Like boot with a small EPROM, & then copy from the Atmel part to RAM & then run from there ? How would you get the prgram into the Atmel part to start with ?
Ted Melton


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.49] Tip of the day
PostPosted: Thu Feb 01, 2001 4:23 am 
Offline

Joined: Sun Oct 06, 2002 3:46 pm
Posts: 50
I agree that will work, but if anyone tries to trouble shoot the board ... ? Isn't this just a way to make reverse engineering more difficult ?:) Just try & disasemble that program. If you're wire wrapping, I don't see a benefit. If you're laying out a PCB, what's 1 or 2 more VIA's :)
Ted Melton


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.50] Tip of the day
PostPosted: Thu Feb 01, 2001 5:16 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
I checked out the Atmel parts. They look interesting. What's the availability & price of these parts ? Are you using them for DATA storage only ? Or is there some way to use them for Program Code ?  Like boot with a small EPROM, & then copy from the Atmel part to RAM & then run from there ? How would you get the program into the Atmel part to start with ?

Edit, 9/1/22:  The 8-megabyte 26VF064 in an 8-pin SOIC package is $3.35 in qty 1.  Obviously the per-megabyte price has come way down.  What's below is what I wrote 21 years ago though:

The 2Mx8 is about $16, available now.  I got some for engineering use (not production quantities yet) from All American.  All American  normally sells to OEMs, but I'm sure there's no reason a hobbyist can't call them up with credit card in hand and order.  Hobbyists just need to make sure they make it quick for these distributors and not take too much of their time for piddly small orders, so that they don't decide not to sell to them.

I'm trying to get a few of the 8Mx8's right now.  Those are not available in production quantities yet, but small quantities for engineering are supposedly being shipped.  (I would call them "engineering samples", but at $35 each, they don't usually send them out free.)

I've made the Atmel 2Mx8 work; and although the data sheet looks pretty complicated, everything worked the first time when I just followed the instructions and timings they give.  There don't seem to be any hidden tricks.  Some of their instructions are for storing.  Storing data is just as easy as reading it, except that it takes a couple of milliseconds so you have to wait for it to get done before you issue another similar command.  They're not like EPROMs which are generally programmed in a programmer and not altered once in the circuit.  Think of the flash more like a disc, except you don't have to have a SCSI port or learn a disc controller.  As far as a FAT or anything like that, you can do it any way you want, so there's no reason for it to be intimidating like it might be to learn how to use a floppy disc drive controller.

The Atmel 8Mx8 looks like it operates the same way, but I can't speak from experience yet.  You can store whatever you want in either of these, and it won't care if it's a section of the phone book or a collection of executable programs (or anything else for that matter).  The flash memory is divided into pages of 528 bytes each for the 2Mx8 and 1056 bytes each for the 8Mx8.  The reason they're a little more than 512 and 1024 bytes per page is that there's some extra to store things like where the next page for the particular file is.  This comes into play because files in flash can get fragmented.  The way to make sure they don't get fragmented when the flash is relatively full and files are constantly getting written, deleted, or modified is to always be moving them around to produce large enough empty spaces to keep a whole file together when you store it.  All this moving around is is not only slow, but will eventually wear out the memory, unlike the case with a big battery-backed SRAM.  I can't find the spec. quickly right now, but I think any given page is good for something in the range of 100,000 to 1M write cycles before it becomes undependable.  If you use a stationary FAT without some sort of wear-leveling method, the FAT area would probably be the first to wear out if your application does a lot of writes.  On the other hand, floppies probably wear out faster, but they're probably more likely to get damaged first.

The Sandisk TriFlash 64Mx8 is $110, or less than $2 per megabyte, but that's the one I haven't been able to get any info out of the company yet on.

Garth

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.51] Tip of the day
PostPosted: Thu Feb 01, 2001 5:27 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Quote:
I agree that will work, but if anyone tries to troubleshoot the board ... ? Isn't this just a way to make reverse engineering more difficult ?:) Just try & disassemble that program. If you're wire wrapping, I don't see a benefit. If you're laying out a PCB, what's 1 or 2 more VIA's :)

I must apologize that I'm not sure what you're responding to here.  If it's Tip #1, it's true that you won't gain much by mixing the address and data lines around if you're wire-wrapping; but for the poor guy who has to lay out the board, whether 2 layers or 12, it might make the difference between fitting it in easily and pulling out his hair.

Maybe I missed it though, since I don't know where the VIAs come in.  Let me know and I'll correct this post.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.52] Tip of the day
PostPosted: Wed Feb 07, 2001 4:48 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
I finally got Sandisk to E-mail me the data sheet for the TriFlash serial flash memories that go up to 64Mx8 in one IC.  The .pdf file (for Acrobat Reader) is 96 pages!  This chip is only available in BGA, would need some level-translation parts to interface with 5V parts, and generally looks rather user-hostile.  I can E-mail the data sheet to anyone interested, but I think the Atmel parts are much more friendly and workable for the majority of the people on this forum.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.53] Tip of the day
PostPosted: Mon Jan 28, 2002 2:30 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
This is following up on 85.48 and 85.50. Digi-Key at
www.digi-key.com
has the Atmel 2Mx8 and 8Mx8 serial DataFlash ICs in stock now, and you can easily buy one at a time if you want.  The AT45DB161B 2Mx8 is about $22 in singles.  The 8Mx8 originally showed up in the catalog for about $45, but when I called to order it, the woman told me $141.  Now the newest catalog I got in the mail also says $141.  I don't know what happened.  It's still cheaper storage than hard discs were in the mid 80's and a whole lot more compact, but it's not worth that much to me.

--> News flash, if anyone is interested:  4/24/02 I received Digi-Key's catalog #T022 in the mail, and the Atmel AT45DB642 8Mx8 serial flash is now under $41 in singles.  I went to their website and confirmed that this lower price is truly in effect.  I guess they figured out that they goofed when they more than tripled the price earlier.  Now I can get a couple to use like tiny hard disc storage for my next workbench computer.
Edit, 9/1/22:  The 8-megabyte 26VF064 in an 8-pin SOIC package is $3.35 in qty 1.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.54] Tip of the day
PostPosted: Mon Jan 28, 2002 5:07 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Tip of the day, #41: Getting started

Many times recently someone new has posted a "Help!" message and say they have an assignment or want to learn the 6502 by doing a project and don't know how to begin.  It has been hard to help them when they can't spell out exactly what they want to do and don't know enough to ask the right questions.

Although this is not the place for a hardware or software beginning tutorial, I can suggest a general development plan to get rid of some of that unsettling feeling of unfamiliarity.  Here's the order you will normally follow on a project:

A. Decide what you want the computer to do, and what I/O, memory, etc. will be needed.

B. Build the necessary hardware.

C. Get the hardware going. (tips #35 and 36)

D. Write routines to set up the I/O.

E. With rudimentary I/O routines working, begin the actual application program.

F. As the program develops, watch for ways you can simplify.

Missing D is probably one of the beginner's biggest road blocks, as he is probably thinking that after the more obvious A and B, you just start working on your application program (E).  Where do you start?  How do you know if anything at all is working?  Intuition itself hints that something is wrong with this idea; but without knowing what, the person is stopped before there's measurable progress.  Even if hardware debugging were unnecessary, the order here is part of the building-block approach.  It comes from lots of experience.

That is not to say there's no room for a top-down approach.  Indeed even in A you start at the top with your dreams—the end goal; but the realization will mostly come about as you build tiny components, get them working, and put them together to make bigger components.  As you move on, you no longer concern yourself with the internal details of the smaller parts.  The process continues until you have the completed system with all its parts quietly doing their jobs.

Previous tips will help at various stages.  Each step above does not necessarily need to be 100% finished before starting the next.  For example, C and D have to be done at least partly concurrently since you will need to write a little bit of code to operate at least some part of the output, minimal as it may be, for verifying the hardware.

As you progress through E, I/O software can be expanded, and you will no doubt also be adding things to the reset routine for initializing variables or other software resources.

F should be started early, soon after E is started.  The beginner may see it as time wasted for the sake of unnecessary neatness; but in the end it will prove invaluable.  F may include use of subroutines, macros, or re-arranging so certain parts become unnecessary and can be eliminated.  It's like factoring things out of an equation to simplify it or reduce it to lowest terms.  Document everything as you go!!  You'll get yourself in trouble if you leave that for last.  By maximizing structure, documentation, and simplicity, you will be able to keep control of the project and maintain it.  Otherwise there will be so many things you don't remember how you did that you can't unravel it to get control back, do updates later, or fix a routine with a bug that didn't show up until long after you wrote it.

I may be editing this depending on others' feedback as well as other things that come to mind.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Last edited by GARTHWILSON on Wed Feb 22, 2012 9:27 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: [85.55] Tip of the day
PostPosted: Sun May 26, 2002 6:11 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
Tip of the day, #42: Ghost interrupts

Tonight I had some puzzling "ghost" interrupts.  My 65c02 workbench computer's Forth interrupt handler was going through the list of installed interrupt-service routines (ISRs) and none of them claimed responsibility to take care of the interrupt.  The error message was "missing ISR".  What's going on?  I wrote and installed an ISR with the lowest possible priority so it would get executed only if the higher-priority ones failed to service the interrupt.  Instead of servicing a mysterious interrupt, this low-priority ISR's job was to look at the status registers and interrupt-enable registers of everything that had the ability to produce an interrupt.  It too said everything was clean.

The project used an interrupt every 20 microseconds (a rate of 50,000 per second) from a 65c22 VIA's timer, and the program running in the foreground turned the interrupting off and on several times per second, producing one-tenth-second bursts of interrupts.  What was happening was that sometimes the VIA would pull the IRQ line down during the instruction that was telling the VIA to disable that interrupt.  The line came down quickly, but the pull-up resistor takes a few clock cycles to get the line back up to a logic 1 again.  (See tip #2.)  The processor responded to the interrupt and took the vector; but by the time the first ISR could check to see if it was this VIA that caused the interrupt, the VIA's interrupt flag register said "None here!"-- like ringing the doorbell and running.

Attachment:
cartoon_5.gif
cartoon_5.gif [ 40.75 KiB | Viewed 3044 times ]

My immediate solution was to make the ISR sequence assume that a "ghost" interrupt like this came from the source that was just disabled.  In other words, for a few microseconds after the interrupt source is disabled, it's ok to exit the ISR sequence without action when no cause of interrupt was found.  Another possibility would be to do SEI, then disable the VIA's interrupt, then do CLI again after a safe amount of time.  After some discussion on the Yahoo 6502 forum, I believe this SEI/CLI method is best.  You may need to save the information as to whether the processor was accepting interrupts right before the SEI, so you don't CLI if it was temporarily inappropriate.  Another method suggested, which I see problems with for certain scenarios, is that the main routine just use a semaphore to tell the ISR to disable the source of the interrupt the next time the interrupt occurs.  This would probably be more useful in true multitasking, which I was not doing.  (Multitasking, by the way, is quite doable in Forth on a 6502, with minimal overhead.)

The fact that the ghost interrupt problem could occur is something simple I should have thought of long ago, but previous projects never had me disabling interrupts several times per second during a fast stream.  The less-than-handful of times it happened, it just seemed like a freak thing that was not repeatable, and it wasn't worth my time to hunt it down.

WDC's VIAs' IRQ outputs are not wire-ORable open-drain outputs, so they may produce less trouble of this kind.

Garth



I will keep improving these existing tips; but for further tips and more info on the ones above, see my 6502 primer.  The "circuit potpourri" page (which I keep adding things to) has so far, including diagrams and links to code to run them:
  • a very basic whole-computer schematic
  • Using the 6522's shift register for tons of output bits
  • Using the 6522's shift register for tons of input bits
  • Using the 6522's shift register for both input and output
  • SS22: Using the 6522's shift register for a link between computers
  • Converting to and from higher-voltage logic
  • driving relays from logic-level signals
  • High-voltage shift registers
  • Interfacing to I²C
  • Interfacing to SPI and Microwire
  • Keypads and keyboards
  • Displays
  • Printers
  • Digital-to-analog (D/A) converters, or DACs
  • Digital potentiometer
  • Analog-to-digital (A/D) converters, or ADCs
  • A note about A/D and D/A jitter (and other performance considerations)
  • Jeff Laughton's circuit tricks, for ultra-fast I/O (single-cycle!), and re-mapping op codes
  • Non-typical power-supply circuits run by the 6522 and digital components
(and I intend to add some analog supporting circuits)

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 55 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: