A tale of two if()'s

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

Hey all,

This has me baffled.  I have a device that can be in one of two 'modes'.  one mode is called BATTERY CHARGER MODE, the other mode is called 'LAMP CONTROLLER MODE'  

 

The AVR on power up waits 1500 milliseconds, then goes into an init routine which works, then it hits two IF statements.  Each IF() statement checks the logic level of PIND.5 and based on if it is a 1 or 0 dictates what mode.

 

Here is the code:

int main(void)
{
	_delay_ms(1500);		//wait for power supply to stabilise
	avr_init();				//Set up AVR
	sei();					//enable interrupts

	/*
	Mode select.  Check PortD.5 for logic level.  If high, lamp controller mode
	if low, charger mode */
	//***********************************Battery Charger Mode*****************************************

	if((PIND & MODE_PIN) == 0)		//BATTERY CHARGER MODE
	{
		uint8_t output = 0x02;	//preset variable to be output to PORTC
		uint8_t charger_check = 0;	//init charger status variable
		uint8_t CTRL_LED_STATE = 0;	//controller LED state variable

		while(1)
		{

			charger_check = (PINA & 0xE0);

				switch(charger_check)
				{
					case CHARGING:
								{
									if(blink_rate >=50)
									{
										output = ((charger_check ^ 0xE0) | CTRL_LED_GREEN);		//flip upper three bits and set lower two bits for GREEN CTRL LED
										blink_rate = 0;		//clear blink time
										PORTC = (output | CTRL_LED_STATE);		//display status with upper three bits inverted and CTRL_GREEN_LED blinking
										CTRL_LED_STATE = CTRL_LED_STATE ^ 0x01;		//toggle the CTRL_GREEN_LED off and on
									}//end of if
									break;
								}

					case CHARGED:
								{
									output = ((charger_check ^ 0xE0) | CTRL_LED_GREEN);		//flip upper three bits and set lower two bits for GREEN CTRL LED
									PORTC = output;
									break;

								}

								default:
										{
											if(blink_rate >=50)
											{
												output = (((charger_check) ^ 0x18) | (CTRL_LED_RED + 0x04)); //flip bits 3 and 4, turn on RED CTRL LED and set bit 2 so LEDS are all red indicators
												blink_rate = 0;		//clear blink time
												PORTC = (output | CTRL_LED_STATE);		//display status with upper three bits inverted and CTRL_RED_LED blinking
												CTRL_LED_STATE = (CTRL_LED_STATE ^ 0x02);		//toggle the CTRL_RED_LED off and on
											}//end of if
											break;
										}
				}//end of switch	

			}//end of while()

	}//end of if()

    //************************************Lamp Controller Mode*************************************
	if((PIND & MODE_PIN) == 1)
		{
			while (1)
			{
				PORTC = 0xFF;

			}//end of while

		}//end of if

	else
	{

	}//end of else

}//end of main

The first IF() hits just fine if the logic level is low on PIND.5 but if the pin is logic high the second IF() does nothing, and I do not know why.  

 

I wait the 1.5 seconds to allow for the power rails to be stable, and then after the init routine I enable the interrupt and then check teh level of the pin.  The AVR is running at 3.3v and I have checked all the pins and they are not shorted, as well as their levels with a meter and they stay logic low.

 

Like I said the BATTERY CHARGER MODE works fine.

 

Any suggestions appreciated

 

Jim

 

EDIT:  Corrected missing parenthesis

This topic has a solution.

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

Last Edited: Mon. May 7, 2018 - 01:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh, easy. Unless MODE_PIN = 1, that second if() will never be true. Better, all around (eg, more general):

 

if((PIND & MODE_PIN) > 0)

Been there, done that.

 

West Coast Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Sun. May 6, 2018 - 04:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the reply Jim,

 

 

MODE_PIN is in reality a mask

#define MODE_PIN 0x20

where I am comparing the read of PIND against the mask.  In this case the pin I am looking at is PORTD.5 , so I set in the mask bit 5 and compared against PIND thinking that if PIND.5 is high I should get a result of 1 making the IF() true

 

Where is my thinking going astray?

 

East Side Jim

 

EDIT:  Tried Jim W. suggested code line and still get same result.  FOO!

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

Last Edited: Sun. May 6, 2018 - 04:42 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If PIND.5 is high and MODE_PIN = 0x20, what is the bitwise AND of those two? 

 

It is 0x20! 

 

And that does not equal 1! But it IS greater than zero. It will be zero if PIND.5 is not high.

 

Also note that in that last if-block, it will be trapped in the while(1) loop and never exit. Likewise the first block, unless there is an "exit;" statement I don't see. Normally, while(1) is ONLY used to define the main event loop for the program. Use while(testable_logic_value) if you want to exit when some specific thing occurs.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Sun. May 6, 2018 - 04:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Correct....I blew that one.

 

