MSP430 for PWM Square Wave Gen

Cheap $4 MSP430 launchpad, i made up some code to get it working for a Freq Gen Square Wave. I used Energia to write the code. Only issue for me it is 3.3volt, but a diode in line pulls it up enough for it to work as a 5volt PCM/ECU input.

 

 

/*


The1's Square Wave FREQ Gen
nigel@eyeit.org

Push Button UP/Down
1hz increment
0-30,000hz Range
3.3V

P1_3 UP Button
P1_4 DOWN Button
P1_6 FREQ OUT

*/

const int buttonP1_3 = P1_3; // Define UP Button PIN
int buttonUP = 0; // Set UP Button to 0
const int buttonP1_4 = P1_4; // Define DOWN Button PIN
int buttonDOWN = 0; // Set DOWN Button to 0
int TempFreq = 2000; // Set Bootup Freq
int FreqInc = 1; // Pushbutton Freq Increment


void setup() {

// initialize the Buttons as an input:
pinMode(buttonP1_3, INPUT_PULLUP);
pinMode(buttonP1_4, INPUT_PULLUP);

}

void loop()
{
// Refresh for Bootup or Reset
analogFrequency (TempFreq) ; // Refresh Output on Bootup or Reset
analogWrite(P1_6, 127); // Send PWM to Pin P1_6 50% duty cycle

// Button UP Code
buttonUP = digitalRead(buttonP1_3); // read the state of the UP Button:

if (buttonUP == LOW) // check if the pushbutton is pressed = LOW.
{
TempFreq = TempFreq + FreqInc; // Add FreqInc to Current Output
analogFrequency (TempFreq) ; // Send New Output
analogWrite(P1_6, 127); // Send PWM to Pin P1_6 50% duty cycle
}

// Button DOWN Code
buttonDOWN = digitalRead(buttonP1_4);// read the state of DOWN Button:

if (buttonDOWN == LOW) // check if the pushbutton is pressed = LOW.
{
TempFreq = TempFreq - FreqInc; // Subract FreqInc From Current Output
analogFrequency (TempFreq) ; // Send New Output
analogWrite(P1_6, 127); // Send PWM to Pin P1_6 50% duty cycle
}

}

 

Attachments:

VS V6 Auto Manual Getrag T5 PCM ECU

$150 + Postage

VS V6 PCM Can be used with Auto or Manual, Getrag or T5, also comes with a Factory Memcal, Can supply it with VATS Security OFF for Conversions at no extra cost.

This PCM is a Factory Auto PCM which has been converted to be identical to a T5 PCM.

Flash PCM & VS V6 NA Enhanced Mod Out Now

New VX VY Flash PCM bins with Extended MAF

New VS V6 NA with Extended MAF, Injector Multiplier Table and Extended Spark Tables

http://delcohacking.net/forums/viewtopic.php?f=27&t=2518

Dyno Run before / after rockers and tuneup

Before and After roller rockers, both with tuneup inbetween. Not bad for 300k engine

VS V6 Auto

Pod intake

69mm TB

Pacemaker extractors and 2.5" Exhaust

1.95 Yella Terra Roller Rockers, 105lb springs

Click image for full view 

Enhanced Factory Bins

After much time i have now released Extended Factory Bins, this gets around most of the limits on the factory pcm's, currently available is VY S/C, others to come soon!

Features include, extended MAF tables to 14178hz and extended spark table!

 

http://delcohacking.net/forums/viewtopic.php?f=27&t=2518

1 2 3 4 5 6 7 8 9 10 11 ... 13 »