74LS Series IC Tester using AVR [AVR GCC - C] [NEWBIE]

Go To Last Post
35 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I have to make a simple project which uses AVR. I have thought of a project and before actually starting any work, I thought it would be better to ask here for guidance and suggestions on the project.

I am a NEWBIE, student of First Year Engineering in Industrial Electronics, I know simple C and simple Assembly, I have been tinkering with AVRs and blinking LEDs for a while now....

My project is as follows:
I want to make a device to test 74LS ICs, by providing inputs and checking the outputs automatically.

The hardware consists of the controller board, which also houses a ZIF Socket for the 74LS IC to be tested, there are some status LEDs, a TEXT LCD and some push buttons to serve as the user inputs.

The user turns on the system, puts the 74LS IC in the test socket, the LCD shows ready status and the user then selects the 74LS IC from the screen using buttons, after selecting, the user presses a push button to start the test, the controller then sends inputs to the IC and checks the outputs, as the controller already knows which IC it is, it then compares the outputs of the IC and determines if it is faulty or not and shows OUTPUT on the LCD.

I have used 74LS ICs in my practicals, now I was thinking that this can be done easily as most 74LS have the same VCC and Ground pins, which can be hard wired, the controller will directly be connected to all other inputs of the 74LS IC, as they work on TTL levels, the user will tell the controller which IC needs to be checked by either providing a combination of switches or by selecting from the LCD, the controller can hence determine the state of the IC....

PLEASE GUIDE ME IN THIS MATTER, am I missing something, will this work, is there something I should look out for....

I will be posting a sample(rough) schematic here soon for this project which I have in mind. Currently I am only going for some popular logic ICs which are used in the lab of my institute.

PLEASE HELP....

Last Edited: Mon. Mar 8, 2021 - 08:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to program it in C, I have done the TEXT LCD programming in Assembly, but never in C, so need help in that aspect as well, but the prototype of this project can work without the LCD.... As the LCD is just for fun, one can select the IC he needs to test based on a combination of switches.....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

and of course I will be posting this whole project complete with all hardware and code here on AVR FREAKS.....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You concept seems ok for me. If you would test only 74HC devices you probably could also power the device
under test via AVR-Port-Pins.

Sorry for the typo. You could also connect
the power-pins to AVR-IO-pins.

Last Edited: Sun. Jul 18, 2010 - 10:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ossi wrote:
You concept seems ok for me. If you would test only 74HC devices you probably could also poer the device
under test via AVR-Port-Pins.

hey, thanks for the encouragement, but I didn't completely understood it...

Quote:
you probably could also poer the device
under test via AVR-Port-Pins.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think it's just a "w" missing so that it should read

Quote:

you probably could also power the device
under test via AVR-Port-Pins.

and my interpretation would be that if so you could accept packages with power supply pins in different places.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

currently I was thinking of making this as simple as possible and hence I have selected 6 74xx ICs, which have the same power pins, though 4 have the same inputs and outputs and 2 are different.

7400, 7402, 7404, 7408, 7432 and 7486.

PLUS; I was thinking to put some transistors to control the power pins, should I put transistors on all pins or will the other gate pins will work directly with AVR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Currently the pin-out which I have in mind is as follows; sorry but I am out and cannot upload any kind of schematic, so I think text will do for now...

Supposing that all ICs to be tested are of 14 pins out of which the power and ground are hard wired.

PORTA of AVR: pins 1-6 and 8-9 of 74xx IC
PORTB of AVR: pins 10-13, remaining PORTB pins will be push buttons for inputs
PORTC of AVR: Connected to 8 LEDs for status
PORTD of AVR: I have not thought about this one, maybe it will be used for the TEXT LCD....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using an LCD for test results and device under test selection, and a simple data table on how the port pins get configured to perform the test, this should be a cool project!!

Definietly go for it.

Oh I forgot....ASK AWAY for help

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:
Using an LCD for test results and device under test selection, and a simple data table on how the port pins get configured to perform the test, this should be a cool project!!

