View Single Post
Old 08-16-2013, 02:55 PM   #4 (permalink)
josemapiro
EcoModding Apprentice
 
Join Date: Dec 2012
Location: Portugal
Posts: 197
Thanks: 93
Thanked 70 Times in 64 Posts
Not changed the (# define RISING 3) (# define FALLING 2), because I use the pin 2 and 3, which amends and the INT0 and INT1, which belongs to pins 20 and 21.

Part code of injectors.
Code:
        injectorSettleTime = injhold;
	//int0Func = processInjOpen;                                                  // original code
	int4Func = processInjOpen;                                                  // code changed
	//int1Func = processInjClosed;                                                // original code
        int5Func = processInjClosed;                                                // code changed

	//set up the external interrupts
	//EICRB = (EICRB & ~((1 << ISC00) | (1 << ISC01)))                            // original code
        EICRB = (EICRB & ~((1 << ISC40) | (1 << ISC41)))                            // code changed
			//| ((parms[injEdgeIdx] == 1 ? RISING : FALLING) << ISC00);   // original code
                        | ((parms[injEdgeIdx] == 1 ? RISING : FALLING) << ISC40);   // code changed
	//EIMSK |= (1 << INT0);                                                       // original code
	EIMSK |= (1 << INT4);                                                       // code changed
	//EICRB = (EICRB & ~((1 << ISC10) | (1 << ISC11)))                            // original code
	EICRB = (EICRB & ~((1 << ISC50) | (1 << ISC51)))                            // code changed
			//| ((parms[injEdgeIdx] == 1 ? FALLING : RISING) << ISC10);   // original code
			| ((parms[injEdgeIdx] == 1 ? FALLING : RISING) << ISC50);   // code changed
	//EIMSK |= (1 << INT1);                                                       // original code
	EIMSK |= (1 << INT5);
The value of "# define vssBit (1 << 0)" is not the bit value of the pin?
Or put the value of the pin?
The pin that I use is the "A8" which uses pin "62" on the arduino mega.

If you have something wrong, please correct me.

As shown in the video, the program starts fine, but then when I trigger any of the buttons does a reset type, do not know what causes it.



If I can help I thank
José Rodrigues
  Reply With Quote