6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 3:38 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Displays for 6502...
PostPosted: Sun Mar 30, 2014 9:15 am 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Hi guys

What does everyone else use for a display for their 6502 project? I've been fixating on using 7-sgmented LEDs as they're quite simple to set up (enable latching and bob's your uncle).
However, there doesn't seem to be any modern decoders that allow hex to be displayed (0-9 then randon stuff after that). I'm a bit puzzled as to why A-F has been dropped from all of them...?
The reason I wanted the hex version is to (at first) manually edit the RAM. Bit difficult if you on have 0-9 (BCD) displayable!

I've got a horrible feeling that I'll probably end up using a small LCD.


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 11:51 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
I started a summary thread over at viewtopic.php?t=2384 a little over a year ago.

Interesting to hear that hex output isn't widely supported by 7-segment decoders... it seems Maxim have some offerings: http://para.maximintegrated.com/results ... =disp_driv

Is LCD such a bad possibility?


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 2:36 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
BigEd wrote:
Is LCD such a bad possibility?

Not really: I grew up with LED 7 seg displays and I thought it might be easier to set them up and deal with them. I'll take a look at your link, but if you've managed to find one in stock and not costing £20-£30 per IC and not needing some kind of font (eep)rom I'll be impressed as every chip I found which cost between £1-£5 was a BCD only.
What I'm really after is a simple way of inputting 4 binary lines and outputting 0-9 and A-F (i.e. hex).


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 3:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
http://wilsonminesco.com/6502primer/displays.html, a page in the 6502 primer

_________________
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  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 3:49 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
I think the goals addressed by Garth's primer exceed what you have in mind, banedon. But maybe you'd consider setting your sights on alpha-numeric output, as he describes. You'll get more long-term benefit from that.

But for just a digit or two of numeric (including hex) info, there are various approaches you can take. Sounds like what you have in mind is...
  • a latch or flipflop captures the 4-bit binary value from the data bus
  • a decoder/driver IC accepts the 4-bit binary and delivers 7 outputs for the segments
  • the display itself is a simple, inexpensive type with just the LED segments -- no associated circuitry

Although (as noted) off-the-shelf decoder-driver IC's only handle 0-9 (not A-F), a 32 x 8 TTL PROM such as 74S188 makes a good decoder-driver, and you get to define all your own characters! Using only 4 address inputs, it can look up one of 16 bytes describing which segments need to be on. But I suggest you do that lookup in 6502 software instead. IOW, ...

  • your 4-bit value goes in Y (say), and you do an indexed fetch to get one byte from a 16-byte table that you've prepared.
  • you output that byte and it's captured from the data bus by a byte-wide latch or flipflop
  • the flipflop outputs directly drive the inexpensive 7-seg display. IOW, current-limiting resistors only, no decoder IC needed.

-- 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  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 3:59 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
You could program a GAL to be both the latch and LED segment driver.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 4:48 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1747
Location: Sacramento, CA
My COSMAC Elf schematic called for two 9368's. I was shipped two MD4368BE's, which worked great.

My usual IC sources did not yield a good source.

I did a search in Ebay and found some far-east offerings that might be worth investigation.

http://www.ebay.com/itm/170962434701

Hope this helps

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 6:52 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
BitWise wrote:
You could program a GAL to be both the latch and LED segment driver.

I'll have a look into how to program GALs. If this works then it might do the job. I'll also look into using LCDs.


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 7:19 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
The intelligent character LCDs really are a simple, inexpensive method, requiring fewer I/O bits than other methods, and you can get two lines of 16 alphanumeric characters each for $6. Connect it to six bits of a VIA, even sharing some of those lines with other things, and you don't need any other ROM, logic, etc.. It's a complete solution, and takes something like a milliamp of current.

_________________
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  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 7:53 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
banedon, are you perhaps thinking of building some kind of bus monitor for single-stepping, and therefore have no place for software?

Maybe we can, between us, make a standard GAL available?


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 8:01 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Good point. Another way to carry it out would still be to use an intelligent character LCD but use a 40-pin PIC (or other microcontroller), and then you can have all address and data lines plus R/W\, IRQ\, and a few other things, and label them in the LCD. I have working PIC16 code for driving the LCD.

_________________
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  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 9:48 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
BigEd wrote:
banedon, are you perhaps thinking of building some kind of bus monitor for single-stepping, and therefore have no place for software?

Maybe we can, between us, make a standard GAL available?

Yes indeed. I'm currently using a fistfull of LEDs and resistors and it's less than great (and takes a fair amount of room).
Looking into the GAL side of things, it seems I'll need a GAL programmer - which I don't have. My Batronix BX32 programmer doesn't seem to support them. So for now I'm looking around to see if I can find a cheap GAL programmer which will do the job.

Regarding your offer: sounds good - thank you :).


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Sun Mar 30, 2014 10:03 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
What do you think of this one? The only thing is that it seems a cheap...
http://www.ebay.co.uk/itm/USB-universal-programmer-for-EPROM-FLASH-MCU-GAL-PIC-PLCC32-and-PLCC44-Adapter-/121288778512?pt=UK_Computing_Other_Computing_Networking&hash=item1c3d5fe310

