6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 17, 2024 6:44 am

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Power-eating Bus Monitor
PostPosted: Mon Jul 20, 2015 6:02 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
I'm a little bored and currently awaiting parts for my project, so have been thinking about putting together another bus monitor. There are several possibilities, but the more humurous one that I have come up with is one using 6x GALs (I have plenty of 22V10's) coupled with 6x 7 segment LED displays.
It occurred to me shortly afterward coming up with this that the power usage might be a little steep... Each GAL uses 55mA (typically). So that's 6x55=330mA :mrgreen:.
So I've put together a circuit diagram anyway :) :
Attachment:
power-eating Bus Monitor.png
power-eating Bus Monitor.png [ 88.73 KiB | Viewed 1090 times ]

Just for the heck of it I've added some extra active-low signals (inverted signal to LEDs).

I think I may just stick to using the Atmel 324P AVR idea instead with an LCD module ;).


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 20, 2015 6:11 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
And here's the code for the GALs:

Code:
Name       LEDdriver;
Partno     Lattice22V10B;
Date       19/07/15;
Revision   01;
Designer   shalewyn.com;
Company    shalewyn.com;
Assembly   1;
Location   1;
Device     g22v10;


/*
 * Lattice GAL 22V10B pinout, DIP, top view
 *
 * I/CLK.[ 1     24 ].VCC
 *     I.[ 2     23 ].I/O/Q
 *     I.[ 3     22 ].I/O/Q
 *     I.[ 4     21 ].I/O/Q
 *     I.[ 5     20 ].I/O/Q
 *     I [ 6     19 ].I/O/Q
 *     I [ 7     18 ].I/O/Q
 *     I [ 8     17 ].I/O/Q
 *     I.[ 9     16 ].I/O/Q
 *     I.[ 10    15 ].I/O/Q
 *     I.[ 11    14 ].I/O/Q
 *   GND.[ 12    13 ] I
 *
 */


/* Inputs */

Pin [3..6] = [d0..3];

Pin [9..11] = [i2..0];


/* outputs */

Pin [14..20] = [a,b,c,d,e,f,g];

Pin [21..23] = ![o0..2];

/* Main */

/* Each of these represents segments 'a' to 'g', with each line
   representing the full or partial bit pattern of one or more
   ranges of characters displayable on a 7 segment LED display.
   Those numbers which are missing for a given segment do not
   cause that segment to light when those numbers are displayed.
   Each number (or range) in a given line is represented by
   '!dx' (where x is 0-3) for 0 and 'dx' for 1.
   An example:
   In segment 'a' the line [!d3 & d2 & !d1 & d0] represents 0101
   which is 5 in hex/dec. So what this is saying is that we return
   1 if the bit pattern D0-3 is 0101 (5). Looking at segment 'a', it
   does indeed need to be lit (1) if we want to show the digit '5'.
   Some lines will only have a partial bit pattern. This happens if
   we want to cover a number range and it doesn't allow for the
   segment to be lit by a number which doesn't use it */

a = !d3 & !d2 & !d1 & !d0  /* '0' */
  # !d3 & !d2 & d1         /* '2' and '3' */
  # !d3 & d2 & !d1 & d0    /* '5' */
  # !d3 & d2 & d1          /* '6' and '7' */
  # d3 & !d2 & !d1         /* '8' and '9' */
  # d3 & !d2 & d1 & !d0    /* 'A' */
  # d3 & d2 & !d1 & !d0    /* 'C' */
  # d3 & d2 & d1;          /* 'E' and 'F' */

b = !d3 & !d2              /* '0' to  3' */
  # !d3 & d2 & !d1 & !d0   /* '4' */
  # !d3 & d2 & d1 & d0     /* '7' */
  # d3 & !d2 & !d1         /* '8' and '9' */
  # d3 & !d2 & d1 & !d0    /* 'A' */
  # d3 & d2 & !d1 & d0;    /* 'D' */

c = !d3 & !d2 & !d1        /* '0' and '1' */
  # !d3 & !d2 & d1 & d0    /* '3' */
  # !d3 & d2               /* '4' to '7' */
  # d3 & !d2               /* '8' to 'B' */
  # d3 & d2 & !d1 & d0;    /* 'D' */

