6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 5:48 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Nov 12, 2013 9:14 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 3:13 pm
Posts: 67
This may be me, but i think build a project (with an MPU) that flashes LED's is pretty useless. My reason for believing so is that this can be accomplished with a 555 timer, or some chip from radio shack. You really don't learn much assembly.

_________________
JMP $FFD2


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 12, 2013 9:33 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Having learned how to use a 555, a person is then in a position to use it as part of a larger, more ambitious project.

The same applies to the simple assembly-language loop. In both cases we're dealing with building blocks -- elements that, once mastered, can then be used as part of a greater whole.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 12, 2013 10:31 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
When migrating to a new and different microcontroller,
and you are not absolutely sure about how to set
all those fuse/configuration Bits,
a simple application like a blinking LED
probably is the best way for getting started.

Because then you know, how to configurate
and to initialize that microcontroller
for running more complicated code later.


When debugging more complicated code on microcontrollers,
blinking LEDs could turn out to be very useful...
for getting a clue about when and where your code crashed,
for instance.
http://wilsonminesco.com/6502primer/debug.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 12, 2013 10:38 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8509
Location: Midwestern USA
James_Parsons wrote:
This may be me, but i think build a project (with an MPU) that flashes LED's is pretty useless. My reason for believing so is that this can be accomplished with a 555 timer, or some chip from radio shack. You really don't learn much assembly.

A project is useless only if:

  1. It doesn't do anything, AND...
  2. You can't learn anything from building it, AND...
  3. Your mind is closed to learning the basics.

Even something as lowly as getting an MPU to blink some LEDs or make squawks come from a piezoelectric transducer can be useful. If nothing else, you learn how to assemble circuitry and figure it out when the LEDs don't blink, the transducer doesn't squawk or fragrant smoke wafts forth when power is applied. As Jeff said, the basics become the bricks and mortar from which you can build your computer house. Everyone of us started at the flashing LED/squawking transducer level and progressed at varying rates from that point.

At the risk of severely mixing up metaphors, perhaps using an MPU to flash LEDs or make irritating noises would be like the Navy sending out a battleship to sink a rowboat. Despite the seemingly uselessness of the mission, not to mention the gross overkill, the sailors still get some training and practice in how to handle the ship, aim the guns and hit a moving target.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 12, 2013 11:10 pm 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
I agree with BDD and Dr Jefyll.

It's funny how many times I revert to flashing LEDs on a card when trying to bring up a complex design. After 30+ years in electronics I kick myself every time that I forget put an LED for power status and at least one for blinking by SW/HW.

_________________
Michael A.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 12, 2013 11:45 pm 
Offline

Joined: Sun Jul 28, 2013 12:59 am
Posts: 235
I'll just chime in with an agreement as well. A blinking LED is the "Hello, World!" program of the hardware world. If I didn't have a logic analyzer, I'd be hooking up an LED to address pins and writing a test program to control its blink rate, because that tells me that at least my CPU and ROM are on speaking terms. A couple more LEDs (or some careful programming) and I could send a short message (no more than 8 bits, really), which would be useful for diagnosing any problems setting up RAM or a UART, and so it goes.

Of course, a 6502 plus ROM plus RAM plus a UART isn't really that useful until you add more I/O, but don't knock the humble LED... And don't forget to put one each on the UART RxD and TxD pins (had to simulate this for a USB modem, which didn't have real RxD or TxD lines, once).


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 13, 2013 12:39 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
As I said in the debugging page of the 6502 primer, I'm not really fond of LEDs as the initial debug tool, because an LED's on/off behavior can be a random result of a crash or accidentally writing to the wrong port at some unknown place in the code. OTOH, a beep produced by software tends to be a better indicator because the software is controlling the frequency and duration to be something recognizable that you intended, to indicate arrival at different parts of a program. It assures you that for the duration of the beep, the processor is in the beep routine, and you know where you called it in your code.

That said, I do use LEDs sometimes, particularly if a beep would slow things down too much, as I do a lot of realtime work; but in that case I put an oscilloscope probe on it, almost nullifying the use of the LED itself.

I normally keep the LED minitester on the RS-232 line. I seldom need it, but it doesn't hurt anything to leave it there.

This of course is all in the context of debugging without expensive equipment. Outside of that, I've used LEDs as status annunciators that were not particularly related to debugging. But just to see a light blink for no purpose is, well, rather puposeless.

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2013 4:21 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
When I design FPGA boards I always place an LED on them. A blinking LED means the board is alive after programming. I blink it in hardware, then I blink it in software to see if the CPU is alive. To me a blinking LED is an old friend, a thing of comfort. Later in development, the LED is always used for some kind of debugging tool.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2013 5:33 pm 
Offline

Joined: Mon Apr 16, 2007 6:04 am
Posts: 155
Location: Auckland, New Zealand
I have a 74HC573 8 bit latch with LEDs attached on my machine with logic so I can address it like an IO port. That's proven to be very valuable in debugging my Orwell machine. You can copy entire memory locations to it and from BASIC I can POKE values to it to make the LEDs light up.

Simon

_________________
My 6502 related blog: http://www.asciimation.co.nz/bb/category/6502-computer


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2013 11:08 pm 
Offline

Joined: Mon Aug 05, 2013 10:43 pm
Posts: 258
Location: Southampton, UK
Simon wrote:
I have a 74HC573 8 bit latch with LEDs attached on my machine with logic so I can address it like an IO port. That's proven to be very valuable in debugging my Orwell machine. You can copy entire memory locations to it and from BASIC I can POKE values to it to make the LEDs light up.


I use exactly the same trickery here. Very useful when I was getting the DUART working. I use it for showing "boot progress" as well.

_________________
8 bit fun and games: https://www.aslak.net/


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 01, 2013 3:53 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1043
Location: near Heidelberg, Germany
Yes, having a blinking LED is always the first sign of life! Love it!

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 55 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: