Jump to content

linuxha

Members
  • Content Count

    26
  • Joined

  • Last visited


Reputation Activity

  1. Like
    linuxha reacted to gwdeveloper in Irrigation scheduling algorithm   
    Expert? Thanks, Zeke.
     
    Most to of the standard controllers are just using a basic 24hr period counter. You could, simply, set it to count full days and skip the necessary amount. You may want to consider skipping the scheduling algorithm altogether -go sensor based instead of time. Most drought-restricted areas do have some fine-print to the rules. Here in the Austin,TX area we've been under drought restrictions for quite some time -it's nasty dry here.
     
    "Smart" controllers are the ticket as it's more important to keep a balanced moisture in the soil than to just water heavily once per week. If you can base your controller off of temperature, humidity and soil moisture sensors, you can bypass drought restrictions. Most commonly, the upper-end controllers use regional EvapoTranspiration. In Central, TX, our regional ET can be found two ways: 1) Broadcast over the powerlines (unsure of the protocol but requires special controllers to read the signal) 2) Download the charts from Texas A&M and manually set the controller times accordingly. http://texaset.tamu.edu/etinfo.php
    http://en.wikipedia.org/wiki/Evapotranspiration
    http://irrigation.tamu.edu/
     
    Hunter Industries and Rainbird both have really nice equipment to monitor ET. However, the consumer controllers at the big-box stores don't have these functions. You'll need to go to a landscape/irrigation supply house and unfortunately (at least here in TX) you need to have a license to buy there.
    http://www.hunterindustries.com/products/controllers/XCore.html
    http://www.rainbird.com/landscape/products/controllers/ESP-SMT.htm
     
    My plan for my Greenhouse and Garden controller is to have localized sensors to collect real-time data from conditions, not just predicted or based on history (A&M's charts are based on 30 year data). The sensors are based on RF2500Ts, with analog humidity, temperature, light frequency and simple moisture sensors. Eventually, I'm going to add pH and EC as well. My lot will have 8 sensors located around the yard. Even the most advance controllers from Hunter only allow 1 sensor and it is limited.
     
    If you can, do a little Xeriscaping to avoid watering. Most HOAs will allow for this now, just need to ask the right people. My lot has at least 17 native grasses and 20 or so types of wildflowers. The native species are much more drought tolerant than the 'pretty' green waste of valuable soil. We don't water the grass, only trees, fruit vines and veggie gardens. (And man, my Roast Corn Yard Salsa is some super yummy stuff http://www.roundrockfunnyfarm.com/2011/06/salsa-bread-and-crackers.html)
     
    And on a funny note, drought restrictions are a funny, funny thing. We're conserving water but the City of Austin lost revenue and wants to tax people for conserving or lift the restrictions. And even funnier... drought restrictions only apply to automatic sprinkler systems, you can hand water any time for any length of time. It makes me laugh to see people watering their grass at 3pm in 102^ heat and the water is steaming as it hits the ground. They wonder why the grass is brown the next day... they steam cooked it.
  2. Like
    linuxha reacted to RobG in LaunchPad, ADC, and LCD   
    It's time to play with ADC. I put together 2 examples, single channel and sequence of channels.Both use Vcc as reference.
    In the first example value of ADC10MEM register is displayed and the same value converted to show actual voltage.
    In the second example, 4 inputs are sampled, values are not converted, binary data is displayed (don't get fooled by the period.)


     
    #include "msp430g2231.h" #define sendData(data) send(data, 1) #define sendInstruction(data) send(data, 0) #define initDisplay() sendInstruction(0x3C); sendInstruction(0x0C); clearDisplay(); sendInstruction(0x06) #define clearDisplay() sendInstruction(0x01); _delay_cycles(2000) #define DATAPIN BIT6 #define CLOCKPIN BIT5 #define ENABLEPIN BIT4 const char charMap[10] = { 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39 }; void send(char data, char registerSelect); void sendDataArray(char data[], char length); char charIndex = 0; char bitCounter = 0; char charsToSend[5] = {0,0,0,0,0}; void main(void) { WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; _delay_cycles(100000); P1OUT &= ~(CLOCKPIN + DATAPIN); P1OUT |= ENABLEPIN; P1DIR |= ENABLEPIN + CLOCKPIN + DATAPIN; initDisplay(); ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE; ADC10CTL1 = INCH_1; ADC10AE0 |= BIT1; CCTL0 = CCIE; CCR0 = 12500; TACTL = TASSEL_2 + MC_1 + ID_3; _bis_SR_register(LPM0_bits + GIE); } // ADC10 interrupt service routine #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { clearDisplay(); charIndex = 0; while(charIndex < 4) { charsToSend[charIndex] = charMap[0]; charIndex++; } unsigned int binary = ADC10MEM; charIndex = 3; while(binary > 0) { charsToSend[charIndex] = charMap[binary % 10]; binary /= 10; charIndex--; } sendDataArray(charsToSend, 4); charIndex = 0; while(charIndex < 5) { charsToSend[charIndex] = charMap[0]; charIndex++; } charsToSend[1] = 0x2E; binary = ADC10MEM * 3.52; charIndex = 4; while(binary > 0) { charsToSend[charIndex] = charMap[binary % 10]; binary /= 10; charIndex--; if(charIndex == 1) charIndex--; } sendInstruction(0xC0); sendDataArray(charsToSend, 5); sendData(0x56); } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { ADC10CTL0 |= ENC + ADC10SC; } void sendDataArray(char data[], char length) { charIndex = 0; while(charIndex < length) { sendData(data[charIndex]); charIndex++; } } void send(char data, char registerSelect) { bitCounter = 0; while(bitCounter < 8) { (data & BIT7) ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); data <<= 1; P1OUT |= CLOCKPIN; P1OUT &= ~CLOCKPIN; bitCounter++; } registerSelect ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); P1OUT &= ~ENABLEPIN; P1OUT |= ENABLEPIN; }


    #include "msp430g2231.h" #define sendData(data) send(data, 1) #define sendInstruction(data) send(data, 0) #define initDisplay() sendInstruction(0x3C); sendInstruction(0x0C); clearDisplay(); sendInstruction(0x06) #define clearDisplay() sendInstruction(0x01); _delay_cycles(2000) #define DATAPIN BIT6 #define CLOCKPIN BIT5 #define ENABLEPIN BIT4 const char charMap[10] = { 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39 }; const char addressMap[4] = { 0x80, 0x88, 0xC0, 0xC8 }; void send(char data, char registerSelect); void sendDataArray(char data[], char length); char charIndex = 0; char valueIndex = 0; char bitCounter = 0; char charsToSend[5] = {0,0,0,0,0}; int values[4] = {0,0,0,0}; void main(void) { WDTCTL = WDTPW + WDTHOLD; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; _delay_cycles(100000); P1OUT &= ~(CLOCKPIN + DATAPIN); P1OUT |= ENABLEPIN; P1DIR |= ENABLEPIN + CLOCKPIN + DATAPIN; initDisplay(); ADC10CTL1 = INCH_3 + CONSEQ_1; ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE; ADC10DTC1 = 0x04; ADC10AE0 |= 0x0F; CCTL0 = CCIE; CCR0 = 12500; TACTL = TASSEL_2 + MC_1 + ID_3; _bis_SR_register(LPM0_bits + GIE); } // ADC10 interrupt service routine #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { clearDisplay(); while (ADC10CTL1 & BUSY) ; valueIndex = 0; while(valueIndex < 4) { charIndex = 0; while(charIndex < 5) { charsToSend[charIndex] = charMap[0]; charIndex++; } charsToSend[1] = 0x2E; unsigned int binary = values[valueIndex]; charIndex = 4; while(binary > 0) { charsToSend[charIndex] = charMap[binary % 10]; binary /= 10; charIndex--; if(charIndex == 1) charIndex--; } sendInstruction(addressMap[valueIndex]); sendDataArray(charsToSend, 5); valueIndex++; } } // Timer A0 interrupt service routine #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A (void) { ADC10CTL0 &= ~ENC; while (ADC10CTL1 & BUSY) ; ADC10SA = (unsigned int)&values[0]; ADC10CTL0 |= ENC + ADC10SC; } void sendDataArray(char data[], char length) { charIndex = 0; while(charIndex < length) { sendData(data[charIndex]); charIndex++; } } void send(char data, char registerSelect) { bitCounter = 0; while(bitCounter < 8) { (data & BIT7) ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); data <<= 1; P1OUT |= CLOCKPIN; P1OUT &= ~CLOCKPIN; bitCounter++; } registerSelect ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); P1OUT &= ~ENABLEPIN; P1OUT |= ENABLEPIN; }
  3. Like
    linuxha got a reaction from jsolarski in MSP430, mspgcc and Linux   
    I've started to put together my MSP430 notes page. It's no where near completed (technically it isn't published yet) but it does contain my working Makefile and a converted TI blink program for the F2012. I've commented out the TI code that doesn't work (the #pragma for example). I'll work on it as I get time. The program is decent to test out the compiled, the mspdebug (loading, running, step, etc.). It worked well on my Ubuntu client. On my server there is a problem with getting the USB stick recognized. I still have a lot of work to do on the page.
  4. Like
    linuxha got a reaction from bluehash in MSP430, mspgcc and Linux   
    I've started to put together my MSP430 notes page. It's no where near completed (technically it isn't published yet) but it does contain my working Makefile and a converted TI blink program for the F2012. I've commented out the TI code that doesn't work (the #pragma for example). I'll work on it as I get time. The program is decent to test out the compiled, the mspdebug (loading, running, step, etc.). It worked well on my Ubuntu client. On my server there is a problem with getting the USB stick recognized. I still have a lot of work to do on the page.
  5. Like
    linuxha got a reaction from jsolarski in MSP430 tools for linux   
    But I only figured it out when I was forced to think it through enough to explain what was going on (typical). Then I was forced to prove my answers. I hate posting something and then getting asked the obvious question (did you do this or that). I can make enough of a fool of myself without the extra added effort.
  6. Like
    linuxha reacted to jsolarski in MSP430 tools for linux   
    Original Post http://justinstech.org/2010/07/msp430-tools-for-linux/
    The MSP430, has a working compiler and tool chain for the MSP430 uC
     
    you can find the Tools here http://mspgcc4.sourceforge.net/
    and you can find the debugger/programmer here http://mspdebug.sourceforge.net/
     
     
    sources used -
    http://losinggeneration.homelinux.org/2010/07/02/msp430-launchpad-on-linux/
    http://eclecti.cc/hardware/using-the-ti-msp430-launchpad-with-ubuntu-10-04
×
×
  • Create New...