Jump to content

Search the Community

Showing results for tags 'msp430f5529'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 71 results

  1. Hello, I have been working with the MSP4305229 Launchpad and have been trying to work with Bluetooth. I'm using HC-06 module. Currently use energia to programmed the code. During the compiling, it produce the error code. I have been trying use others code and still produce the same error. Do you have any ideas to solve the error? Kindly seek your assistance. Thank you. Here the message of error. Energia: 1.8.7E21 (Windows 10), Board: "MSP-EXP430F5529LP" C:\Users\Harizazmi\Desktop\energia-1.8.7E21\hardware\energia\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:81:2: error: #error This version of SoftwareSerial supports only 16MHz processors C:\Users\Harizazmi\Desktop\energia-1.8.7E21\hardware\energia\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)': C:\Users\Harizazmi\Desktop\energia-1.8.7E21\hardware\energia\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:251:31: error: 'table' was not declared in this scope C:\Users\Harizazmi\Desktop\energia-1.8.7E21\hardware\energia\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)': C:\Users\Harizazmi\Desktop\energia-1.8.7E21\hardware\energia\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:319:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope exit status 1 Error compiling for board MSP-EXP430F5529LP. This is the coding. // define TROUBLESHOOT #include <SoftwareSerial.h> SoftwareSerial bluetooth(P3_4, P3_3); // RX, TX int i; int j; int min; int max; float rms; float totalF; float a0; float a1; float b1; float a2; float b2; float a3; float b3; float a4; float b4; float a5; float b5; float a6; float b6; float rmsac; float h1; float h2; float h3; float h4; float h5; float h6; float thd; float total; float multiply=1.459; uint16_t adc[180]; float timer; char data=0; void setup() { Serial.begin (9600); bluetooth.begin(9600); //bluetooth } void loop() { i=0; timer=millis(); while(millis()-timer < 20) //Get sample ADC in 20ms { adc=analogRead(A0); i++; } j=0; min=1023; max=0; total=0; #if defined (TROUBLESHOOT) Serial.println(i); #endif for(j=0;j<i;j++) { #if defined (TROUBLESHOOT) Serial.println(adc[j]); #endif if(adc[j]>max) max=adc[j]; if(adc[j]<min) min=adc[j]; total+=adc[j]*adc[j]; } total=total/i; rms=sqrt(total); total=0; for(j=0;j<i;j++) { total+=adc[j]; } a0=(float)total/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*PI*j/i); } a1=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*PI*j/i); } b1=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*2*PI*j/i); } a2=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*2*PI*j/i); } b2=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*3*PI*j/i); } a3=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*3*PI*j/i); } b3=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*4*PI*j/i); } a4=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*4*PI*j/i); } b4=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*5*PI*j/i); } a5=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*5*PI*j/i); } b5=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*cos(2*6*PI*j/i); } a6=(float)2*totalF/i; totalF=0; for(j=0;j<i;j++) { totalF+=adc[j]*sin(2*6*PI*j/i); } b6=(float)2*totalF/i; rmsac=sqrt(rms*rms-a0*a0); h1=sqrt((a1*a1+b1*b1)/2); h2=sqrt((a2*a2+b2*b2)/2); h3=sqrt((a3*a3+b3*b3)/2); h4=sqrt((a4*a4+b4*b4)/2); h5=sqrt((a5*a5+b5*b5)/2); h6=sqrt((a6*a6+b6*b6)/2); thd=100*sqrt(rmsac*rmsac-h1*h1)/h1; #if defined (TROUBLESHOOT) Serial.println("MIN="+String(min)); Serial.println("MAX="+String(max)); Serial.println("RMS="+String(rms)); Serial.println("A0="+String(a0)); Serial.println("A1="+String(a1)); Serial.println("B1="+String(b1)); Serial.println("A2="+String(a2)); Serial.println("B2="+String(b2)); Serial.println("A3="+String(a3)); Serial.println("B3="+String(b3)); Serial.println("A4="+String(a4)); Serial.println("B4="+String(b4)); Serial.println("A5="+String(a5)); Serial.println("B5="+String(b5)); Serial.println("A6="+String(a6)); Serial.println("B6="+String(b6)); Serial.println("H1="+String(h1)); Serial.println("H2="+String(h2)); Serial.println("H3="+String(h3)); Serial.println("H4="+String(h4)); Serial.println("H5="+String(h5)); Serial.println("H6="+String(h6)); Serial.println(); #else Serial.print("RMS:"+String(multiply*rmsac)+","); Serial.print("H1:"+String(multiply*h1)+","); Serial.print("H2:"+String(multiply*h2)+","); Serial.print("H3:"+String(multiply*h3)+","); Serial.print("H4:"+String(multiply*h4)+","); Serial.print("H5:"+String(multiply*h5)+","); Serial.print("H6:"+String(multiply*h6)+","); Serial.print("THD:"+String(thd)+";"); Serial.println(); if(data=='C') { bluetooth.print("RMS:"+String(multiply*rmsac)+"A"); bluetooth.print("THD:"+String(thd)+"B"); bluetooth.print("H1:"+String(multiply*h1)+"C"); bluetooth.print("H2:"+String(multiply*h2)+"E"); bluetooth.print("H3:"+String(multiply*h3)+"F"); bluetooth.print("H4:"+String(multiply*h4)+"G"); bluetooth.print("H5:"+String(multiply*h5)+"I"); bluetooth.print("H6:"+String(multiply*h6)+"J"); } #endif if(bluetooth.available()) { data=bluetooth.read(); } delay (1000); }
  2. I used MSP430F5529 lunch pad in my project and developed program in Energia but I can’t access some pins in map430f5529 through Energia and I’ve already developed program with Energia and made one PCB prototype now I am having problem to access some pins . I tried to modify variant in pin map by just adding those pin to the text file in the same way of other pins but it didn’t work, if someone can help me and tell me step by step how to add more pins
  3. I would like to trigger the sampling from a timer, but somehow cannot find the required information about the ADC12SHS bits in the ADC12CTL1 register. The family manual tells me to look in the specific device datasheet for that information, but I can't find it there (the MSP430F5529 datasheet). Also looked into the mspware C examples, but none uses timer triggered A/D. Where should I look for that info (which timers can be used, and how to set ADC12SHS bits to use them)?
  4. What I'm trying to do: We have been developing a project for school on a MSP430F5529 LaunchPad. We now want to move our project to a custom PCB for the final part. My partner has been using the UCB0 SPI module available through the LaunchPad to communicate to a sensor while I have been separately (as in a completely different sketch) using the same module to run the CC3100MODBOOST Boosterpack. Because no one on my team has much programming experience, we are using Energia to develop the project. We first tried to start with CCS, but we were in way over our heads. Now that we have our different subsystems working, we are using an evaluation board to test out our circuit before going to a PCB. In order to run the SPI module and the sensor at the same time, I want to move the SPI communication with the CC3100 to the UCA1 SPI module. I think I figured out to set up and access all of the pins through pins_energia.h. I created a new board for our setup and added it to Energia. I used some LEDs to check that I could access GPIO pins that weren't accessible on the LaunchPad, and they would all light up when I wanted them to. (I used the digitalWrite() function to check that I actually set up the pins_energia.h file correctly. I didn't directly send the pins high with "P1DIR |= BIT0; P1OUT |= BIT0;" style assignments.) My next step was to switch communication with the CC3100 from UCB0 to UCA1 so my partner could keep using UCB0 for communication with his sensor. This is where I got really lost. I know that the code I have is using the SPI library included with Energia, but I don't know how to modify to do what I want it to do. So my main question ultimately is: "How do I get the Energia sketch to use UCA1 instead of the default UCB0 SPI module for communication with the CC3100?" Secondary to that, I am hesitant to change the installed libraries for Energia. Is there a way that I can reference copies of those libraries where my changes will be made? What I've tried: Looking through the code, I think that for the F5529, Energia is using the functions defined in utility/usci_spi.cpp. For this file at least, it seems to be hardcoded that the MSP will use UCB0. I tried to go through the file and replace every instance of "UCB0" with "UCA1", but that didn't work. I've also tried to look through some other posts about using alternate SPI ports on the F5529, but either I couldn't understand them or they didn't have solutions posted. Hardware: LaunchPad - MSP-EXP439F5529LP Rev 1.6 MCU - MSP430F5529IPN Evaluation board - MSP-TSP430PN80USB Boosterpack - CC3100MODBOOST Rev 1.0 Software IDE - energia-1.8.7E21 OS - Windows 10 Pro Other 43oh posts I've looked at (or at least the most relevant ones): https://forum.43oh.com/topic/5844-f5529-using-alternate-spi-and-i2c-interfaces/ https://forum.43oh.com/topic/5174-getting-i2c1-ie-usci_b1-to-work-on-f5529-launchpad/ Thank you so much for y'alls help with this. I've been trying for a while now to get this on my own, but I keep hitting a wall. This is my first post here, so please let me know if I need to provide any additional info or if there was a different way I should have posed this question. Thank you! Edit: typos/grammar
  5. Good Afternoon, I am using the launchpad MSP430F5529 + Boosterpack CC3100 and the software Energia version 1.6.10E18 with the OS - Windows 10. I am having problem with the update. I must update multiple time for work my serial print. I would like to know the reason for the problem. I am using in a code a lot complex but when I use in a code more simple like a "Blink" I have the same problem. I already look the "device manager" of my PC like the figure that I attachment("COM12") and already try used both selection of debugger (dslite - or mspdebug) and the problem keeps. I am use this simple blick bellow for test and I have the same problem. I would like a answer please.
  6. Hemavathi

    Mouse

    I am trying to design 3D Space mouse with functions such as tilt,pan,zoom with msp430f5529 and accelerometer What accelerometer would be better to use ??
  7. I am unable to reconnect to my WPA wifi access point after disconnecting. Using the code posted in the link: Problem in Reconnecting with CC3200 I was able to successfully run the code with a Launchpad CC3200 device I was NOT able to run the code with a Launchpad MSP430F5529 and CC3100 Boosterpack When I use this setup, I connect the first time, disconnect, and fail to reconnect. My serial screen outputs the following: Attempting to connect to Network named: MXET .......................................... You're connected to the network Waiting for an ip address ............... IP Address obtained SSID: MXET IP Address: 192.168.137.93 signal strength (RSSI):-58 dBm Waiting... 9999 Waiting... 8997 Waiting... 7997 Waiting... 6996 Waiting... 5996 Waiting... 4995 Waiting... 3994 Waiting... 2994 Waiting... 1993 Waiting... 992 Disconnecting from WiFi....Disconnected Waiting... 9426 Waiting... 8424 Waiting... 7424 Waiting... 6423 Waiting... 5422 Waiting... 4422 Waiting... 3421 Waiting... 2421 Waiting... 1420 Waiting... 419 Attempting to connect to Network named: MXET ............................................................ reconnectWiFi.ino
  8. As an electrical engineering student at John Brown University, we were tasked with creating a useful product or service using the combined skills gained through our embedded systems class. As someone who likes interior decorating and hates mismatched paint, I came up with the idea to make an RGB color sensor attachment for a camera. Of course converting RGB data to paint colors is not conventional, it is something that could potentially be viable. To make things interesting and for the experience of working with a Raspberry Pi, I used a raspberry Pi camera to act as the base for the project. A KMASHI 10,000mAh power bank was used as the power source to make it portable and act as a psuedo case to strap all of the components together. It is definitely not elegant in any way, shape, or form, but it is more experience for me and hopefully you can find an interesting tid bit here or there in my documentation! Enjoy! RGBColorSensorAttatchmentRPI.docx
  9. This is a fun project that was created for my embedded systems class at John Brown University that allows you to create your own quiz wizard similar to the jeopardy game show system. The main portion of this code is run on an MSP430F5529 launchpad, and nRF24L01 transceiver modules were used to obtain the wireless functionality. It makes use of the Enrf24.h library to operate the transceiver modules, and the user interface is output to the serial monitor of the energia IDE. Four buttons wired into the MSP430F5529 then allow the user to interact with the system. The wireless module was created by using an MSP430G2553 launchpad, button, and LED for indicating power on. The LCD display can be integrated although an Arduino MEGA is needed to have it be fully functional with the rest of the system, so the code for this portion of the project was not uploaded. Enrf24_RXdemo.ino Enrf24_TXdemo.ino Rough Circuit Schematic.pdf
  10. Raimundo

    UCAxCTL0 Register

    Hi, I'm trying out some UART communication proyects on an MSP430F5529. My question is, what number should I put instead of the x in UCAxCTL0? And where could I find this information next time (already tried the User Guide)? Thanks.
  11. Hello, Pardon for my direct approach. I saw an example in Energia forum on Problem Sampling Rate MSP430F5529 May I know what is readADC();? Because you do not create any void called readADC(); on your sample code. For right now I am trying implement it on MSP430F6989LP, which also has 12bit ADC. Would you kind share with me? I appreciate your help. Thank you very much. Best Regards, Lukman your example code is as below: #if defined(__MSP430_HAS_ADC12_PLUS__) #define REFV_MAP(x) ((x>>8) & 0x70) #define REF_MAP(x) (x & 0xB1) #define ADCxMEM0 ADC12MEM0 #define DEFAULT_READ_RESOLUTION 12 #endif #if defined(__MSP430_HAS_ADC12_PLUS__) #define DEFAULT (ADC12SREF_0 << 8) #define INTERNAL1V5 ((ADC12SREF_1 << 8) | REFON | REFMSTR | REFVSEL_0) #define INTERNAL2V0 ((ADC12SREF_1 << 8) | REFON | REFMSTR | REFVSEL_1) #define INTERNAL2V5 ((ADC12SREF_1 << 8) | REFON | REFMSTR | REFVSEL_2) #define EXTERNAL (ADC12SREF_2 << 8)#endifuint16_t analog_reference = DEFAULT; #define NUM_READS 10000 void setup() { Serial.begin(115200); Serial.println("Setup done"); setupADC(A0); } uint32_t mark, time_it_took; uint16_t i; void loop() { // Serial.println(readADC()); mark = millis(); for(i = 0; i < NUM_READS; i++) { readADC(); } Serial.print("Time: "); Serial.println(millis() - mark); Serial.println(readADC()); } uint16_t setupADC(uint8_t pin) { uint8_t channel; // Check if pin is a special analog pin (A10 = temp sensor, A11 = Vcc/2, etc.) if (pin >= 128) channel = pin - 128; else channel = digitalPinToADCIn(pin); // Check if pin is valid if (pin == NOT_ON_ADC) return 0; #if defined(__MSP430_HAS_ADC12_PLUS__) ADC12CTL0 &= ~ADC12ENC; // disable ADC ADC12CTL1 = ADC12SSEL_2 | ADC12DIV_0; // ADC12OSC as ADC12CLK (~5MHz) / 5 while (REFCTL0 & REFGENBUSY); // If ref generator busy, WAIT if (pin == TEMPSENSOR) {// if Temp Sensor REFCTL0 = REF_MAP(INTERNAL1V5); // Set reference to internal 1.5V ADC12MCTL0 = channel | REFV_MAP(INTERNAL1V5); // set channel and reference } else { REFCTL0 = REF_MAP(analog_reference); // Set reference using masking off the SREF bits. See Energia.h. ADC12MCTL0 = channel | REFV_MAP(analog_reference); // set channel and reference } ADC12CTL0 = ADC12ON | ADC12SHT0_4; // turn ADC ON; sample + hold @ 64
  12. B@tto

    SPI1 on MSP430F5529

    Hi, Little question : is SPI1 available on F5529 ? It's mentionned on pinmapping http://energia.nu/Guide_MSP430F5529LaunchPad.html but when I try to use it, no signal is generated, and when I look in librairies and core, I don't find where it's configurated (setModule() is only for EUSCI peripheral). Regards
  13. I am working with the MSP430F5529 Launchpad w/the Pervasive Display Gen2 EXT2 board and various eInk displays (BW, BWR). There seems to be a wide array of official(?) and unofficial SDKs, FW dev kits, boosterpacks, etc. available with varying degrees of compatibility with this particular LaunchPad. I am looking for some basic pointers on creating a simple GUI tool for sending images to the display. I can compile the latest 1.21 FW (via CCS using PDI Apps as target), flash the FW and run the (precompiled) PDI Apps Ver 1.21.exe GUI tool to send images to display, however it seems there is no source code for this GUI tool provided(?). Or, am I just not looking in the right place? Is there a project and/or document that explains/demonstrates creating a simple GUI or command line to interface with the hardware (for example making calls to the PDI_apps_drivers command handlers) to send an image to the display. So far I have found two projects which seem to have potential for good starting point(?): CCS IDE and EPD Extension Board Gen2 (EXT2)_v1.21 using the PDI Apps target _preferable_ (or the MSP430F5529 specific example target). Energia IDE (or Visual Micro MSVS plugin) and EPD_Demo.ino with the Pervasive_EPD_BoosterPack2 (I'd prefer to use C++, but not completely opposed to python if necessary as starting point.) Thanks for any pointers in the right direction.
  14. Hello Everybody, I am using a MSP430F5529 Launchpad with Energia IDE in order to measure the current flowing on the motor. But I have a problem with sampling rate. The current that I want to measure has a 22kHz frequency and I have a 10kHz sampling rate. I would like to have a 200kHz sampling frequency. I found in an other topic that the sampling rate can be reduce because of the serial.print. So, I stored my values in a array before displaying them. i have a better sampling (10kHz) but not enough. Could you tell me how can I improve the sampling rate ? Attached the sketch. Thank you. Sketch Current Measurement .txt
  15. I have a program that used to compile correctly under the Energia IDE, but it now gives the error: failed MSpanList_Insert 0x30d000 0x504f9a602be9 0x0 fatal error: MSpanList_Insert I'm running Energia 1.6.10E18 on Mac OS High Sierra 10.13.3, with version 1.0.3 of the Energia MSP430 boards. Any suggestions?
  16. Hello, I wrote a code for calculating VCO frequency and divider values for a PLL from the given output frequencies. For now I am printing the values in the console to debug my code and it is working properly. But now I want to move the values from stack to registers available in MSP430f5529. In the image below you can see that freq_VCO value is stored in stack memory location 0x04382. How do I move this value in one of the registers? Pleas help!
  17. I'm trying to interface sd card module to msp430f5529 using Energia. I tried these methods https://43oh.com/2013/12/interfacing-the-launchpad-to-an-sd-card-a-walkthrough/ and download sd library from GitHub. both are giving errors. can anyone help me out with this errors?
  18. manai1992

    Flash overflow

    Hello everyone, I'm working on a project which is based on the MSP430F5529 MCU. As the progrom is growing up in size, i tried to upload it to the MCU but suddenly i got an error message that the .txt memory area overflowed by 64 bytes. I've searched for this problem and tried to modify the Memory file with no good results. Any help is welcome and thank you in advance.
  19. I'm using the FRC Gamepad Tool to load the TI-supplied firmware for a USD HID joystick with a KMA210 magnetic angle sensor. I have a voltage divider taking the KMA210's 5V max output to 3.3V, and when plugging in the MSP and checking the windows game controllers, an axis does respond when I turn a magnet near the sensor, but the reading is all over the place. Bouncing back and forth by 40% of the whole angle range. I've tried using an external 5V supply, tried changing the sampling on the ADC, the Vref, the clock multiplier, the wires, the input pin, just about everything. Does anyone have any advice?
  20. ConfusedCoder

    MSP430F5529 LPM Questions

    Hi, I was working on interfacing my MSP430 with a 4x4 keypad and I stumbled upon this application report. Then I looked into the specific low power modes of the F5529 and noticed that there was a LPM4.5. The application report uses LPM4 as it isn't the same device, and I was wondering if it was possible to use LPM4.5 as the device was waiting for keypad input as my goal is to minimize power usage.
  21. Jetfire

    Library for Wiznet 5100

    Hi I am a newbie to MSP430 have coded on AVR and Arduino and trying out MSP for thr first time. Currently working on a project involving keypad, LCD, Ethernet. I have managed to find libraries of keypad and LCD and they seems to be working. But there is very few resources of ethernet and could not find anything. i have seen a post regarding W5200 but i unable to understand it, also RobG booster pack and library for W550 is great but i dont have the module and is out of stock. If anybody have any links on how to create the library for a newbie would be great and if they have a library for lets say Web client it would be awesome Thanks
  22. Jetfire

    Library for Wiznet 5100

    Hi I am a newbie to MSP430 have coded on AVR and Arduino and trying out MSP for thr first time. Currently working on a project involving keypad, LCD, Ethernet. I have managed to find libraries of keypad and LCD and they seems to be working. But there is very few resources of ethernet and could not find anything. i have seen a post regarding W5200 but i unable to understand it, also RobG booster pack and library for W550 is great but i dont have the module and is out of stock. If anybody have any links on how to create the library for a newbie would be great and if they have a library for lets say Web client it would be awesome Thanks
  23. Hello, I am looking for an enclosure for a Launchpad MSP430F5529 with a AAA batteries pack. Someone know about a distributor which sell some? Thanks
  24. Hello guys i have a project at my school were i need to make an energy metter with a msp430f5529 and a hardware part i did all the code myself and the hardware part (current metters,voltage divider etc), (i know is rudimental and ineffective) , the code and the montage works well and does everything i need it to do.Now my professor asked me to save "energie1" and "energie2" so when my microcontroler runs out of battery this 2 variables are saved , i read a lot of threds but i can't figure it out.Here is the code if it helps ( i can provide you with hardware montage if needed). #include <Wire.h> #include "LiquidCrystal_I2C.h" byte address = 0x27; // LCD I2C address int columns = 20; // number of columns on LCD int rows = 2; // number of rows on LCD LiquidCrystal_I2C lcd(address, columns, rows); long previousMillis = 0; long previousMillis1 = 0; int timp; int sensorPin = 23; int sensorValue = 0; float volt; byte newChar1[] = { B11111, B10001, B10001, B10001, B10001, B10001, B10001, B11111 }; byte newChar2[] = { B00000, B00000, B11100, B11100, B11100, B11100, B00000, B00000 }; byte newChar3[] = { B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111 }; int sensorPin1 = 24; int sensorValue1 = 0; float amp1; int sensorPin2 = 25; int sensorValue2 = 0; float amp2; float putere1; float total_putere1; float energie1; float media_puteri1; float putere2; float total_putere2; float energie2; float media_puteri2; long interval = 1000; long interval1=270; const int buttonPin = PUSH2; int buttonPushCounter = 0; int buttonState = 0; int lastButtonState = 0; void setup() { lcd.init(); pinMode(buttonPin, INPUT_PULLUP); lcd.createChar(0, newChar1); lcd.createChar(1, newChar2); lcd.createChar(2, newChar3); } void loop() { buttonState = digitalRead(buttonPin); sensorValue = analogRead(sensorPin); sensorValue1 = analogRead(sensorPin1); sensorValue2 = analogRead(sensorPin2); unsigned long currentMillis = millis(); unsigned long currentMillis1 = millis(); timp=currentMillis/1000; if(currentMillis - previousMillis > interval) { previousMillis = currentMillis; volt=sensorValue; volt=(volt*3.3)/4096; volt=volt*8.51; amp1=sensorValue1; amp1=(amp1*3.3)/4096; if(amp1<0.5) amp1=0; amp1=amp1/0.5; amp2=sensorValue2; amp2=(amp2*3.3)/4096; amp2=amp2/0.05; if(amp2<1.25) amp2=0; putere1=volt*amp1; putere2=volt*amp2; total_putere1=putere1+total_putere1; total_putere2=putere2+total_putere2;} if (buttonState == LOW) { lcd.backlight(); } else lcd.noBacklight(); if(currentMillis1 - previousMillis1 > interval1) { previousMillis1 = currentMillis1; if(buttonPushCounter==1){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Battery Voltage"); lcd.setCursor(0,1); lcd.print(volt); lcd.print(" V");} if(buttonPushCounter==2){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Solar Current"); lcd.setCursor(0,1); lcd.print(amp1); lcd.print(" A");} if(buttonPushCounter==3){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Pump Current"); lcd.setCursor(0,1); lcd.print(amp2); lcd.print(" A");} if(buttonPushCounter==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Solar Energy"); lcd.setCursor(0,1); lcd.print(energie1); lcd.print(" Wh");} if(buttonPushCounter==5){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Pump Energy"); lcd.setCursor(0,1); lcd.print(energie2); lcd.print(" Wh");} if(buttonPushCounter==6){ lcd.clear(); if(volt>12.6){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("100"); lcd.print("%");} if(volt<12.45 && volt>12.21){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("80"); lcd.print("%");} if(volt<12.20 && volt>11.91){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("60"); lcd.print("%");} if(volt<11.90 && volt>11.60){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("40"); lcd.print("%");} if(volt<11.59){ lcd.clear(); lcd.setCursor(0,1); lcd.write(2); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(0); lcd.write(1); lcd.setCursor(0,0); lcd.print("State Of Charge"); lcd.setCursor(6,1); lcd.print("20"); lcd.print("%");}} if(buttonPushCounter>6) buttonPushCounter=1;} if (buttonState != lastButtonState) { if (buttonState == HIGH) { buttonPushCounter++;}} lastButtonState = buttonState; media_puteri1=total_putere1/timp; energie1=media_puteri1*timp/3600; media_puteri2=total_putere2/timp; energie2=media_puteri2*timp/3600; }
  25. adalloul

    TinyGPS++ with MSP430F5529

    I would like to know if anyone used the Sparkfun GPS logger on MSP430. The example used by the library from Github is legit for arduino only 3.3v, rx, tx, and ground. When we connect them to MSP430 it doesn't work.
×