Definietly go for it.

Oh I forgot....ASK AWAY for help

Jim

NEED HELP WITH LCD, I have never used TEXT LCD with AVRs+C....

I am using AVR GCC, please point me to some sample code for LCD interfacing with C... I have got ATMEGA32

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I kind of like the idea but fail to understand the goal. I am more concerned about why you want to test these chips and in what way? And do you have buckeful of these chips or few, as bucketful is faster to test with the AVR device, but a few would be faster to test manually..

Do you want to plug in a random chip and let the AVR determine what it is, or are you going to say "hey I plugged in a chip X and would like to test if it is okay" or what?

And how you would determine if a chip is good or bad? What if it is partially broken perhaps by ESD spike and works at very low speeds but not at higher speeds? Or what if there is a problem with voltage levels (for example output does not go high or low enough) instead of just speed?

And 74LS chips have a bit different IO voltage levels than AVRs have, which is more similar to 74HC devices perhaps.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
NEED HELP WITH LCD, I have never used TEXT LCD with AVRs+C....
There are several working "libraries" out there. Search for the Peter Fleury LCD code.

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael, I think you are over-engineering his project. As a first year student, he is building something that uses a micro. It doesn't have to be overly useful... Much of the learning is pin out, power supply, LCD interface, push button debouncing, by-pass caps, hooking up the programmer, etc.

I view this as a table for the different chips, drive the inputs to an AND gate while watching the output bit, repeat for each gate on the chip(s).

Fun project, and plenty of topics to learn about while designing and building it.

BTW, use the LCD to select the chip to be tested, and to give the result: (Pass/Failed).

I also would supply power under software control. I don't like plugging chips into hot sockets. Even a simple relay to turn the power on and off to the V+ pin could be used, and would provide another useful learning task as part of the overall project.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thankyou Koshchi for the LCD library, I will be looking into that just as soon as a without LCD prototype of this project starts to work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael thankyou very much for your concern, but as mentioned, this is supposed to be a simple project, though I will keep in mind to put in the function of determining the chip, that would be a better addition to this, but currently, the user will put in a chip, tell the controller what it is and the controller will check it, cause in our LABS we are given these chips and it will be a good thing to first check them before making the complete circuit and then finding out that the chip is broke....
PLUS DocJC gave a much better answer......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey DocJC thanks for the reply, I myself could not have answered it any better....

I have finalized to use a simple transistor based switch to control the power of the chip and the AVR will switch it on once the user presses start.

I am thinking of first making a prototype without the LCD and then to work with LCD as working with LCD on C is totally NEW for me....

AGAIN, THANKS....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zaidpirwani wrote:
Jepael thankyou very much for your concern, but as mentioned, this is supposed to be a simple project, though I will keep in mind to put in the function of determining the chip, that would be a better addition to this, but currently, the user will put in a chip, tell the controller what it is and the controller will check it, cause in our LABS we are given these chips and it will be a good thing to first check them before making the complete circuit and then finding out that the chip is broke....

Ah so if the AVR project is in the lab, anyone can use it to verify at some level the chip they have selected is okay and proceed! And opening up the code will let anyone add tests for more chips.

Yes this will be a good project, not the easiest to start with, but you will also learn much! I liked the powering the LS chips through relay, just to learn how to drive a relay with the AVR. And LCD is very educational too.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have started the project and have got some code and schematic ready, I am putting it all here for the great comments of you all....

The Schematic, till now; guys please keep in mind that this is my first schematic in EAGLE, I had never used Eagle before, need much help in using Eagle as well, I mean a simple and common library would be of much use to put components....

NOTES about the SCHEMATIC:

    The complete PORTA and the lower nibble of PORTB will be connected to the 12 pins of the 74LSxx IC. the button on PB7 will be used to start the TEST and the other three buttons will be used for selecting the chip to be tested.
    Plus, I intend to use the pin PC6 to switch the power of the 74LSxx IC.