d = !d3 & !d2 & !d1 & !d0  /* '0' */
  # !d3 & !d2 & d1         /* '2' and '3' */
  # !d3 & d2 & !d1 & d0    /* '5' */
  # !d3 & d2 & d1 & !d0    /* '6' */
  # d3 & !d2 & !d1         /* '8' and '9' */
  # d3 & !d2 & d1 & d0     /* 'B' */
  # d3 & d2 & !d1          /* 'C' and 'D' */
  # d3 & d2 & d1 & !d0;    /* 'E'*/

e = !d3 & !d2 & !d1 & !d0  /* '0' */
  # !d3 & !d2 & d1 & !d0   /* '2' */
  # !d3 & d2 & d1 & !d0    /* '6' */
  # d3 & !d2 & !d1 & !d0   /* '8' */
  # d3 & !d2 & d1          /* 'A' and 'B' */
  # d3 & d2;               /* 'C' to 'F' */

f = !d3 & !d2 & !d1 & !d0  /* '0' */
  # !d3 & d2 & !d1         /* '4' and '5' */
  # !d3 & d2 & d1 & !d0    /* '6' */
  # d3 & !d2               /* '8' to 'B' */
  # d3 & d2 & !d1 & !d0    /* 'C' */
  # d3 & d2 & d1;          /* 'E' and 'F' */

g = !d3 & !d2 & d1         /* '0' and '1' */
  # !d3 & d2 & !d1         /* '4' and '5' */
  # !d3 & d2 & d1 & !d0    /* '6' */
  # d3 & !d2               /* '8' to 'B' */
  # d3 & d2 & !d1 & d0     /* 'D' */
  # d3 & d2 & d1;          /* 'E' and 'F' */

 
o0 = i0;
o1 = i1;
o2 = i2;


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 20, 2015 6:19 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
I'm tempted to build this anyway... :)


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2015 10:43 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
I've gone and built the above Bus Monitor. Holy cow. It eats 600mA and the GALs get quite warm :mrgreen:.

Here's a few picys:

Connected up to my first 6502 project
Attachment:
BusMonitor_1c.JPG
BusMonitor_1c.JPG [ 852.12 KiB | Viewed 1041 times ]


Copper side of the monitor: dodgy soldering FTW :P
Attachment:
BusMonitor_1b.JPG
BusMonitor_1b.JPG [ 1.08 MiB | Viewed 1041 times ]


