veryalive reacted to agaelema in Using SD16 of MSP430F2013 as an I2C ADC
I wrote an article (in Portuguese) about how to use the SD16 ADC of MSP43F2013, and to show one practical application I transformed the MSP430F2013 in an I2C 16-bit ADC, similar to ADS1115.
In the example, I read the data using one Arduino Nano.
Comparing the conversion of SD16 and ADS1115:
More details about the project can be found in my Github:
The project is open to further improvements/optimizations and functions.
veryalive reacted to energia in MSP432 Black suddenly gone from Energia
This board is indeed obsoleted. It was replaced by the RED board many years ago. The TI-RTOS version it was based on no longer receives updates. Hence, it was time to retire this.
If you still like access to this board then do the following:
Open Energia's preferences (File->Preferences or on macOS Energia->Preferences) Located "Additional Boards Manager URLs" and paste the following link into that field: https://energia.nu/packages/package_msp432_black_index.json Go to the board manager and you should see the black board appear again. Good luck with your Robot project.
veryalive reacted to zeke in tiny msp430 preemptive multitasking system
We have to unpack all that is going on in that get stack pointer statement.
The function getstackpointer() returns a value. The (int*) transforms that into “the address of that return value” which will be 16 bits large. Then that 16 bit address is assigned to the multi stack variable.
The author is asking us to modify the list of function names in the taskpnt function since (s)he doesn’t know what we will be doing. So that is up to us.
So task1, task2, and so on, are functions that we write to do one specific thing. Something atomic, like SwitchOnLED(LED1) or SwitchGPIO(P1-7), etc.
Does that make sense?
veryalive reacted to zeke in tiny msp430 preemptive multitasking system
They are called Function Pointer Arrays.
I love them. I have been using them extensively to create my CLI - Command Line Interpreter. I can add a new command just by defining a new entry into an array.
They are an alternative to the Gigantic Switch Statement style of coding.
To get you started, here is an article from 1999 by Nigel Jones:
How to Create Jump Tables via Function Pointer Arrays in C and C++
I also found the book Programming Embedded Systems in C and C++ by Michael Barr to be exceptionally helpful. Chapter nine specifically.
veryalive reacted to LIJsselstein in MSP30FR2433: SLEEP command not working correctly
I think this is because, when there is no external XTAL connected, Energia (wiring) usually falls back to the VLO source (~12k Hz). But on the FR2433 the clock falls back to the REFO source which runs about 3x faster ( ~32768 Hz).
However the code in wiring.h does not reflect this. Please look around line 144 in wiring.c (hardware/energia/msp430/cores/msp430/wiring.c):
/* ACLK = VLO = ~ 12 KHz */ vlo_freq = 8000; /* Source ACLK from REFO */ CSCTL4 |= SELA__REFOCLK; Where I think it should be:
/* ACLK = REFO = ~ 32 KHz */ vlo_freq = 32768; /* Source ACLK from REFO */ CSCTL4 |= SELA__REFOCLK; Since Sleep() uses the clock for timing and Delay() uses the CPU frequency for timing, this could explain your difference.
veryalive reacted to energia in MSPflash do not work on MSP4305969
As you can see from the Sketch, count is attributed with PLACE_IN_FRAM. Same for mydata which is of type struct data. This makes it "persistent". PLACE_IN_FRAM is defined as __attribute__((section(".text"))) at the top of the Sketch.
veryalive reacted to Fmilburn in Hello World using CogLCD
The suggestion from @@energia worked for me.
I used the same pins that are in the example, remembering that +5V is labelled VBUS and is pin 21 on the Tiva LaunchPad.
The circuit: ================================= LCD pin Connect to --------------------------------- 01 - GND GND, pot 02 - VCC +5V (VBUS), pot 03 - Contrast Pot wiper 04 - RS Pin8 05 - R/W GND 06 - EN Pin9 07 - DB0 GND 08 - DB1 GND 09 - DB2 GND 10 - DB3 GND 11 - DB4 Pin10 12 - DB5 Pin11 13 - DB6 Pin12 14 - DB7 Pin13 15 - BL+ +5V (VBUS) 16 - BL- GND ================================= Also, instantiate with the pin numbers
// initialize the library with the numbers of the interface pins LiquidCrystal lcd(8, 9, 10, 11, 12, 13); To use the LiquidCrystal library copy it from the MSP430 libraries over to the lm4f libraries. On my Windows machine with Energia v17 that would be C:\energia-0101E0017\hardware\msp430\libraries\LiquidCrystal to C:\energia-0101E0017\hardware\lm4f\libraries\LiquidCrystal
EDIT: A better title for this is "Using LCDs with the HD44780 controller on Tiva C Series Launchpads"
I'm using Energia v17, LaunchPad is EK-TM4C123GXL REV A
Also works with Energia v17 and the MSP432-EXP432R401R Rev1.0
veryalive reacted to Rei Vilo in iMeter BoosterPack
The iMeter BoosterPack features the INA226, an iteration of the INA219 I've been using in various projects like the I²C Voltage-Current-Power INA219 Sensor and the Volt-Amp-Watt-Meter for Grove.
Compared to the INA219, the INA226 operates on the same I²C bus but can now perform the measures on the high- or low-side, when the INA219 could only measure on the high-side.
The library for Energia was then easy to develop thanks to the prior experience with the INA219.
I tested the iMeter BoosterPack on a MSP430FR4133 LaunchPad and a MSP430FR6989 LaunchPad with the built-in segmented LCD, leveraging the alpha-numeric LCD to display the units and the buttons to select the different measures (V, A, W) and toggle between units (V, mV).
INA219 Review INA226 BoosterPack full review Library for Energia
veryalive reacted to Peabody in New polling and pin-interrupt routines for rotary encoders
I worked on a new servicing routine for my kit oscilloscope's quadrature rotary encoder, and decided to write it all up and post it on Github. Included are routines for periodic polling and for pin-interrupt servicing. Hardware switch debouncing is not needed. The routines are for general use, but I wrote testing code for the MSP430G2231 installed on the Launchpad. The scope guys have used the "lookup table" state transition routine that most people use today, but it doesn't work very well on the scope, and I haven't found it to work very well generally. My routines are designed to avoid all effects of switch bouncing, and seem to work very well and efficiently.
Everything is explained in the PDF file in the repo. All the testing code is also included, both source code and executable hex files, and I'm afraid it's all in assembler. But I hope it wouldn't be too difficult to create Energia versions if anyone is interested. I've provided hex files for both types of encoders - those with the same number of pulses as detents per revolution, and those with half as many pulses as detents. The code produces one "tick" per detent in both cases.
veryalive reacted to agaelema in (Yet another) LCD 16x2 library - Easy to configure
To train the use of some macros I decided to update/improve a 16x2 lcd library (HD44780) that I adapt many years ago.
Possible there are other libraries shared here, but I liked how I managed the configuration of ports and pins using some macros. The use of macros made the library more versatile and easy to adap to new projets without the need to change tons of code lines.
The same simples example of use is runnig on MSP430G2553 (old value line launchpad) and MSP430FR2433 (the new value line launchpad).
I hope it's useful.
veryalive reacted to Peabody in BSL for G2553 and G2231 using embedded USB-Serial adapter
I originally posted about this in October, but wanted to report that I've updated the G2553 special BSL entry code to fix a bug. Everything is included in my Github repository:
To review, this project deals with the MSP430G Value Line processors, and was prompted by the idea of embedding a CP2102 USB-to-Serial adapter in a project's circuit rather than hooking one up through a pin header, or using the Launchpad for JTAG flashing. So all you would need to flash new firmware is a USB cable and the right software. A detailed description of what's involved is in the long-winded PDF file. The PDF deals with the much-despised BSL password in the G2553 ROM-based BSL, and offers a couple ways around it, including special boot code that fits entirely in the INFOA segment along with the existing calibration data, and lets you run BSL with INFOA protected from erasure, which means you can flash new firmware without knowing the password, and without erasing the calibration data.
There's also a complete custom BSL system for the lowly G2231, which has no built-in BSL. Included are installers for the chip and the PC software to drive the process. And there's a discussion of circuit design for using embedded adapters or modules containing them.
The installers for the chips use the Naken assembler, and the PC software uses the LCC compiler. But the repo includes both the source code and the executables for everything, so assembler-phobes can just flash the hex files.
There are two small bonuses - a VBScript for Windows that converts an IntelHex file to TI-TXT format, and as part of the BSL installation for the G2231, the calibration values for 8, 12 and 16 MHz are derived from the existing 1 MHz calibration value, with no crystal required, and saved in the usual places in INFOA (based on original work by Steve Gibson).
I did the original work on this for a project, and decided I might as well write it up in case it might be useful to others at some point. The Value Line processors are kinda old school now, but are still available in DIP, and are still pretty popular. And the circuit design portion may be more generally useful.
Of course I'd like to know about any bugs or errors anyone may find. Hope this will be useful.
veryalive reacted to Fmilburn in NRF25L01 MSP430 to Arduino
I have only used the NRF24L01 between MSP430s and not with an Arduino - however, did you read through the Wiki? https://github.com/spirilis/msprf24/wiki
Regarding pipes, see this: http://forum.43oh.com/topic/10228-nrf24l01-pipe-addressingad/#comment-76349
veryalive reacted to Rickta59 in neo430 - msp430 compatible FPGA processor
For a long time, I have had an interest in FPGA development. You can find boards that come with a JTAG programmer on ebay for less than $20. The following ebay link shows a board similar to the one I had purchased http://www.ebay.com/itm/361568712810 I experimented with it a lot for a while and then I probably got distracted by some new TI toy Occasionally, I would pick it up and try different things with it. However, the cost and form factor of the chips discourages me from doing anything real with it. For me these things are more of an educational plaything.
Yesterday, I noticed the neo430 project on opencores.org. It is an msp430 compatible processor implemented in VHDL. It didn't take me long to get it installed and it actually seems to work pretty well. There are some difference between the neo430 and the msp430. ( see list below for the details ) Using the Altera Cyclone II EP2C5 board I linked above I was able to use the example code to create an msp430 like device with 4K of ROM and 4K of RAM. It runs a serial bootloader over its UART peripheral and allows you to toggle the pins using its parallel port peripheral. It has a simple timer peripheral. It has its own custom peripherals and 'C' header files setup to access those. It comes all setup to use msp430-gcc as a development tool with the device you create.
The instructions are pretty complete neo430 instructions , I just followed them to get started. For my Altera chip, I used the free web edition of quartus II 13.0.1 sp1 to convert the VHDL code into a loadable bitstream. Once you load that on to the FPGA chip using the USB-Blaster, a serial terminal is used to interact with the bootloader and upload msp430-gcc compiled files. The provided makefiles automate the msp430 code creation process. I'm using this on linux and I had to make a few changes to point at the directory where my msp430-gcc is installed. If you are windows user it will probably just work out of the box for you.
I'll try and post more on my experiments. In the meantime, I thought others might find it interesting.
veryalive reacted to agaelema in DSP and Math lib
I updated the library adding some functions:
- to easily generate sine waves in a array and iteratively
- goertzel dft using array data or sample by sample (very interesting because not need an array)
veryalive reacted to agaelema in DSP and Math lib
I'm working in this library with some useful DSP and math functions (ideally focusing on embedded systems). Currently it's in the initial version with few functions, but I hope to add more in the next update.
I prefered to use some structs to save parameters and use just one function to various instances of filters (very versatile).
- High Pass Filter (Single pole): Float, fixed and fixed extended version (with more bits to fractional part)
- Low Pass Filter (Single Pole): Float, fixed, fixed extended and fixed fast (with some limitations related to cuttof frequency, but more efficienty.
- RMS value: calculate RMS value of an array or sample by sample. Currently using square root function of math.h, but in the next update I will add a optimized version.
I hope this can be useful. Feel free to test, share and contribute with this project.
veryalive reacted to FrankB in Simple "Pop Top" Booster Pack
After joining this forum over 3 years ago I thought it overdue that I say hello and contribute something that I hope you will find useful.
Attached is a picture of simple booster packs that I make. But are they really a "booster pack"? Hmmm. Debatable!
They are cheap and easy to make and I have made 5 of them. I use them all the time because the whole of each project, including the MSP430, is attached to the booster pack. This means I can switch between projects without re-wiring, I can change the model of MSP430 in seconds and I only need one Launchpad.
You can see from the picture that I provide two sets of header pins to attach "stuff" to, but provide four header pins for the 3.3V and GND. I also use long-leaded header plugs, partly because I have to solder the strip boards "upside down" (notice the small gap between the strip board and the header sockets) and also because the excess leads are easily accessible test points for things like logic analysers, etc. I keep the strip board to the smallest possible size so that all the Launchpad jumpers remain accessible.
I've tried different designs, some with LEDs, switches, small breadboards and more besides, but this is the one I use all the time. I call it a "pop top" because you pop the top off a launchpad and swap it for another, then another.
That's all for now. Hopefully it'll not be another 3 years before my next posting!
veryalive reacted to agaelema in Timeout Library for MSP43x
I am developing a timeout / soft timer library for the MSP43x and would like to share it with you.
It's still in the initial version, but all the functions are working. I'm developing and testing on MSP430F6736, but it worked fine on launchpad EXP430F5529LP.
The library uses a timer to periodically generate ticks. In the base version developed by Felipe Lavratti, the timer-tick occur every 1us through a 32-bit timer (ARM Cotex). To avoid overloading the CPU I modified the code to accept longer time intervals and also functions to automatically calculate the Capture / Compare value of the timer.
I also tried to isolate the timer configuration in a separate file, so in the future it would allow to select from more than one timer source or different devices, perhaps with compatibility with the old Value Line uCs.
How the objective is not to give a perfect time base in us, I'm using ticks of 100us (10kHz) and works very well.
The library has delay, getTime, and Timeout functions, the latter two of which are interesting for managing tasks without holding down processing like a normal delay.
The example using the EXP430F5529LP use delay_Ms function to toggle 4 times both leds, geTime_ms() to toggle LED1 every 234ms and timeoutCheck_ms() to toggle LED2 every 1s.
Feel free to leave your opinions and contribute to the project
- Github of project
veryalive reacted to maelli01 in Solar power display
An output power display for my solar system.
G2553 Launchpad, Blue 4-digit LED display, RS485 Transceiver SN65HVD12P (a low power, 3.3V version of the standard SN75176), this is all there is.
All pins are used,
4 + 7 for the multiplexed LEDs (no resistors: Blue LED, 3.6V supply, output resistance of the pins limit the LED current)
3 pins for UART and send/receive for the SN65.
2 pins for 32768Hz xtal (I had this one soldered in on the LP, so why not use it)
The MSP asks the inverter over RS485/Modbus "what is your current output power". After less than half a sec, the inverter aswers with the required value. This repeats every 2 seconds.
The inverter is a Fronius Symo, with Datamanager 2 (which I guess is an embedded linux machine, covering LAN, Wifi, Modbus.....).
The communication protocol can be downloaded from the Fronius website (after signing in), so no reverse engineering was required.
Instead of only power, I could also display line voltage, frequency, total delivered energy....
This is just a working prototype on Launchpad, I will do a PCB later, I also plan to power this directly from the inverter (which has a 12V solar powered output for such things).
See the picture, almost 7.5kW :-)
veryalive reacted to terjeio in I2C interface for 4x4 keyboard
I2C interface for 4x4 keyboard with partial support for 2-key rollover and autorepeat. Based on a Texas Instruments MSP430G2553 processor, uses a GPIO pin for signalling keypress events to host. Example PCB is a KiCad project for the 20-pin DIP version MSP430G2553.
I am using this to test jogging in my GRBL-port embedded in the CO2-laser controller firmware (for Tiva C) I am working on. I have left some code (#defined out) to show how 2-key rollover and autorepeat can be enabled for some keys. The hardware abstracted ARM GRBL-port and an example driver for the Tiva C LauncPad is also available on GitHub.
veryalive got a reaction from yyrkoon in Am i doing something wrong trying to program a 28 tssop 430g2553 with a launchpad
Its definitely possible to program the 2553 / 28 pin device with the Launchpad - especially with CCS. So, likely there's a PCB / wiring issue on your proto.
Looking at your schematic.... the capacitor C2 / 0.1 uF -- not needed. Reset needs a +- 30K pullup / 1nF to ground but this may already be provided - depending on where exactly you wired your jumper onto the Launchpad.
Can we assume that you've got +3volt / GND connected? Anything else on the schematic we should know about?
And I would start with the CCS 'blink' example (toggles P1.0 - often connected to an LED), just to check the communication via Spy By Wire.
Keep going - it'll work !!
veryalive reacted to maelli01 in lpm 4.5 current measurement, fun with low current
The example msp430fr5994x_lpm4-5_02.c is supposed to show how little current is used in this mode.
In the file it says:
// MSP430FR5x9x Demo - Entering and waking up from LPM4.5 via P1.3 interrupt
// with SVS disabled
// Description: Download and run the program. When entered LPM4.5, no LEDs
// should be on. Use a multimeter to measure current on JP1 and
// compare to the datasheet. When a positive voltage is applied
// to P1.3 the device should wake up from LPM4.5. This will enable
// the LFXT oscillator and blink the LED (on P1.0).
Even for a high-end multimeter this current is too low to be accurately measured.
So I helped myself this way:
- power the processor from the supercap
- a 10k resistor with two antiparallel diodes act as a shunt,
- connect the volt meter across the supercap, not across the processor
0.43mV over a 10k resistor gives 43 Nanoamps. (!) Yes, the datasheet (page 32) is right, typical value at 25°C is 45nA.
A CR2032 (200mAh) cell would allow the processor to wait for an interrupt for 530 years.