Plus here is the code which I wrote, the actual TEST functions are still not written though; I know that this might not be the MOST EFFICIENT or the most well-written code, but guys, I am a beginner so fire away any mistakes or problems you see in my work.

#include 
#include 
#include 

void setup_ports(void);
void POST(void);
void error(void);
void chip_selection(void);
void ready(void);
void NAND_7400(void);
void NOR_7402(void);
void NOT_7404(void);
void AND_7408(void);
void OR_7432(void);
void XOR_7486(void);

int main(void)
{
 setup_ports();
 POST();
 while(1)
 {
  chip_selection();
 }
 return(0);
}

void setup_ports(void)
{
 DDRA	= 0b00000000;	// Connected to 74LS 
 PORTA	= 0b00000000;	// 
 DDRB	= 0b00000000;	// Connected to 74LS + Push buttons
 PORTB	= 0b11110000;	// Higher Nibble is Buttons(Active LOW)
 DDRC	= 0b11111111;	// Status LEDs (OUTPUT)
 PORTC	= 0b11111111;	// LEDs are Active LOW
 DDRD	= 0b11111111;	// Reserved for TEXT LCD
 PORTD	= 0b00000000;	// Active HIGH OUTPUT
}

void POST(void)
{
 if(PINA==0b00000000)
 PORTC	=	0b11110000;
 else
 error();
 _delay_ms(333);
 if(PINB==0b11110000)
 PORTC	=	0b00001111;
 else
 error();
 _delay_ms(333);
 PORTC	=	0b11111111;
 _delay_ms(333);
}

void error(void)
{
 unsigned char a=0;
 for(a=0;a<65;a++)
 {
  PORTC	=	a;
  if(a==63)
  a		=	0;
 }
}

void chip_selection(void)
{
 unsigned char combination=0;
 if(~PINB & 0b10000000)
 {
  combination = ~PINB & 0b01110000;
  switch(combination)
  {
   case 0:
    break;
   case 16:
    NAND_7400();
	break;
   case 32:
    NOR_7402();
	break;
   case 48:
    NOT_7404();
	break;
   case 64:
    AND_7408();
	break;
   case 80:
    OR_7432();
	break;
   case 96:
    XOR_7486();
	break;
   case 112:
    break;
   default:
    ready();
  }
 }
}

void ready(void)
{
 PORTC = 0b10000000;
 _delay_ms(250);
 PORTC = 0b00000000;
 _delay_ms(250);
}

void NAND_7400(void)
{
 
}

void NOR_7402(void)
{
 
}

void NOT_7404(void)
{
 
}

void AND_7408(void)
{
 
}

void OR_7432(void)
{
 
}

void XOR_7486(void)
{
 
}

I need the great suggestions and guidance which you guys provide...

Just to tell you that I am in First Year Engineering and any kind of MICRO-CONTROLLER will not be officially taught until I am in THIRD YEAR..... All this which I am doing is on my own and from here, by the help of this great community...

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I don't know C or Eagle, so you are already two steps ahead of me.
That said, a thought or two on your schematic.

Be sure to put a 0.1 uF cap across the V+ & Gnd pins, and the AVCC & Gnd pins, as close to the micro as possible. These are called by-pass caps.

The usual reset circuitry is a 10 K pull up resistor, reset pin to V+; and a cap, say 0.1 uF, from the reset pin to ground. A normally open push button switch goes from the reset pin to ground, push to reset the micro.

Look at AVR042 Application Note to see more info on the reset pin, crystal, and on the ISP programming header, which you will also want to add to your circuit.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey DocJC, I have revised the schematic as you had advised, though I think that I have got the Reset right, can you please see the RESET circuit on the last page of the Application Note, which you linked in your last reply and explain that to me.....

Here is the new schematic:

The 3 button DIP is for selecting the combination for the desired IC and the other two are normally OPEN push buttons.

Attachment(s): 

Last Edited: Sun. Jul 25, 2010 - 05:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have written code for the 7400 IC, it is a Quad 2-input Nand Gate IC.....