This one seems better: http://www.ebay.co.uk/itm/MINI-PRO-USB-TL866A-UNIVERSAL-EEPROM-PROGRAMMER-ISP-ICSP-SPI-MCU-GAL-/121178338817?pt=UK_Computing_Other_Computing_Networking&hash=item1c36cab601


Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Mon Mar 31, 2014 12:28 am 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
I came up with this for a chap several years ago. Would something like this work? I would use a newer (and less expensive) device, perhaps an 18 pin 16F1527 ($1.73) or a 20 pin 16F1507 ($1.53)...

Cheerful regards, Mike

Code:
;******************************************************************
;                                                                 *
;   Filename: Forum 4477 IC v1.asm                                *
;     Author: Mike McLaren, K8LH                                  *
;       Date: 14-Sep-07  (rev 29-Sep-07)                          *
;                                                                 *
;   8-bit Hex to Dual 7-Segment LED Decoder/Driver IC Firmware    *
;                                                                 *
;   Uses a 16F628A with a 4-MHz INTOSC and Eric Gibbs standard    *
;   multiplexed dual-digit common cathode display circuit         *
;                                                                 *
;   Digit 1 (left) inputs are RA7..RA4 (msb..lsb)                 *
;   Digit 2 (right) inputs are RA3..RA0 (msb..lsb)                *
;   Segments A..G connected to RB0..RB6 via 330 ohm resistors     *
;   Common cathodes connect to RB7 via a 2 transistor circuit     *
;                                                                 *
;      MPLab: 7.40    (tabs=8)                                    *
;      MPAsm: 5.03                                                *
;                                                                 *
;******************************************************************

        #include        <p16f628a.inc>
        errorlevel      -302

        radix   dec

  __config  _MCLRE_OFF & _LVP_OFF & _WDT_OFF & _INTOSC_OSC_NOCLKOUT

;
;  variables
;
digsel  equ     0x21       ; digit select bit b7
delayhi equ     0x22       ; DelayCy() subsystem var'

;==================================================================
;  K8LH DelayCy() subsystem macro generates four instructions     =
;==================================================================
        radix   dec
clock   equ     4               ; 4, 8, 12, 16, 20 (MHz), etc.
usecs   equ     clock/4         ; cycles/microsecond multiplier
msecs   equ     clock/4*1000    ; cycles/millisecond multiplier

DelayCy macro   delay           ; 11..327690 cycle range
        movlw   high((delay-11)/5)+1
        movwf   delayhi
        movlw   low ((delay-11)/5)
        call    uDelay-((delay-11)%5)
        endm

;******************************************************************
;  Reset vector                                                   *
;******************************************************************

        org     0x0000
v_reset
        clrf    STATUS          ; force bank 0                    |B0
;
;  // psuedo C code program example
;
;  char segdata [] = { 0b00111111,      // "0"   -|-|F|E|D|C|B|A
;                      0b00000110,      // "1"   -|-|-|-|-|C|B|-
;                      0b01011011,      // "2"   -|G|-|E|D|-|B|A
;                      0b01001111,      // "3"   -|G|-|-|D|C|B|A
;                      0b01100110,      // "4"   -|G|F|-|-|C|B|-
;                      0b01101101,      // "5"   -|G|F|-|D|C|-|A
;                      0b01111101,      // "6"   -|G|F|E|D|C|-|A
;                      0b00000111,      // "7"   -|-|-|-|-|C|B|A
;                      0b01111111,      // "8"   -|G|F|E|D|C|B|A
;                      0b01101111,      // "9"   -|G|F|-|D|C|B|A
;                      0b01110111,      // "A"   -|G|F|E|-|C|B|A
;                      0b01111100,      // "b"   -|G|F|E|D|C|-|-
;                      0b00111001,      // "C"   -|-|F|E|D|-|-|A
;                      0b01011110,      // "d"   -|G|-|E|D|C|B|-
;                      0b01111001,      // "E"   -|G|F|E|D|-|-|A
;                      0b01110001 };    // "F"   -|G|F|E|-|-|-|A
;
;  void Main()
;  { static unsigned char digsel = 0;   // digit select, 0 or 128
;    cmcon = 7;                         // turn comparator off
;    trisa = 255;                       // Port A all inputs
;    trisb = 0;                         // Port B all outputs
;    while(1)                           // loop forever
;    { unsigned char work = porta;      // sample inputs
;      if(digsel)                       // if left (hi) digit
;        work /= 16;                    // use hi nibble, 0..F
;      else                             // otherwise
;        work &= 15;                    // use lo nibble, 0..F
;      work = segdata[work];            // get segment data
;      work |= digsel;                  // pick up digit select bit
;      portb = work;                    // update display
;      DelayMS(8);                      // ~60 Hz refresh rate
;      digsel ^= 128;                   // toggle digit select bit
;    }                                  //
;  }                                    //
;
        movlw   h'07'           ; turn comparator off             |B0
        movwf   CMCON           ; for digital I/O                 |B0