BUT....

 

In Deans Tutorial:

https://www.avrfreaks.net/forum/...

 

If I want to check a bit I can do this:

To see if a bit is set or clear just requires the AND operator, but with no assignment. To see if bit 7 is set in the variable foo:

if(foo & 0x80)
{
}

 

So, I tried that with this:

if(PIND & MODE_PIN)

And the result is the same....The code in the braces does not execute.

 

I wonder if I need to simply read PIND into a variable instead, but that does not explain why the first IF works and not the second....

 

 

 

East Side 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

Right, because an argument of an if() statement is TRUE if that argument is greater than zero. Any value greater than zero.

 

That is

 

if(PIND & MODE_PIN)

will trigger even if PIND & MODE_PIN is 0x01 or 0x20 or even 0xff. It will NOT trigger if it is 0x00 (the ONLY case where it does not trigger). Thats the way true/false logic tests work in C. Anything greater than zero is taken as true.  This is the case for if() and while(). Maybe something else I am not thinking of.

 

West Coast Jim

 

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Tried this in Pelles and it worked. Maybe the fault is in what you're trying to get it to do (setting the output) -- or perhaps you're not getting pin5 to set on port D.

Just my .02 (bitcoin so the amount may vary)

 

#include<math.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#define MODE_PIN 0x20
int main(void)
{
    unsigned char mybin = 0b100000;
    if( mybin & MODE_PIN)
        printf("Holy cr*p\n");

    

}

 

hj

Last Edited: Sun. May 6, 2018 - 05:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tried to go there as an 'else' of the first 'if'? because that's what it is

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

"I have a device" doesn't help answer the first question that is asked for a trouble-shooting/repair, which is "Did this device ever work correctly (according to spec)?"  If it is a commercial product category of device, then it is either a dud from the factory or it is a formerly-working device that needs a repair.   If not a commercial product, then it is single-unit (or tiny batch) of a custom device that was built by a third-party, or it is a prototype.

 

Knowing which category that "I have a device" belongs in frames the next step in the repair process.

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

bitflipser wrote:

tried to go there as an 'else' of the first 'if'? because that's what it is

I agree, and originally had the second IF as an ELSE. I get the same result as the other options that I have tried. I must be missing something very simple as this is basic programming 101.

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

Dumb question:  Wrong pin?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

@Somonetta....it's a prototype for a one off unit I have been experimenting with.

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

joeymorin wrote:

Dumb question:  Wrong pin?


Not dumb at all. I have checked the pin and it is correct. If I drive it low the first if works. If I drive it high the AVR does nothing.

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

Define 'nothing'.  Actually nothing?

 

The only thing it should do is drive all the pins on port C high.

 

More dumb questions:  Has port C been made an output in avr_init()?  Presumably so.  Are you testing all of the pins on port C?  Does your device have JTAG on port C?  Is it disabled?  Does your device drive port C from AVCC?  Is AVCC connected?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Good questions.
Yes port is set up as all outputs and jtag has been disabled. I am testing all the pins and they are all low. AVcc is connected

Joey. If you look at the first IF I am using port c there as well and that IF works perfectly.

When I say the AVR does nothing I mean the pins on PORTC stay low even though the code says to drive them all high.

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

The (other) problem is that trapping while(1) in each if() block. Once it drops into either one, it stays there, forever.

 

West Coast Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Sun. May 6, 2018 - 03:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The (other) problem is that trapping while(1) in each if() block. Once it drops into either one, it stays there, forever.

That's a good point, in case there is some glitch, bounce etc.  Why not allow it to switch modes as needed, rather than becoming "stuck"?

