Jump to content
43oh

irose

Members
  • Content Count

    4
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    irose reacted to RobG in LaunchPad as Iambic Keyer   
    Here's my first iambic keyer, it's very simple, but I am planning to add some more functions.

    I know, I know, my morse is little rusty, but it's been a long time and I am not used to the Bencher, I am a straight key guy.

    EDIT: New addition, press S2 + paddle to change the speed +/-1wpm.







    #include #define AUDIO BIT4 // audio monitor output, 781.25Hz #define KEYOUT BIT0 // key output #define DOT BIT1 // dot paddle #define DASH BIT2 // dash paddle #define SPEEDSWITCH BIT3 // press S2 switch and paddle to change the speed, dot paddle + 1 wpm, dash - 1 wpm. unsigned int counter = 0; // main counter unsigned char counterOn = 0; // counting enabled unsigned int wpm = 18; // speed in WMP unsigned int dotCount = 0; // duration of one dot for the given speed unsigned int onCount = 0; // count needed to complete "on" cycle, for dash it will be dotCount * 3 unsigned char dotDash = 0; // used to determine what to send next when both paddles are pressed unsigned char pressed = 0; // indicates that one of the paddles is presses void main() { WDTCTL = WDTPW + WDTHOLD; // stop WDT BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; BCSCTL2 |= DIVS_3; // 1MHz/8 P1DIR = KEYOUT; // key output // paddle inputs and speed switch P1OUT = DOT + DASH + SPEEDSWITCH; // pull up P1REN = DOT + DASH + SPEEDSWITCH; // enable resistors P1IES = DOT + DASH; // trigger hi -> low P1IFG = 0; // clear flags P1IE = DOT + DASH; // enable interrupts dotCount = 1875 / wpm; // duration in ms is 1200 by WPM, but our interrupt is every 640us TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK/8, upmode CCR0 = 10; // 10 * 64us = 640us CCTL0 = CCIE; // CCR0 interrupt enabled _bis_SR_register(LPM0_bits + GIE); // LPM0 with interrupt while(1) { if(pressed == 0) { // do nothing counter = 0; } else { if(counter == 0) { // starting new dot/dash onCount = dotCount; // set count to duration of dot if((P1IN & (DOT + DASH)) == 0) { // both paddles are pressed, set count to the opposite of what it was last if(dotDash) { onCount *= 3; // set duration to dash } } else if(~P1IN & DASH) { // dash paddle pressed, set count to dash onCount *= 3; dotDash = 1; } if((~P1IN & (DOT + DASH)) == 0) { // just in case, if key was released, reset counter = 0; pressed = 0; dotDash = 0; counterOn = 0; } else { // turn audio and key on P1DIR |= AUDIO; P1OUT |= KEYOUT; counterOn = 1; } } else if(counter == onCount) { // turn off audio and key P1DIR &= ~AUDIO; P1OUT &= ~KEYOUT; } else if(counter == (onCount + dotCount)) { // done with dot/dash and space after counter = 0; counterOn = 0; if ((~P1IN & (DOT + DASH)) == 0) { // paddles released pressed = 0; dotDash = 0; } else { // still holding paddle(s) if(~P1IN & SPEEDSWITCH) { // changing speed? if(~P1IN & DOT) { wpm++; } else if(~P1IN & DASH) { wpm--; } dotCount = 1875 / wpm; // new dot count } if((P1IN & (DOT + DASH)) == 0) { // both paddles are squeezed, toggle dotDash ^= 1; } } } } _bis_SR_register(LPM0_bits); } } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { if(counterOn) { counter++; } P1OUT ^= AUDIO; // toggle every 640us to generate 781.25Hz waveform _bic_SR_register_on_exit(LPM0_bits); } // Port 1 interrupt service routine #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { P1IE = 0; P1IFG = 0; pressed = 1; P1IE |= DOT + DASH; }
  2. Like
    irose reacted to nimblemotors in Tractor Engine Control   
    I don't have a schematic of the battery charger, which is what the hardware was used for orginally.
    But I can tell you about the connection to the msp430. I used a LTC1155. It is a high-side mosfet driver that drives n-channel mosfet at +10v over the supply. So unlike most applications, I switch on/off the 12v to the fuel inject, instead of switching ground on/off. This was important for the battery charger, because switching the high side it could detect when a battery was attached, and automatically start charging them.
    The LTC1155 has two on/off inputs that are connected directly to the msp430 outputs. I used the TA1 and TA2 outputs,
    and did timerA pwm. hope that helps! Jack
  3. Like
    irose got a reaction from GeekDoc in LaunchPad as Iambic Keyer   
    Thanks for creating this project.
     
    After I received my Ham License I wanted to start learning CW, but using a straight key has been a challenge.
    I found this project inspiring and I think I now have a better platform for learning CW. I can focus on listening to the code rather than my technique.
     
    If it helps, I copied your schematic over to KiCad and etched a board for it.
    I am attaching a zip folder of the files should someone else want to use them. I did use the MSP430G2211.
    IambicKeyer.zip
  4. Like
    irose got a reaction from bluehash in LaunchPad as Iambic Keyer   
    Thanks for creating this project.
     
    After I received my Ham License I wanted to start learning CW, but using a straight key has been a challenge.
    I found this project inspiring and I think I now have a better platform for learning CW. I can focus on listening to the code rather than my technique.
     
    If it helps, I copied your schematic over to KiCad and etched a board for it.
    I am attaching a zip folder of the files should someone else want to use them. I did use the MSP430G2211.
    IambicKeyer.zip
  5. Like
    irose got a reaction from RobG in LaunchPad as Iambic Keyer   
    Thanks for creating this project.
     
    After I received my Ham License I wanted to start learning CW, but using a straight key has been a challenge.
    I found this project inspiring and I think I now have a better platform for learning CW. I can focus on listening to the code rather than my technique.
     
    If it helps, I copied your schematic over to KiCad and etched a board for it.
    I am attaching a zip folder of the files should someone else want to use them. I did use the MSP430G2211.
    IambicKeyer.zip
×
×
  • Create New...