Can someone here review this code, I know that this is not efficient and that I don't know how to use the >> and << operators to set and clear bits.....

void NAND_7400(void)
{
 // Input Pins	=	1,2,4,5,9,10,12,13
 // Output Pins	=	3,6,8,11
 // The first 8 pins of the IC are connected to PortA, the other 4 are connected to the lower nibble of PortB
 DDRA	=	0b11011001;
 DDRB	&=	0b11111011;
 DDRB	|=	0b00001011;
 _delay_ms(250);
 PORTA	=	0b00000000;	// Start - First Gate Test
 if(PINA & 0b00100000)
 {
  PORTA	=	0b10000000;
  if(PINA & 0b00100000)
  {
   PORTA	=	0b01000000;
   if(PINA & 0b00100000)
   {
    PORTA	=	0b11100000;
	if(~PINA & 0b00100000)
	PORTC |= 0b00000001;
   }
  }
 }	// End - First Gate Test

 _delay_ms(250);
 PORTA	=	0b00000000;	// Start - Second Gate Test
 if(PINA & 0b00000100)
 {
  PORTA	=	0b00001000;
  if(PINA & 0b00000100)
  {
   PORTA	=	0b00010000;
   if(PINA & 0b00000100)
   {
    PORTA	=	0b00011100;
	if(~PINA & 0b00000100)
	PORTC |= 0b00000010;
   }
  }
 }	// End - Second Gate Test

 _delay_ms(250);
 PORTA	=	0b00000000;	// Start - Third Gate Test
 PORTB	&=	0b11110000;
 if(PINA & 0b00000010)
 {
  PORTA	=	0b00000001;
  if(PINA & 0b00000010)
  {
   PORTA	=	0b00000000;
   PORTB	|=	0b00000001;
   if(PINA & 0b00000010)
   {
    PORTA	=	0b00000011;
	PORTB	|=	0b00000001;
	if(~PINA & 0b00000010)
	PORTC |= 0b00000100;
   }
  }
 }	// End - Third Gate Test

 _delay_ms(250);
 PORTA	=	0b00000000;	// Start - Fourth Gate Test
 PORTB	&=	0b11110000;
 if(PINB & 0b00000010)
 {
  PORTB	&=	0b11110000;
  PORTB	|=	0b00000100;
  if(PINB & 0b00000010)
  {
   PORTB	&=	0b11110000;
   PORTB	|=	0b00001000;
   if(PINB & 0b00000010)
   {
    PORTB	&=	0b11110000;
    PORTB	|=	0b00001110;
  	if(~PINB & 0b00000010)
	PORTC |= 0b00001000;
   }
  }
 }	// End - Fourth Gate Test
}

If someone can write this a bit efficiently and post it here, It will be very helpful.... I don't want you to provide me the complete code, just some hints etc would also work........ As I don't want you to waste too much time on my project.....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The << and >> are shift operators. You can shift a 1 by 4 bits, (1 << 4) or shift it by a bit value name, DDRB |= (1 << PC4)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mquantz wrote:
The << and >> are shift operators. You can shift a 1 by 4 bits, (1 << 4) or shift it by a bit value name, DDRB |= (1 << PC4)

Can you please provide me some more explained explanation; better yet, can you tell me how to set the first and last bits of any PORT, say PORTB without affecting any other bits of the port, I think I will take it from there and then I will be able to implement it......

Thanks for the info.......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you tried a Google search for, say: setting and clearing bits in C?

- John

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jfiresto wrote:
Have you tried a Google search for, say: setting and clearing bits in C?

Oh yes, I already did that, but I searched for tutorial on Shift Operators in C, while I was searching for, I got some good tuts, but still am a little confused and am asking for a little demo of changing bits of an port by using those Shift Operators......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

zaidpirwani wrote:
can you tell me how to set the first and last bits of any PORT, say PORTB without affecting any other bits of the port

https://www.avrfreaks.net/index.p...

If you give a man a fish...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

am asking for a little demo of changing bits of an port by using those Shift Operators

Little demo:

Set bit