Is the misbehaving input pin set to an input in the code somewhere (don't rely on some "default").

Scrap this code for the moment...make some code that reads the pin & light an led when pin reads hi & clears led when reading low....then feed hi/lo signals into wiring, to ensure at least pin is being read (and also no bad solder joints, etc).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. May 6, 2018 - 05:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The code is supposed to "stick" in one while(1), or the other. When power is applied the pin is read and the code is supposed to do one thing or the other....not jump from one or the other. The pin is being read as I can get the first IF to fire.

The 1.5 second delay at startup is there to make sure things are stable before reading the pin.

I will though run another test program to see what happens in a simpler format

East coast 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

The pin is being read as I can get the first IF to fire

Careful, since it only needs a zero...those are pretty easy to come by , even if the pin is misconfigured, had a broken wire..lots of things.

 

Probably should put the mode lamp into an else of the batt check:

 

if pin lo

   do batt check

 else

   do lamp

 

As it is written, it is possible to do nothing, since the pin is being read 2 separate times, if there is a reading glitch (though you think you are preventing):

main begin

 

  read pin

      if 0 do this

      wait forever

   read pin

      if 1 do this

     wait forever

 

main exit

 

If the first read is one & the second read is a zero, the program will exit, doing nothing. 

A while on main, would at least force one of the desired possibilities to eventually occur. 

 

 

 

 

 

 

 

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. May 6, 2018 - 07:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quick question, you never mention How you make this pin high and low? Do you pull it high/low with a pull up/ down resistor or directly to vcc/Gnd? Is this trigger by the board being powered or a ext-reset event? The reason I ask is how stable is the power supply when the pin read happens?? Have you checked this pin with a oscilloscope at this startup event?

Last Edited: Sun. May 6, 2018 - 07:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kuch wrote:
Quick question, you never mention How you make this pin high and low? Do you pull it high/low with a pull up/ down resistor or directly to vcc/Gnd? Is this trigger by the board being powered or a ext-reset event? The reason I ask is how stable is the power supply when the pin read happens?? Have you checked this pin with a oscilloscope at this startup event?

 

Another batch of very good quaestions

 

The pin is connected to the leg of a DPDT microswitch with the one common connected to Vcc the other connected to the pin of the AVR.  There is a pull down resistor on the pin so the pin is either at Vcc or Ground to indicate if the switch has been pushed up(Vcc) for controller operation, or is in the down position(Gnd) for Charger operation.  I put the 1.5 second delay at the very beginning to account for power supply ramp up...which is in the milliseconds, and the switch bounce...also in the milliseconds.

 

East Coast 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

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I have it working and quite honestly I don't know what exactly I did to fix it.  I did take the advice of West Coast Jim, and checked the lines for the pin involved that Joey suggested, and cleaned up a few things, then cleaned teh solution, and hit BUILD.  Programmed the AVR and all is good!

 

I am going to mark this as solved, but with a big question mark to go with it.

 

Here is the test code that worked:

int main(void)
{
	_delay_ms(1500);		//wait for power supply to stabilise
	avr_init();				//Set up AVR
	sei();					//enable interrupts
	
	
	/*
	Mode select.  Check PortD.5 for logic level.  If high, lamp controller mode
	if low, charger mode 
	*/
	//************************************Lamp Controller Mode*************************************
	if((PIND & MODE_PIN) == 0)
	{
		uint8_t output = 0x02;	//preset variable to be output to PORTC
		uint8_t charger_check = 0;	//init charger status variable
		uint8_t CTRL_LED_STATE = 0;	//controller LED state variable
		
			
		while(1)
		{
						
			charger_check = (PINA & 0xE0);
			
				switch(charger_check)
				{
					case CHARGING:
						{
							if(blink_rate >=50)
							{
								output = ((charger_check ^ 0xE0) | CTRL_LED_GREEN);		//flip upper three bits and set lower two bits for GREEN CTRL LED
								blink_rate = 0;		//clear blink time
								PORTC = (output | CTRL_LED_STATE);		//display status with upper three bits inverted and CTRL_GREEN_LED blinking
								CTRL_LED_STATE = CTRL_LED_STATE ^ 0x01;		//toggle the CTRL_GREEN_LED off and on
							}//end of if
							break;
						}
								
					case CHARGED:
						{
							output = ((charger_check ^ 0xE0) | CTRL_LED_GREEN);		//flip upper three bits and set lower two bits for GREEN CTRL LED
							PORTC = output;
							break;
									
									
						}
								
						default:
								{
									if(blink_rate >=50)
									{
										output = (((charger_check) ^ 0x18) | (CTRL_LED_RED + 0x04));		//flip upper three bits and set lower two bits for RED CTRL LED
										blink_rate = 0;		//clear blink time
										PORTC = (output | CTRL_LED_STATE);		//display status with upper three bits inverted and CTRL_RED_LED blinking
										CTRL_LED_STATE = (CTRL_LED_STATE ^ 0x02);		//toggle the CTRL_RED_LED off and on
									}//end of if
									break;
								}
								
				}//end of switch
			
		}//end of while()
		
	}//end of if()
	
    //************************************Lamp Controller Mode*************************************
	if(PIND & MODE_PIN)
	{
		
		while (1) 
		{
		
			PORTC = 0xF0;
		
		}
		
	} 
}//end of main

 

So there you have it...

 

Like I said

???

 

East Coast 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

There is still a sneak path (to nowhere.... well, exit) in the code...you can remove the second check:

if(PIND & MODE_PIN),  If the first check succeeds: if((PIND & MODE_PIN) == 0, it stays in that section forever, otherwise you want it to execute the second section (thus no potential failing 2nd check needed)

Or you can keep the check & keep looping in main until one check or the other succeeds.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Yes, that is true.  I will consider revising this as things are still in their infancy.

 

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