;
;  setup ports and display sub-system variables
;
        bsf     STATUS,RP0      ; bank 1                          |B1
        movlw   h'FF'           ;                                 |B1
        movwf   TRISA           ; make Port A all inputs          |B1
        clrf    TRISB           ; make Port B all outputs         |B1
        bcf     STATUS,RP0      ; bank 0                          |B0
        clrf    digsel          ; init b7 digit select bit        |B0
;
;  isochronous loop (8-mS, 50% duty cycle, 62.5 Hz refresh rate)
;
Display
        swapf   PORTA,W         ; W = hi nybble in b3..b0 bits    |B0
        btfss   digsel,7        ; left digit? yes, skip, else     |B0
        movf    PORTA,W         ; W = lo nybble in b3..b0 bits    |B0
        andlw   b'00001111'     ; mask off upper 4 bits           |B0
        call    SegData         ; get segment data in W           |B0
        iorwf   digsel,W        ; add digit select bit in b7      |B0
        movwf   PORTB           ; display new digit               |B0
        DelayCy(8*msecs-16)     ; 8-msecs minus 16 cycles         |B0
        movlw   b'10000000'     ; mask for digit select bit       |B0
        xorwf   digsel,F        ; toggle b7 digit select bit      |B0
        goto    Display         ; loop forever                    |B0

;******************************************************************
;  Subroutines                                                    *
;******************************************************************

SegData
        addwf   PCL,F           ;                                 |B0
        retlw   b'00111111'     ; "0"   -|-|F|E|D|C|B|A
        retlw   b'00000110'     ; "1"   -|-|-|-|-|C|B|-
        retlw   b'01011011'     ; "2"   -|G|-|E|D|-|B|A
        retlw   b'01001111'     ; "3"   -|G|-|-|D|C|B|A
        retlw   b'01100110'     ; "4"   -|G|F|-|-|C|B|-
        retlw   b'01101101'     ; "5"   -|G|F|-|D|C|-|A
        retlw   b'01111101'     ; "6"   -|G|F|E|D|C|-|A
        retlw   b'00000111'     ; "7"   -|-|-|-|-|C|B|A
        retlw   b'01111111'     ; "8"   -|G|F|E|D|C|B|A
        retlw   b'01101111'     ; "9"   -|G|F|-|D|C|B|A
        retlw   b'01110111'     ; "A"   -|G|F|E|-|C|B|A
        retlw   b'01111100'     ; "b"   -|G|F|E|D|C|-|-
        retlw   b'00111001'     ; "C"   -|-|F|E|D|-|-|A
        retlw   b'01011110'     ; "d"   -|G|-|E|D|C|B|-
        retlw   b'01111001'     ; "E"   -|G|F|E|D|-|-|A
        retlw   b'01110001'     ; "F"   -|G|F|E|-|-|-|A

;******************************************************************
;  K8LH DelayCy() subsystem 16-bit uDelay subroutine              *
;******************************************************************

        nop                     ; entry for (delay-11)%5 == 4     |B0
        nop                     ; entry for (delay-11)%5 == 3     |B0
        nop                     ; entry for (delay-11)%5 == 2     |B0
        nop                     ; entry for (delay-11)%5 == 1     |B0
uDelay  addlw   -1              ; subtract 5 cycle loop time      |B0
        skpc                    ; borrow? no, skip, else          |B0
        decfsz  delayhi,F       ; done?  yes, skip, else          |B0
        goto    uDelay          ; do another loop                 |B0
        return                  ;                                 |B0

;******************************************************************
        end


Attachments:
HexOut v0.png
HexOut v0.png [ 31.12 KiB | Viewed 1261 times ]
Eric's 4477 IC.PNG
Eric's 4477 IC.PNG [ 23.48 KiB | Viewed 1261 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Displays for 6502...
PostPosted: Mon Mar 31, 2014 12:48 am 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
Great idea Michael.

_________________
Michael A.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

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