PORTx |= 1<<bitNumber;

Clear bit

PORTx &= ~(1<<bitNumber);

Before you ask "How does that work?" or similar, read the tutorial that mquantz pointed to.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

reading your plead for help in another post made me wonder if this was another school project needed making by us, but I have to admit , for a starter this is a very challenging project.

The schematics can become somewhat simpler though.
I do not think you need the flyback diode on the reset line unless you have a shitty power supply ( in that case I would clean that with a 7805)

I do not know how good you are with the fuses and what programmer you use, but as I think there is no time critical things here you could work of the internal RC oscillator. That would save you from possible fuse issues that we see alot here. ( if you plan to use the uart you need the xtal then keep it)

as said before make sure you are able to switch off the power supply. perhaps even make include a kill switch to be able to power off the IC fast when things go wrong. Like a wrong way insertion wich will give smoke if you not protect the chip.

Because you want to include a display I would suggest starting with that and getting that up and running. This will give you a tremenduos debug interface. For me it is always the first thing to get up and running ( the Display or the UART) even though I have an ICE available.

Also put a 100E( or even 1K) series resistor from eacht AVR pin to the DUT. this will act as current protection in case the chip is shorted inside.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mquantz and JohanEkdahl I am reading the article and trying to understand it....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:
The schematics can become somewhat simpler though.

I do not know how good you are with the fuses and what programmer you use, but as I think there is no time critical things here you could work of the internal RC oscillator. That would save you from possible fuse issues that we see alot here. ( if you plan to use the uart you need the xtal then keep it)

as said before make sure you are able to switch off the power supply. perhaps even make include a kill switch to be able to power off the IC fast when things go wrong. Like a wrong way insertion wich will give smoke if you not protect the chip.

Because you want to include a display I would suggest starting with that and getting that up and running. This will give you a tremenduos debug interface. For me it is always the first thing to get up and running ( the Display or the UART) even though I have an ICE available.

Also put a 100E( or even 1K) series resistor from eacht AVR pin to the DUT. this will act as current protection in case the chip is shorted inside.

Thanks for responding.... appreciate it, this is not a school project, this is just a project which I took upon myself in order to learn and get more practice on AVRs..

I just followed the schematic from the Application notes, otherwise I have not put a diode on the RESET line till now.

I have been using the External Oscillator since the start, I have got the fuses for it right, I am using the 11.0592Mhz crystal and as for programming, I have made a simple ISP cable from the parallel port and am using ISPProg to program it, whreas I am using AVR-GCC compiler and writing+simulating the code in AVR Studio...

I intend to turn ON the IC by using the controller, as for the display, I will be buying it in a day or two, plus I will be testing it on the hardware for the first time in a couple of days(am busy with tests etc)

I like the idea of having the LCD first running as I don't have JTAG (yet), plus I am going to put 1k resistors on all pins of the IC, GOOD SUGGESTION...

BTW; what does DUT stand for..?

Thanks again

I have been reading the application notes and the datasheets and this forum has been awesome... :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

what does DUT stand for..?

Usually it's "Device Under Test" isn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Quote:

what does DUT stand for..?

Usually it's "Device Under Test" isn't it?

thanks, I should have Googled it before asking.... but THANKS though...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

interesting,

If you have an RS232 level converter at hand, you could also temporarily get the uart up and running. This could then be your debug interface until you have bought the LCD.

WHat you could also do if you have IO pins enough to spare is put another IO pin on the other side of the 1K resistor. If you then put these lines to input you can also check if the pin you want to control is not shorted, but that would make it fancy and no longer basic.

regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am looking to do the same thing, but I'll start with 14-pin logic ICs (PDIP format) first, since the key point for me is that the GND and VCC pins for 14-pin logic ICs are always pins 7 and 14, respectively.

 

If you have made a project and is open source, I would like to take a look at your final approach.  Thanks.

Last Edited: Mon. Mar 8, 2021 - 06:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That is an 11 year old thread. Very unlikely that zaidpirwani is still around.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Topic locked