Jump to content


Popular Content

Showing content with the highest reputation since 12/29/2019 in all areas

  1. 1 point

    Adding new mcu to Energia

    As a form of documenting... I just added another new MCU to Energia and -in short- had to do the following to get it working: In Energia 1.8.7E21: Copy from a close family member the following files and replace the model name with the new model name in the directory-/filename and file content: \hardware\energia\msp430\variants\[existing-model]\ \hardware\tools\DSLite\common\targetdb\devices\[existing-model].xml \hardware\tools\DSLite\common\targetdb\options\[existing-model]_GNU.xml \hardware\tools\DSLite\common\targetdb\options\[existing-model]_TI.xml \hardware\tools\msp430\msp430\lib\ldscripts\[existing-model]\ \hardware\tools\msp430\msp430\include\[existing-model].h Add the new model to the following files: \hardware\energia\msp430\boards.txt \hardware\tools\msp430\msp430\include\msp430.h \hardware\tools\msp430\msp430\lib\msp430mcu.spec Of course, check for differences between the two family members (e.g. missing or added peripherals, memory sizes) and edit the copied files accordingly.
  2. 1 point
    When using the latest version of Energia the wire (I2C) has now the function setClock to set to 400k use setClock(400000UL);
  3. 1 point
    Interesting. My experience with both IAR and CCS is that they refuse to load images to a device when it's different than what the project specifies and they both clearly report it as an error.
  4. 1 point
    Attached is my latest version of the Real Time Clock library, adapted from xv4y's original library. Some significant changes in this version are: Now works with both the MSP430G2553 and the MSP430G2452 processors (with some limitations on the 2452). The library may work on other processors, but I don't have any to test with. Rewrite of the logic used to detect the number of days in a month and leap year detection so that it uses considerably less RAM. Option to use the built-in VLO clock. The VLO is much less accurate than the crystal - about the best that can be achieved is accuracy to within a few minutes per day. The advantage of the VLO is that it frees up 2 IO pins, and can be used if you can't solder the tiny crystal to the launchpad. If you don't need a very accurate clock, or have a means of external synchronisation, the VLO may be sufficient for your needs. The #define's that configure the settings of the timer have been moved to a separate RTCconfig.h file, so they are easier to edit without having to edit the main header file. Documentation has been moved from the header file into a separate .txt file. Some example files have been included in the library. Known Limitations: Because the MSP430G2452 only has one timer, the RTC library cannot be used in conjunction with other functions that also require the timer. This includes Serial, AnalogWrite, Tone, and possibly some others. Because the MSP430G2452 doesn't have hardware serial, this means that the RTC library and Serial are completely incompatible. RTCplus.zip
  5. 1 point

    analogWrite() precision question

    @@altineller not really, no. It's something of a hidden function. You have to include wiring_analog.c (#include <wiring_analog.c>) to kick things off. That includes the PWMWrite function. Then you can call it thusly: PWMWrite(PIN,numberOfSteps,dutyCycle,frequency); For example: PWMWrite(PD_1,500,250,6000); Would start PWM on pin PD_1, 500 steps from 0 to 100%, 50% duty cycle (500 / 2 = 250), 6000Hz frequency. It's worth noting that the function call does glitch when you call it on a pin already putting PWM out. It's not enough to hear driving a speaker, but it could cause you issues if you're calling it a lot. There's a thread around here somewhere on that subject. The frequency cap is very high, if I recall correctly I'd tested it to work >1MHz. I could be thinking about a different MCU, I've tested sort of a lot of them.
  6. 1 point

    Sensorless BLDC motor control

    Cool project, I did something very similar as well! https://github.com/lgbeno/BLDC-Booster There is software on there too that you are free to reference. It works with some exceptions. The method that I used for commutation is bemf integration similar to the ti instaspin approach. The issues that I had was that for very fast motors(>500Kv), I wasn't sampling the ADC fast enough to get the commutation timing right but for slow motors, it works great. A few words of wisdom since I worked on this project for quite some time. I would recommend using the 28pin Tssop or qfn32 versions of g2553. Reason being is that it has 3 pins attached to ta1.1 which you can use for the high side pwm signals and 3 pins attached to ta1.2 to be used for low side pwm signals. This does 3 things, frees up timer 0 for something else, allows you to do dead time insertion (if your gate drivers don't already) and just makes your code easier too! The other thing is that you will see your pwm super imposed on your bemf which will likely cause false trips of the comparator. To solve this, there's a low pass filter but that also introduces a dc offset that throws off your zero cross point. Long story short, I came up with a different network that filters and then ac couples the bemf to the comparator. I was seeing pretty good results with that approach. Then I had to return my borrowed scope and have not been able to work on it. Good news is I'm getting a brand new Rigol DS2072 for keeps on Thursday. Anyway I guess that is my project life story, hope it helps. Tomorrow ill try to dig up schematics with those improvements (not in github yet). Btw the schematics are very inspired by the microkoptor.de schematics, mine are as well... I wonder how they got away with the pwm glitches in their software. Obviously theirs works quite well.
  • Create New...