My dual power supply. My 6502 project is the left read out, the bus monitor is the right one :D
Attachment:
BusMonitor_1a.JPG
BusMonitor_1a.JPG [ 664.55 KiB | Viewed 1041 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2015 11:22 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
That's crazy but cool. I'm curious. Is there any way to drive two digits per GAL like you might do with a small microcontroller?


Attachments:
Eric's 4477 IC.PNG
Eric's 4477 IC.PNG [ 23.48 KiB | Viewed 1039 times ]


Last edited by Michael on Sat Jul 25, 2015 11:31 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 25, 2015 11:30 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Yep. I reckon you could have one GAL's LED display segment outputs (a-g) into different 74xx245 buffers, connect the /OE lines from each to the GAL and then strobe them. Or, maybe use latches instead of buffers....yeah. So... you feed the bus data into a '245 buffer, feed that into the GAL, then feed the GAL outputs into latches and then strobe the latch update pins. Definitely doable and probably beata the heck out of what I've just created. I think I might try and breadboard it. Just need some more 7 seg LED displays.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 1:09 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
Please forgive all the questions but I'm not familiar with GALs...

Is it possible to drive a two digit multiplexed display directly from the GAL? For example, could you have two 4-bit inputs, one for each digit, and one more input from a clock source like a 555 timer to tell the GAL when to output segment pattern data for one digit or the other? Of course the timer signal would also be used to select the common cathode or common anode driver for each digit.

Since two digit display logic could be programmed into an EPROM (which may not be a practical display driver) would it be possible to do the same with the GAL?

Regards, Mike


Attachments:
7-Seg ROM Driver.png
7-Seg ROM Driver.png [ 16.64 KiB | Viewed 1020 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 6:33 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
You might be able to do this with a PLD (GAL/PAL), although I'd normally look at using a Microcontroller such as a PIC or ATMEGA or pehaps a CPLD. CPLDs are the same as PLDs, but have many more product terms (number of internal gates/combinations that you can use) and normally far more I/O pins than a PLD. If you get a CPLD with a large enough number of pins then you could implement my above project using just the one chip.
With regard to E(E)PROMs: this would also do the job (as you suggest), but they're know to be relatively slow when compared to PLDs (GALs/PALs) and standard 74 series logic. I think that they used to be used for this kidjn of thing back befoe (C)PLDs arrived on the scene.

CPLDs and Microcontrollers use far less power than PLDs (at least from what I can see :)).


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 7:45 pm 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 491
Location: Switzerland
I think a CPLD would be an overkill. The bus monitor requires a lot of input and output signals but only very few product terms. That's the opposite of a CPDL. You really should consider using a PIC or AVR. I would use IO expanders such as the MCP23S13. In fact your bus monitor could be built using a small AVR / PIC with an SPI and three MCP23S13 to read the bits and drive a LCD.

Personally I prefer and use these

Attachment:
File comment: HEX Display with latch and decoder
TIL311.jpg
TIL311.jpg [ 87.07 KiB | Viewed 997 times ]


especially as they contain a transparent latch. So you can either follow the signals or freeze the display. Very simple and only very few wires.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 9:44 pm 
Offline

Joined: Mon Jul 20, 2015 6:34 pm
Posts: 62
You do single step the clock right? Then I agree with cbscpe... Using a few parallel to serial and serial to parallel shift registers would get the job done. And you would get the option to send the output to a computer, store it or say automatically test it comparing with existing values and so on....


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 10:36 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Here's a possibility:
Attachment:
BusMonitor_V2.png
BusMonitor_V2.png [ 122.86 KiB | Viewed 983 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 26, 2015 11:46 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
I wonder if Quinn Dunki realizes how many people have designed bus displays after seeing the 'HexOut' design on her blog (grin). Heck, I've got two or three myself (on paper, grin)...

Certainly, using a PIC or an AVR, or TIL311s as Peter suggested, are probably better alternatives to using a GAL/PAL, CPLD, or ROM, but I really appreciate the effort that went into Banedon's GAL example.

I didn't use a HexOut type display in my early experiments. Instead, I used a PIC to clock the 65C02 and I sampled and reported control and bus signals every half clock cycle via serial connection to a terminal window. Being able to sample signals at 62.5-nS intervals after each clock edge helped me verify timing in the Rockwell Datasheet and was crucial for developing a method to "push" and "pull" data to/from the 65C02 for a "blind loader" function.

Have fun guys. Cheerful regards, Mike


Attachments:
HexOut.png
HexOut.png [ 80.09 KiB | Viewed 980 times ]
HexOut v3.png
HexOut v3.png [ 28.92 KiB | Viewed 980 times ]
HexOut v0.png
HexOut v0.png [ 31.12 KiB | Viewed 980 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 02, 2015 12:13 am 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
BusMonitor version 2 is almost done. It can read both the address and data buses and display the result. I need to add control bus signals and optimise the code a bit, but can definitely be considered to be 'beta' status. The microcontroller is an ATMEGA 324P AVR, fed by '245 buffers which are in turn fed by the off-board 6502 address bus LSB and MSB and the data bus. I've provided a connector so that I can program the AVR in situ via my AVR Dragon (ISP mode).
Here's a picy.
Attachment:
BusMonitorV2a.jpg
BusMonitorV2a.jpg [ 247.24 KiB | Viewed 942 times ]


Once I've properly finished the AVR code I'll post it here.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 02, 2015 6:10 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Here's an updated circuit diagram and the AVR source code (I used an AVR Dragon and Atmel Studio v6.2 to program it).

The power draw is 45-50mA - less than 10% of the GAL version and it emits no extra heat, unlike the GALs which pushed out 30-45 deg C *each* :mrgreen:.

Attachment:
BusMonitorV2small.png
BusMonitorV2small.png [ 151.7 KiB | Viewed 919 times ]


[edit] see viewtopic.php?f=4&t=3377&start=15#p39551 for the latest AVR code -banedon


Last edited by banedon on Mon Aug 03, 2015 11:05 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 02, 2015 6:45 pm 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 491
Location: Switzerland
And I suppose most of those 45mA are from the LCD backlight :wink:


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

All times are UTC


Who is online

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