Jump to content
43oh

nemetila

Members
  • Content Count

    45
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    nemetila got a reaction from bluehash in Elecrow promotion (max $6) until 31 May 2014   
    There is a promotion on the new Elecrow website.
    There are 3 ways ($6) to join in this activity for new members of Elecrow website and
    2 ways ($4) for customers who already have Elecrow account.
     
    register as a new customer in Elecrow; (+$2) share their blog to one of the social media such as facebook, twitter, or google+; (+$2) share their blog to a discuss platform such as the forum; (+$2) Here are the details: link.
     
     
    The above promotion is limited in time (31 May 2014), but they have a not time limited promotion too:
    write a review ($0.2) or/and upload images ($0.3) or/and videos ($0.5) of your order (if you do all of them, they will give the highest one, for example: if you write a review and upload an image in the same time, you will get 30 points instead of 20+30 points).
  2. Like
    nemetila got a reaction from biza in LCD backlight off   
    There are 3.3V and 5V type LCDs.
    If you use 5V type LCD, the LCD LED forward voltage might be higher than 4V (for example 4.1V).
    This is higher than your LaunchPad Vcc voltage (3.4V). I think It wont work unless you get 5V from the LauncPad or from an external supply.
     
     
    Backlight on/off (with 3.3V LCD)
    an example:
    connect: LCD_VLED  --> Vcc connect: LCD_VLSS ---> current limiter resistor pin(1) connect: current limiter resistor pin(2) --> N_MOSFET(logic level type) drain connect: N_MOSFET(logic level type) source --> Gnd connect: N_MOSFET(logic level type) gate --> any MSP430 I/O pin This solution might be improved with additional resistors.
  3. Like
    nemetila got a reaction from bluehash in MSP-EXP430FR5739 Accelerometer demo with PC GUI   
    Hi!
     

     
    I am developing a simple accelerometer with the MSP-EXP430FR5739. This board is populated with a 3-axis accelerometer: ADXL330. No additional HW is needed.
     
    The MCU program does:
    ADC:Samples data from CH_0 to CH_14 in Repeat-Sequence-of-Channels Mode Sample Rate: ~ 20 Hz/Channel DMA UART:HW UART (TX only) with 9600 baud. This 9600 baud is limited by the emulator circuit. UART TX data1 = ADC_CH_12 = ACC_X;   sample "622-X" UART TX data2 = ADC_CH_13 = ACC_Y;   sample "509-Y" UART TX data3 = ADC_CH_14 = ACC_Z;   sample "511-Z" LEDs: LED_TX and LED_ADC  
    The PC application does:
    Calculate the 3 acceleration components (g_x, g_y, g_z) from the ADC data and the CALIBRATION data Calculate the magnitude of G; |G| = sqrt(g_x^2 + g_y^2 + g_z^2); Displays data CALIBRATION data must be enter by the user once at the beginning. The user has to rotate slowly the board in every 3 direction (and opposite) to find the maximum (+1g) and the minimum (-1g) ADC values of the 3 axis. Enter this 3*2=6 ADC data to the 6 white textboxes. If the CALIBRATION data are correct then |G| must be 1.00 (static acceleration of gravity).
    .
     
    The TX data can be viewed with putty too:

     
     
    Requirements:
    MSP-EXP430FR5739 board Code Composer Studio 5.4 to compile the MCU source file:ACC Demo v03_main.c Windows OS with .Net framework 4 to run the PC app: ACC Demo v03_Release.zip (extract and run "ACC Demo v03.exe"). 
     
    The CPU usage may be high when PC application receives data. I will try to reduce this in the next version.
  4. Like
    nemetila got a reaction from sgccarey in MSP-EXP430FR5739 Accelerometer demo with PC GUI   
    Hi!
     

     
    I am developing a simple accelerometer with the MSP-EXP430FR5739. This board is populated with a 3-axis accelerometer: ADXL330. No additional HW is needed.
     
    The MCU program does:
    ADC:Samples data from CH_0 to CH_14 in Repeat-Sequence-of-Channels Mode Sample Rate: ~ 20 Hz/Channel DMA UART:HW UART (TX only) with 9600 baud. This 9600 baud is limited by the emulator circuit. UART TX data1 = ADC_CH_12 = ACC_X;   sample "622-X" UART TX data2 = ADC_CH_13 = ACC_Y;   sample "509-Y" UART TX data3 = ADC_CH_14 = ACC_Z;   sample "511-Z" LEDs: LED_TX and LED_ADC  
    The PC application does:
    Calculate the 3 acceleration components (g_x, g_y, g_z) from the ADC data and the CALIBRATION data Calculate the magnitude of G; |G| = sqrt(g_x^2 + g_y^2 + g_z^2); Displays data CALIBRATION data must be enter by the user once at the beginning. The user has to rotate slowly the board in every 3 direction (and opposite) to find the maximum (+1g) and the minimum (-1g) ADC values of the 3 axis. Enter this 3*2=6 ADC data to the 6 white textboxes. If the CALIBRATION data are correct then |G| must be 1.00 (static acceleration of gravity).
    .
     
    The TX data can be viewed with putty too:

     
     
    Requirements:
    MSP-EXP430FR5739 board Code Composer Studio 5.4 to compile the MCU source file:ACC Demo v03_main.c Windows OS with .Net framework 4 to run the PC app: ACC Demo v03_Release.zip (extract and run "ACC Demo v03.exe"). 
     
    The CPU usage may be high when PC application receives data. I will try to reduce this in the next version.
  5. Like
    nemetila reacted to PedroDaGr8 in 40 Male->Female jumpers - $3.99   
    But of course!









  6. Like
    nemetila got a reaction from hongphuc6789 in Using Stellaris Launchpad as a Thermometer   
    Hi,   Here is my first project with Stellaris Launchpad. This is a very simple thermometer, that uses the internal temperature sensor of the Stellaris MCU for temperature measuring, and the UART_0 module for sending data to a PC application. The PC application displays the current temperature in °C numerically and graphically (acts as a logger).     Short Description:   In every two seconds the MCU:
    measures the temperature with ADC:ADC with 4 Samples and FIFO Depth Each FIFO with 64X Hardware Sample Averaging ADC Speed: 250 KS/s calculates the average and the temperature data in °C:Only integer math is used sends data to the PC:UART_0 module, TX only Baud Rate 115200 kbit/s Data format: „C”         -> real temp 23.56978°C        Data format: „dC”       -> real temp 23.56978°C        sent data: „236dC” Data format: „cC”       -> real temp 23.56978°C        sent data: „2357cC” and then enters to hibernation:Hibernation reduces self heating Wake from hibernation by RTC or WAKE_PIN  
    LED indicators:
    BLUE:  start from cold reset GREEN: start from hibernation by RTC (indicates run mode) RED: start from hibernation by WAKE_PIN  
    Source Code:
     
    I used CCS 5.3 with StellarisWare to create the source code. Here is the full project:Stellaris_v01.zip
    Install CCS 5 and StellarisWare.
    Download and extract the *.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".
    Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.
     
     
    I developed the PC application in C# with Visual Studio 2012, in Windows 8. The release files:
    Release.zip
     
    I updated my PC application. New features:
    error corrections users can select between Celsius [°C] and Fahrenheit [°F] temperature scale The release files: http://forum.stellarisiti.com/index.php?app=core&module=attach&section=attach&attach_id=309
     
    The source files: https://copy.com/4DkJpd4O49ky
     
     
    Requirements:
    Stellaris LM4F120 LaunchPad (no additional hardware is needed) Windows OS with .NET Framework 4 (for PC app.)  
    A firmware for the MSP430 LaunchPad (MSP430G2553) with additional features(selectable averaging, supply voltage mesurement) is also available to the same PC application.
    The source code: main.c

     
    Important notes:
    „Getting Started with the Stellaris ® EK-LM4F120XL LaunchPad Workshop”: "Code Composer Studio has some issues connecting to hibernating devices (and reconnecting) since they essentially power off in the middle of the debugging process.We’ll try to step around those issues, but you may see CCS terminate abruptly. If this
    happens, you can restart CCS and try again, or you can use the LM Flash Programmer to reprogram the device with the qs-rgb (non-hibernation) program. In either case, you need to hold SW2 down to keep the LM4F device awake in order for either tool to connect."
    I am new to ARM(Stellaris).
    Some of the hibernation API functions is not clear to me.
    Sorry for my English 
    Regards,
    Laszlo
     
    Updated: 02 June 2014
  7. Like
    nemetila reacted to BravoV in FREE TI Launchpad ... hurry !   
    UPDATE : It looks like the coupon code is no longer valid.
    -- ADMIN EDIT--

    Below is a statement from TI.
     
     
     --ADMIN EDIT
    Ok, not actually free, but I think this deal should be good enough for everybody, just see for yourself my invoice below, not bad eh ? 
     
    A 25$ coupon code from Texas Instruments.

    Coupon code: National-1yr
    Its valid until 30-September.
    https://estore.ti.com
     
    Ordered two EK-TM4C123GXL launchpads for just $0.98 and with free shipping ! 
     

  8. Like
    nemetila got a reaction from semicolo in how read the battery voltage   
    Based on the MSP430G2553 datasheet, the 1.5V ref requires Vcc>= 2.2V and the 2.5V ref requires Vcc >= 2.9V to operate.
     
    If your Vcc is below 2.9V you can't use 2.5V ref. So this code first uses the 1.5V ref to check Vcc.
     
  9. Like
    nemetila got a reaction from Automate in New MSP430F5529 USB Launchpad Released   
    It was new to me.
     
    More info on ti.com :http://www.ti.com/tool/MSP-EXP430F5529LP
    and on wiki.ti: http://processors.wiki.ti.com/index.php/MSP430F5529_LaunchPad
     
    Price: $12.99(US$) 
     

     
    Features
    USB 2.0-enabled MSP430F5529 16-bit MCU Up to 25 MHz 128KB Flash and 8KB RAM 12 Bit SAR ADC Various USB device class examples and libraries available (CDC, HID, MSC) eZ-FET lite: Open source onboard debugger with application UART One USB connection for emulator and target via the use of an onboard USB hub USB as power source: 5V and 3.3V through a high efficiency DC/DC converter 40 pin LaunchPad standard leveraging the BoosterPack ecosystem 
  10. Like
    nemetila reacted to rampadc in New MSP430F5529 USB Launchpad Released   
    Did you guys notice TI's selling their new MSP430F5529 USB Launchpad board? I found an old announcement back in 2012 on 43oh main page that TI's working on it but haven't seen any on it being sold. I just found out today and apparently it's sold out. :-(
     
    TI also changed the descriptor tool by making the interface a bit prettier but they removed the definition USB_MCLK_FREQ which will break all the code in their last USB API so now there's a new USB API 4.0 that requires CCS 5.5 to be installed, though there are workarounds so it will work with existing CCS. 
  11. Like
    nemetila got a reaction from pine in LAUNCHXL-F28027 - C2000 Piccolo LaunchPad Deal - $8.50   
    Happy 1st birthday, C2000 Piccolo LaunchPad:
    https://estore.ti.com/LAUNCHXL-F28027-C2000-Piccolo-LaunchPad-P3088.aspx
  12. Like
    nemetila got a reaction from dubnet in LAUNCHXL-F28027 - C2000 Piccolo LaunchPad Deal - $8.50   
    Happy 1st birthday, C2000 Piccolo LaunchPad:
    https://estore.ti.com/LAUNCHXL-F28027-C2000-Piccolo-LaunchPad-P3088.aspx
  13. Like
    nemetila got a reaction from bluehash in LAUNCHXL-F28027 - C2000 Piccolo LaunchPad Deal - $8.50   
    Happy 1st birthday, C2000 Piccolo LaunchPad:
    https://estore.ti.com/LAUNCHXL-F28027-C2000-Piccolo-LaunchPad-P3088.aspx
  14. Like
    nemetila got a reaction from Automate in LAUNCHXL-F28027 - C2000 Piccolo LaunchPad Deal - $8.50   
    Happy 1st birthday, C2000 Piccolo LaunchPad:
    https://estore.ti.com/LAUNCHXL-F28027-C2000-Piccolo-LaunchPad-P3088.aspx
  15. Like
    nemetila reacted to xpg in Eclipse plugin for mspdebug and msp430-gcc   
    Hi guys,

    I've finally hacked together a plugin for Eclipse that allows the msp430-gcc toolchain to be used from within Eclipse more easily.
    I must warn you that this is by no means finished, but I wanted to get it out there to get some opinions before I spend too much time on it.

    Features and Limitations:

    - Supports msp430-gcc macro and include directory discovery (though msp430-gcc must be in your PATH).
    - Extracts list of supportet MCUs from msp430-gcc, and allows target MCU to be easily selected and changed.
    - Use mspdebug to upload to target (only Launchpad is supported and the device is autodetected).
    - Only Linux and Windows are supported at this point.
    - Binary toolchains are provided for Linux and Windows, in order to ease installation.

    Changelog:
    1.0.5.1

    -Added Windows support.
    -Added dependency on "Target Management Terminal".
    -Add .cpp as C++ extension.
    -Support for FRAM board (by using a newer version of mspdebug).
    -Fix a bug: mspdebug fails to startup successfully for debugging session.
    -Group MCU List to make selection easier.
    -Remove usage of stdbuf.
    -Simplify tool selection by adding an "Activate"-button to the tool manager.
    -Add support for static libraries (project type).
    -Kill mspdebug when debugger is stopped.
    -"tilib" to the mspdebug driver selection.
     
    1.0.4.1
    -gcc, gdb, and mspdebug are no longer distributed as an eclipse plugin, but as a separate download package. This allows the tools to be installed in a user select location, rather than trying to install into the eclipse directory.
    -MSP430 C/C++ projects can now be created.
    -The protocol (SBW, JTAG) used by MSPDebug can now be selected.
     
    Installation:
    Add http://eclipse.xpg.dk as a software source in Eclipse, and install the Msp430Eclipse plugin.
    Currently, only Indigo is supported, but the plugin might work with Helios and Juno as well.

    If your system does not have up-to-date version of msp430-gcc, msp430-gdb, and mspdebug, you can download one of the following tool-packages:

    Linux 64-bit: msp430-toolchain-linux-amd64-3.0.tar.bz2
    Linux 32-bit: msp430-toolchain-linux-i386-2.1.tar.bz2
    Windows 32-bit: msp430-toolchain-win-x86-3.0.zip
    Mac OS X: msp430-toolchain-mac_os_x-x86_64-2.2.tar.bz2

    Extract the package in an appropriate location ($HOME, for instance), and go to Eclipse (with the MSP430Eclipse plugin installed), and from the menu select MSP430->Tool Manager. Click the "Add..."-button, and browse to the tool-package directory. Select the tool-chain and press the "Activate"-button in order to tell Eclipse to use it.

    You can verify that the right tool-package is used by going to the Eclipse preference and select "MSP430". Here you will be able to see and choose what tools are used from which package.

    For windows, you will need to install USB-drivers as described in the MSPDebug FAQ.

    Getting Started:
    In order to use the MSP430 features, you have to create a new C project and choose "Empty Project" from the "MSP430 Cross Target Application" group. It is possible to select the target MCU from the wizard, but this does currently not work.

    After having created the project, right click on it and select properties. In the "MSP430"-setting it is possible to select the target MCU. Remember to press "Apply" in order for the selection to take effect.

    After having added some source files and compiled the project, you can upload it to the MSP430 by choosing the MSP430-menu, and selecting the "Upload to target action"

    Using the Debugger
    In order to debug your program, go to the "Debug Configuration"-dialog, and create a new configuration in the "MPS430 Debug"-group (by right-clicking it). Having that new configurations elected, simply click "Debug".
     
    For people interested in hacking on the source code of msp430Eclipse, it is available at gitorious: https://gitorious.org/msp430eclipse
     

    Updated September 3rd: New version released (1.0.5.1), updated description
    Updated April 23rd 2013: Links to toolchains updated.
    Updated April 25th 2013: Added link to gitorious project.
  16. Like
    nemetila got a reaction from bluehash in Using Stellaris Launchpad as a Thermometer   
    You need to add or link the following  files to your project. You can find them in the utils folder of Stellarisware. Right click on your project and click add files.
    - Uartstdio.c
     
    Or use this methode:
    Install CCS 5 and StellarisWare.
    Download and extract the Stellaris_v01.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".
    Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.
  17. Like
    nemetila got a reaction from assad in Using Stellaris Launchpad as a Thermometer   
    You need to add or link the following  files to your project. You can find them in the utils folder of Stellarisware. Right click on your project and click add files.
    - Uartstdio.c
     
    Or use this methode:
    Install CCS 5 and StellarisWare.
    Download and extract the Stellaris_v01.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".
    Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.
  18. Like
    nemetila got a reaction from RobG in nrf24L01 registers/commands and functions(work in progress)   
    Thank you Spirilis your awesome work.  :thumbup:
     
    I tested your code (msprf24) with my MSP430 Launchpad (MSP430G2553) and my Stellaris LaunchPad (Enrf24). It works great.
    I have a MSP-EXP430FR5739 too, so I added support for it (msprf24). Only RF24_SPI_DRIVER_USCI_B is supported now.
    I used MSP-EXP430FR5739@8MHz as PTX and MSP430G2553@16MHz as PRX. It works. Here is my modified msprf24.c file.
     
    I read somewhere that Auto ACK doesn't work at 250kBs air data rate. I tested your code at 250kBs and 1MBs and in both cases the auto ACK worked well (ch = 0, max TX power). I have this cheap modules from eBay: http://www.ebay.com/itm/2PCS-Arduino-NRF24L01-2-4GHz-Wireless-Transceiver-Module-New-/170819064718?pt=LH_DefaultDomain_0&hash=item27c59c138e
     
    At 1MBs the distance limit is about 40feet with 1-2 walls.
    I will test the limit at 250kBs too.
     
    -------------------------------------------------------------------------------------------------------------------------------------------
    Update1:
    I have done the distance limit test at 250 kBs. The limit is exactly the same as it was at 1MBs. I dont know why.
     
    ------------------------------------------------------------------------------------------------------------------------------------------
    Update2:
    I used TA0 on PTX to measure T_ESB(Time Enhanced Shock-Burst
  19. Like
    nemetila reacted to spirilis in nrf24L01 registers/commands and functions(work in progress)   
    Official release, sans documentation for the moment-
     
    https://github.com/spirilis/msprf24
     
     
    Lots of cleanup/changes compared to that .zip file, which I'm going to purge for now (no copyright notice on those files). It's a permissive ISC license. The docs are going to be on the github wiki.
  20. Like
    nemetila got a reaction from Rei Vilo in Using Stellaris Launchpad as a Thermometer   
    Hi,   Here is my first project with Stellaris Launchpad. This is a very simple thermometer, that uses the internal temperature sensor of the Stellaris MCU for temperature measuring, and the UART_0 module for sending data to a PC application. The PC application displays the current temperature in °C numerically and graphically (acts as a logger).     Short Description:   In every two seconds the MCU:
    measures the temperature with ADC:ADC with 4 Samples and FIFO Depth Each FIFO with 64X Hardware Sample Averaging ADC Speed: 250 KS/s calculates the average and the temperature data in °C:Only integer math is used sends data to the PC:UART_0 module, TX only Baud Rate 115200 kbit/s Data format: „C”         -> real temp 23.56978°C        Data format: „dC”       -> real temp 23.56978°C        sent data: „236dC” Data format: „cC”       -> real temp 23.56978°C        sent data: „2357cC” and then enters to hibernation:Hibernation reduces self heating Wake from hibernation by RTC or WAKE_PIN  
    LED indicators:
    BLUE:  start from cold reset GREEN: start from hibernation by RTC (indicates run mode) RED: start from hibernation by WAKE_PIN  
    Source Code:
     
    I used CCS 5.3 with StellarisWare to create the source code. Here is the full project:Stellaris_v01.zip
    Install CCS 5 and StellarisWare.
    Download and extract the *.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".
    Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.
     
     
    I developed the PC application in C# with Visual Studio 2012, in Windows 8. The release files:
    Release.zip
     
    I updated my PC application. New features:
    error corrections users can select between Celsius [°C] and Fahrenheit [°F] temperature scale The release files: http://forum.stellarisiti.com/index.php?app=core&module=attach&section=attach&attach_id=309
     
    The source files: https://copy.com/4DkJpd4O49ky
     
     
    Requirements:
    Stellaris LM4F120 LaunchPad (no additional hardware is needed) Windows OS with .NET Framework 4 (for PC app.)  
    A firmware for the MSP430 LaunchPad (MSP430G2553) with additional features(selectable averaging, supply voltage mesurement) is also available to the same PC application.
    The source code: main.c

     
    Important notes:
    „Getting Started with the Stellaris ® EK-LM4F120XL LaunchPad Workshop”: "Code Composer Studio has some issues connecting to hibernating devices (and reconnecting) since they essentially power off in the middle of the debugging process.We’ll try to step around those issues, but you may see CCS terminate abruptly. If this
    happens, you can restart CCS and try again, or you can use the LM Flash Programmer to reprogram the device with the qs-rgb (non-hibernation) program. In either case, you need to hold SW2 down to keep the LM4F device awake in order for either tool to connect."
    I am new to ARM(Stellaris).
    Some of the hibernation API functions is not clear to me.
    Sorry for my English 
    Regards,
    Laszlo
     
    Updated: 02 June 2014
  21. Like
    nemetila reacted to tripwire in accuracy of the 2553's built in temperature sensor?   
    It looks like you're not using the temperature sensor calibration values stored in info A on the 2553. I'm not sure if that's sufficient to cause the inaccuracy you're seeing, but it's worth a shot.
     
    The calibration values are mentioned in chapter 24 of the MSP430x2xx Family User's Guide and also on page 15 of the 2553 datasheet:
     
    The temperature sensor is calibrated using the internal voltage references. At VREF2_5 = 0 and 1, the
    12-bit conversion result at 30
  22. Like
    nemetila got a reaction from ike in LaunchPad HD44780 LCD USB PC interface   
    Nice project Ike. 
     
    I tested it with MSP430G2553 and my 4x20 LCD. It worked great on my virtual machine (XP 32 bit), but i had some trouble on Windows 8 x64. In many cases LCDSmartie didn't start on 64 bit OS (probably the software uart connection was not stable between my MCU and the OS driver).
     
    Because my LCD has 4 lines and MSP430G2553 has HW UART, I added support for 4 lines LCDs in the plugin.dll, and I replaced the software uart with hardware uart in the MCU source code.
     
    Here is my full CCS project for the MCU:LCDSmartie_NL_v02.zip.
    (I used Code Composer Studio 5.3)
     
    And the source code for the plugin.dll: LcdSmartiePlugin.zip
    (I used VS 2012)
     
    Now it works well on both my virtual machine (32bit) and the native 64 bit OS.
    (On my virtual XP LCDSmartie reqires "msvcr110.dll" to run, so I had to download this file too.)
     
    (Don't forget to rotate the UART jumpers on the LaunchPad to the HW UART position!)
  23. Like
    nemetila reacted to ike in LaunchPad HD44780 LCD USB PC interface   
    Your post looks too spamy for a new user.
    I can't post.
     
    The above restrictions only apply to new users. We are constantly tweaking the definition of a new user to stop spam while not annoying real people. These restrictions currently apply to users who:
    *Have less than 1 post - now I have 3 post.
    *Registered in the last 24 hours - I'm not registered in the last 24 hours.
    The restrictions are automatically removed once an account meets these criteria.
     
    And I'm not spam bot.
    Now I'm happy. I can post again
     
     
    I want to apologize for leaving project unfinished. And I want to tank bluehash for its support on this project.
     
    This LaunchPad HD44780 LCD USB PC interface is composed of 4 parts. Hardware, MSP430 firmware, LCDSmartie software and driver for software.
     
    Hardware. I've struggle to find software that is intuitive to use, to make schemes. So I'll use ASCII.
     

    LaunchPad LCD TP 1 Outputs 5V from USB - Pin 2 and Pin15 5V Vcc Vcc- nc P1.0 - Pin 4 RS P1.1 - PC UART interface P1.2 - PC UART interface P1.3 - Pin 6 Enable P1.4 - Pin 11 DB4 P1.5 - Pin 12 DB5 P1.6 - Pin 13 DB6 P1.7 - Pin 14 DB7 GND - Pin 5 R/W, Pin 1 and Pin 16 GND Pin 3 Resistor* 1800 ohm to GND
     
    In my LCD display there is 100 ohm resistor in series with white LED, so I can safety connect Pin 15 to
    5V VCC and Pin 14 to GND.
    *On Pin 3 should be potentiometer 100k ohm to GND, but the exact value needed for my display is 1800 ohm (It's value depends of supply voltage, ambient temperature and manufacture ot LCD).
     
    MSP430 firmware
    There is a lot of room for improvment here
    Use TI Code Composer Studio v4 Core Edition to compile.
     
     
    LCDSmartie software can be downloaded for free from here: http://lcdsmartie.sourceforge.net/
     
    Driver.
    There is a lot of room for improvment here also.
    Use M$ Microsoft Visual Studio 2005 to compile.
     
    Steps to make LaunchPad HD44780 LCD USB PC interface work.
    1. Assemble hardware. Use inferior MCU MSP430G2211 that comes with LaunchPad
    2. Compile msp430g2211.c with TI Code Composer Studio v4 - at this point you should see "Hello" on LCD display
    3. Download and unzip LCDSmartie.
    4. Compile LCDS_Plugin.cpp and LCDS_Plugin.H with Use M$ Microsoft Visual Studio 2005, save
    plugin.dll to \lcd_smartie_v5.4\displays\ directory.
    5. Connect LaunchPad with PC and go to: Computer Management->System Tools->Device Manager->
    Ports(COM & LPT)->MSP430 Aplication UART (COMx) and note COM port. It shoud be like COM5 or COM13.
    6. Setup LCDSmartie.
    Screens-> Display settings->Screen->LCD size 2x16
    Screens-> Display settings->Plugin->Display Plugin: plugin.dll
    Screens-> Display settings->Plugin->Startup Parameters: \\.\COM5
    or if your MSP430 Aplication UART is at COM13
    Screens-> Display settings->Plugin->Startup Parameters: \\.\COM13
    Screens->Screens settings
    On first line: http://www.43oh.com RSS
    On second line: $Rss(http://feeds.feedburner.com/Four-three-oh?format=xml,b)
     
    Here is new version of driver LCDS_Plugin.cpp, it now accept different COM port setings.
    One again sorry for my lack of coding experience. I do it in my spare time as a hoby. And I really hate to write long posts.
    This is open source project so feel free to improve it and make it beter.
    If you have questions don't hesitate to ask, I'm sure that bluehash will be happy ot answer it
     
     

    #include "msp430g2211.h" #include "stdint.h" //------------------------------------------------------------------------------ // Hardware-related definitions //------------------------------------------------------------------------------ #define UART_TXD 0x02 // TXD on P1.1 (Timer0_A.OUT0) #define UART_RXD 0x04 // RXD on P1.2 (Timer0_A.CCI1A) //------------------------------------------------------------------------------ // Conditions for 9600 Baud SW UART, SMCLK = 1MHz //------------------------------------------------------------------------------ #define UART_TBIT_DIV_2 (1000000 / (9600 * 2)) #define UART_TBIT (1000000 / 9600) //------------------------------------------------------------------------------ // Global variables used for full-duplex UART communication //------------------------------------------------------------------------------ unsigned int txData; // UART internal variable for TX unsigned char rxBuffer; // Received UART character uint16_t CommandFlag; #define MAGIC 0x0f //------------------------------------------------------------------------------ //LCD //------------------------------------------------------------------------------ #define LCD_MODE_BIT 0x01 //BIT0 #define LCD_ENABLE_BIT 0x08 //BIT3 #define LCD_CMD_MASK 0x09 #define LCD_DATA_MASK 0xf0 #define LCD_PORT_OUT P1OUT #define LCD_PORT_DIR P1DIR int putchar( uint16_t in ) { LCD_PORT_OUT= ( in & 0xf0 ) | LCD_MODE_BIT; LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; // LCD_PORT_OUT= ( ( in << 4 ) & 0xf0 ) | LCD_MODE_BIT; LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; __no_operation(); //LCD_PORT_OUT= 0; __delay_cycles( 200 ); return (0); } void lcd_command( uint16_t cmd ) { LCD_PORT_OUT= ( cmd & 0xf0 ); LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; // LCD_PORT_OUT= ( ( cmd << 4 ) & 0xf0 ); LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; __no_operation(); //LCD_PORT_OUT= 0; __delay_cycles( 3000 ); } //------------------------------------------------------------------------------ // Function prototypes //------------------------------------------------------------------------------ void TimerA_UART_init(void); void TimerA_UART_tx(unsigned char byte); void TimerA_UART_print(char *string); //------------------------------------------------------------------------------ // main() //------------------------------------------------------------------------------ void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer DCOCTL = 0x00; // Set DCOCLK to 1MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //P1OUT = 0x00; // Initialize all GPIO P1SEL = UART_TXD + UART_RXD; // Timer function for TXD/RXD pins P1DIR = 0xFF & ~UART_RXD; // Set all pins but RXD to output //P2OUT = 0x00; //P2SEL = 0x00; //P2DIR = 0xFF; //lcd //LCD_PORT_OUT= 0; LCD_PORT_DIR|= LCD_DATA_MASK | LCD_CMD_MASK; //don't assume VCC+ > 20ms away __delay_cycles(1000000); //first init LCD_PORT_OUT= 0x30; LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; //pause should be set by mclk div, > 4.1ms __delay_cycles( 15000 ); //second init LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; //pause should be set by mclk div, > 100us __delay_cycles( 500 ); //four bit mode LCD_PORT_OUT= 0x20; LCD_PORT_OUT|= LCD_ENABLE_BIT; __no_operation(); LCD_PORT_OUT&= ~LCD_ENABLE_BIT; __delay_cycles( 1000 ); //from here 'lcd_command can be used //operational mode 5x8 1/16 duty( two lines ) lcd_command( 0x28 ); __delay_cycles( 1000 ); //display off lcd_command( 0x08 ); __delay_cycles( 1000 ); //display on, no cursor, no blink... lcd_command( 0x0c ); __delay_cycles( 1000 ); //LCD_PORT_OUT= 0; putchar ('H'); putchar ('e'); putchar ('l'); putchar ('l'); putchar ('o'); __enable_interrupt(); TimerA_UART_init(); // Start Timer_A UART TimerA_UART_print("G2xx1 TimerA UART\r\n"); TimerA_UART_print("READY.\r\n"); //for (;;)TimerA_UART_print("12345678901234567890123456789012345678901234567890123456789012345678901234567890"); for (; { // Wait for incoming character __bis_SR_register(LPM0_bits); if(rxBuffer!=MAGIC){ if(CommandFlag!=1){putchar(rxBuffer);} else{CommandFlag=0;lcd_command(rxBuffer);} } else{ CommandFlag=1;} // Update board outputs according to received byte // if (rxBuffer & 0x01) P1OUT |= 0x01; else P1OUT &= ~0x01; // P1.0 // if (rxBuffer & 0x02) P1OUT |= 0x08; else P1OUT &= ~0x08; // P1.3 // if (rxBuffer & 0x04) P1OUT |= 0x10; else P1OUT &= ~0x10; // P1.4 // if (rxBuffer & 0x08) P1OUT |= 0x20; else P1OUT &= ~0x20; // P1.5 // if (rxBuffer & 0x10) P1OUT |= 0x40; else P1OUT &= ~0x40; // P1.6 // if (rxBuffer & 0x20) P1OUT |= 0x80; else P1OUT &= ~0x80; // P1.7 // if (rxBuffer & 0x40) P2OUT |= 0x40; else P2OUT &= ~0x40; // P2.6 // if (rxBuffer & 0x80) P2OUT |= 0x80; else P2OUT &= ~0x80; // P2.7 // Echo received character //TimerA_UART_tx(rxBuffer); } } //------------------------------------------------------------------------------ // Function configures Timer_A for full-duplex UART operation //------------------------------------------------------------------------------ void TimerA_UART_init(void) { TACCTL0 = OUT; // Set TXD Idle as Mark = '1' TACCTL1 = SCS + CM1 + CAP + CCIE; // Sync, Neg Edge, Capture, Int TACTL = TASSEL_2 + MC_2; // SMCLK, start in continuous mode } //------------------------------------------------------------------------------ // Outputs one byte using the Timer_A UART //------------------------------------------------------------------------------ void TimerA_UART_tx(unsigned char byte) { while (TACCTL0 & CCIE); // Ensure last char got TX'd TACCR0 = TAR; // Current state of TA counter TACCR0 += UART_TBIT; // One bit time till first bit TACCTL0 = OUTMOD0 + CCIE; // Set TXD on EQU0, Int txData = byte; // Load global variable txData |= 0x100; // Add mark stop bit to TXData txData <<= 1; // Add space start bit } //------------------------------------------------------------------------------ // Prints a string over using the Timer_A UART //------------------------------------------------------------------------------ void TimerA_UART_print(char *string) { while (*string) { TimerA_UART_tx(*string++); } } //------------------------------------------------------------------------------ // Timer_A UART - Transmit Interrupt Handler //------------------------------------------------------------------------------ #pragma vector = TIMERA0_VECTOR __interrupt void Timer_A0_ISR(void) { static unsigned char txBitCnt = 10; TACCR0 += UART_TBIT; // Add Offset to CCRx if (txBitCnt == 0) { // All bits TXed? TACCTL0 &= ~CCIE; // All bits TXed, disable interrupt txBitCnt = 10; // Re-load bit counter } else { if (txData & 0x01) { TACCTL0 &= ~OUTMOD2; // TX Mark '1' } else { TACCTL0 |= OUTMOD2; // TX Space '0' } txData >>= 1; txBitCnt--; } } //------------------------------------------------------------------------------ // Timer_A UART - Receive Interrupt Handler //------------------------------------------------------------------------------ #pragma vector = TIMERA1_VECTOR __interrupt void Timer_A1_ISR(void) { static unsigned char rxBitCnt = 8; static unsigned char rxData = 0; switch (__even_in_range(TAIV, TAIV_TAIFG)) { // Use calculated branching case TAIV_TACCR1: // TACCR1 CCIFG - UART RX TACCR1 += UART_TBIT; // Add Offset to CCRx if (TACCTL1 & CAP) { // Capture mode = start bit edge TACCTL1 &= ~CAP; // Switch capture to compare mode TACCR1 += UART_TBIT_DIV_2; // Point CCRx to middle of D0 } else { rxData >>= 1; if (TACCTL1 & SCCI) { // Get bit waiting in receive latch rxData |= 0x80; } rxBitCnt--; if (rxBitCnt == 0) { // All bits RXed? rxBuffer = rxData; // Store in global variable rxBitCnt = 8; // Re-load bit counter TACCTL1 |= CAP; // Switch compare to capture mode __bic_SR_register_on_exit(LPM0_bits); // Clear LPM0 bits from 0(SR) } } break; } } //------------------------------------------------------------------------------

    #include #include "LCDS_Plugin.H" #define WIN32_LEAN_AND_MEAN #include "windows.h" #include "stdio.h" //#include "init.h" #define MAGIC 0xF //#define ComPort "\\\\.\\COM13" HANDLE hSerial; int error_handler(char* reason, char* file, int line){ printf("\n%s\nIn %s at line:%d\n",reason,file,line); return -1; } void init(void){} //int init_serial_port(void){ //hSerial = CreateFile(ComPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); // if (hSerial==INVALID_HANDLE_VALUE){ return error_handler("CreateFile INVALID_HANDLE_VALUE",__FILE__,__LINE__);} // //Comm settings // DCB serialInfo = {0}; // if (!GetCommState(hSerial,&serialInfo)){ return error_handler("GetCommState",__FILE__,__LINE__);} // serialInfo.DCBlength=sizeof(serialInfo); // serialInfo.BaudRate=CBR_9600; // //serialInfo.fBinary=TRUE; // serialInfo.Parity=NOPARITY; // //serialInfo.fOutxCtsFlow=FALSE; // //serialInfo.fOutxDsrFlow=FALSE; // //serialInfo.fDtrControl=DTR_CONTROL_DISABLE; // //serialInfo.fDsrSensitivity=FALSE; // //serialInfo.fOutX=FALSE; // //serialInfo.fInX=FALSE; // //serialInfo.fRtsControl=RTS_CONTROL_DISABLE; // //serialInfo.fAbortonerror=TRUE; // serialInfo.ByteSize=8; // serialInfo.StopBits=ONESTOPBIT; // SetCommState(hSerial, &serialInfo); // return 1; //} int sendLCD(char* ch){ DWORD byteSent = 0; while(byteSent != 1) //did we send every thing to the serial port? { //send to the serial port WriteFile(hSerial,ch,1,&byteSent,NULL); printf("."); } //Pause until break Sleep(5); return 1; } // +-----------------+ // ! DISPLAYDLL_Init ! // +-----------------+ //! Initializes the plugin. //! All initialization stuff goes there: opening and configuring IO ports, device detection and probing... //! Sets ok to 1 if initialization is successful, 0 otherwise. //! Returns an error message in case of failure, NULL otherwise. DLL_EXPORT(char *) DISPLAYDLL_Init(LCDS_BYTE size_x,LCDS_BYTE size_y,char *startup_parameters,LCDS_BOOL *ok) { init(); //if (init_serial_port()!=1){*ok=0; error_handler("init_serial_port error",__FILE__,__LINE__);} ; hSerial = CreateFile(startup_parameters, GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_WRITE_THROUGH, 0); if (hSerial==INVALID_HANDLE_VALUE) { *ok=0;return NULL; } //Comm settings DCB serialInfo = {0}; if (!GetCommState(hSerial,&serialInfo)){ *ok=0;return NULL;} serialInfo.DCBlength=sizeof(serialInfo); serialInfo.BaudRate=CBR_9600; //serialInfo.fBinary=TRUE; serialInfo.Parity=NOPARITY; //serialInfo.fOutxCtsFlow=FALSE; //serialInfo.fOutxDsrFlow=FALSE; //serialInfo.fDtrControl=DTR_CONTROL_DISABLE; //serialInfo.fDsrSensitivity=FALSE; //serialInfo.fOutX=FALSE; //serialInfo.fInX=FALSE; //serialInfo.fRtsControl=RTS_CONTROL_DISABLE; //serialInfo.fAbortonerror=TRUE; serialInfo.ByteSize=8; serialInfo.StopBits=ONESTOPBIT; SetCommState(hSerial, &serialInfo); //ininLCD(); // char i; char ch; // while(true) // { // sendLCD(&i); // i++; //printf("LOOP"); // } //ch=15; //sendLCD(&ch); //ch=1; //sendLCD(&ch); ch=15; sendLCD(&ch); ch=(unsigned char)1; sendLCD(&ch); //i=0; //while(i<16) //{ // ch=0+i; // sendLCD(&ch); // i++; //} *ok=1; return NULL; } // +-----------------------+ // ! DISPLAYDLL_DriverName ! // +-----------------------+ //! Returns the driver name. //! The driver name is used by the driver selection GUI to identify the driver. //! It's good practice to return a proper name and version for the driver so that //! it can be clearly identified (or else we would have to rely on the plugin name //! which is subject to modifications). DLL_EXPORT(char *) DISPLAYDLL_DriverName(void) { static char plugin_name[]="my_plugin"; return plugin_name; } // +------------------+ // ! DISPLAYDLL_Usage ! // +------------------+ //! Returns plugin usage hints. //! The usage text describes the main plugin parameters and how they are assembled //! in the parameter string (syntax indications). DLL_EXPORT(char *) DISPLAYDLL_Usage(void) { static char plugin_usage[]="my_plugin usage"; return plugin_usage; } // +------------------------------+ // ! DISPLAYDLL_DefaultParameters ! // +------------------------------+ //! Returns the plugin default parameters. //! The default parameters string is used as parameter string after the driver //! has been initialized. DLL_EXPORT(char *) DISPLAYDLL_DefaultParameters(void) { static char plugin_default_parameters[]="default"; return plugin_default_parameters; } // +------------------------+ // ! DISPLAYDLL_SetPosition ! // +------------------------+ //! Moves the display cursor at a given position. DLL_EXPORT(void) DISPLAYDLL_SetPosition(LCDS_BYTE x,LCDS_BYTE y) { char ch; ch=15; sendLCD(&ch); if (y==1){ ch=(unsigned char)127;} else{ch=(unsigned char)191;} ch+=x; sendLCD(&ch); } // +------------------+ // ! DISPLAYDLL_Write ! // +------------------+ //! Writes the given string on the display. //! The string is displayed at the current cursor position (see DISPLAYDLL_SetPosition). //! It is assumed that the cursor position has been set so that the string can fit. DLL_EXPORT(void) DISPLAYDLL_Write(char *str) { unsigned int i=0; while (str[i]!=0){ sendLCD(&str[i]); i++; } } // +--------------------------+ // ! DISPLAYDLL_SetBrightness ! // +--------------------------+ DLL_EXPORT(void) DISPLAYDLL_SetBrightness(LCDS_BYTE brightness) { } // +-----------------------+ // ! DISPLAYDLL_CustomChar ! // +-----------------------+ DLL_EXPORT(void) DISPLAYDLL_CustomChar(LCDS_BYTE chr,LCDS_BYTE *data) { } // +----------------------------+ // ! DISPLAYDLL_CustomCharIndex ! // +----------------------------+ DLL_EXPORT(LCDS_BYTE) DISPLAYDLL_CustomCharIndex(LCDS_BYTE index) { --index; if (0==index) index=8; return index; } // +-----------------+ // ! DISPLAYDLL_Done ! // +-----------------+ DLL_EXPORT(void) DISPLAYDLL_Done(void) { } // +--------------------+ // ! DISPLAYDLL_ReadKey ! // +--------------------+ DLL_EXPORT(LCDS_WORD) DISPLAYDLL_ReadKey(void) { return 0; } // +-------------------------+ // ! DISPLAYDLL_SetBacklight ! // +-------------------------+ DLL_EXPORT(void) DISPLAYDLL_SetBacklight(LCDS_BOOL light_on) { } // +------------------------+ // ! DISPLAYDLL_SetContrast ! // +------------------------+ DLL_EXPORT(void) DISPLAYDLL_SetContrast(LCDS_BYTE contrast) { } // +------------------------+ // ! DISPLAYDLL_PowerResume ! // +------------------------+ DLL_EXPORT(void) DISPLAYDLL_PowerResume(void) { } // +-------------------+ // ! DISPLAYDLL_SetGPO ! // +-------------------+ DLL_EXPORT(void) DISPLAYDLL_SetGPO(LCDS_BYTE gpo,LCDS_BOOL gpo_on) { } // +-------------------+ // ! DISPLAYDLL_SetFan ! // +-------------------+ DLL_EXPORT(void) DISPLAYDLL_SetFan(LCDS_BYTE t1,LCDS_BYTE t2) { }

    #ifndef LCDS_PLUGIN_H #define LCDS_PLUGIN_H #ifndef DLL_EXPORT #define DLL_EXPORT(type) extern "C" __declspec(dllexport) type __stdcall #endif typedef unsigned char LCDS_BYTE; typedef unsigned short LCDS_WORD; typedef unsigned char LCDS_BOOL; #endif
    software.rar

  24. Like
    nemetila got a reaction from bluehash in Using Stellaris Launchpad as a Thermometer   
    I think Moritz runs his application on WINDOWS 7 or WINDOWS Vista.
    In my first post my app runs on WINDOWS 8, and in post #12 it runs on WINDOWS 7.
     
    The visual appearance of the same application looks differently on different Windows OS, especially on WINDOWS 8.
    WINDOWS 8 looks plain and simple.
     
     
  25. Like
    nemetila got a reaction from oPossum in Using Stellaris Launchpad as a Thermometer   
    Hi,   Here is my first project with Stellaris Launchpad. This is a very simple thermometer, that uses the internal temperature sensor of the Stellaris MCU for temperature measuring, and the UART_0 module for sending data to a PC application. The PC application displays the current temperature in °C numerically and graphically (acts as a logger).     Short Description:   In every two seconds the MCU:
    measures the temperature with ADC:ADC with 4 Samples and FIFO Depth Each FIFO with 64X Hardware Sample Averaging ADC Speed: 250 KS/s calculates the average and the temperature data in °C:Only integer math is used sends data to the PC:UART_0 module, TX only Baud Rate 115200 kbit/s Data format: „C”         -> real temp 23.56978°C        Data format: „dC”       -> real temp 23.56978°C        sent data: „236dC” Data format: „cC”       -> real temp 23.56978°C        sent data: „2357cC” and then enters to hibernation:Hibernation reduces self heating Wake from hibernation by RTC or WAKE_PIN  
    LED indicators:
    BLUE:  start from cold reset GREEN: start from hibernation by RTC (indicates run mode) RED: start from hibernation by WAKE_PIN  
    Source Code:
     
    I used CCS 5.3 with StellarisWare to create the source code. Here is the full project:Stellaris_v01.zip
    Install CCS 5 and StellarisWare.
    Download and extract the *.zip file, then start CCS and use "Project"->"Import existing CCS Eclipse Project".
    Browse the extracted "Stellaris_v01" directory and click "Finish". Build Project then debug.
     
     
    I developed the PC application in C# with Visual Studio 2012, in Windows 8. The release files:
    Release.zip
     
    I updated my PC application. New features:
    error corrections users can select between Celsius [°C] and Fahrenheit [°F] temperature scale The release files: http://forum.stellarisiti.com/index.php?app=core&module=attach&section=attach&attach_id=309
     
    The source files: https://copy.com/4DkJpd4O49ky
     
     
    Requirements:
    Stellaris LM4F120 LaunchPad (no additional hardware is needed) Windows OS with .NET Framework 4 (for PC app.)  
    A firmware for the MSP430 LaunchPad (MSP430G2553) with additional features(selectable averaging, supply voltage mesurement) is also available to the same PC application.
    The source code: main.c

     
    Important notes:
    „Getting Started with the Stellaris ® EK-LM4F120XL LaunchPad Workshop”: "Code Composer Studio has some issues connecting to hibernating devices (and reconnecting) since they essentially power off in the middle of the debugging process.We’ll try to step around those issues, but you may see CCS terminate abruptly. If this
    happens, you can restart CCS and try again, or you can use the LM Flash Programmer to reprogram the device with the qs-rgb (non-hibernation) program. In either case, you need to hold SW2 down to keep the LM4F device awake in order for either tool to connect."
    I am new to ARM(Stellaris).
    Some of the hibernation API functions is not clear to me.
    Sorry for my English 
    Regards,
    Laszlo
     
    Updated: 02 June 2014
×
×
  • Create New...