Jump to content

xv4y

Members
  • Content Count

    102
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Like
    xv4y got a reaction from cowie in [Energia Library] Analog Devices AD9850 DDS   
    Hi,
     
    This is a rather simple library to control a DDS chip from Analog Devices, the AD9850.
    I use it with Energia on a MSP430G2553 but given the simplicity of the code it should work on virtually any micro-controler using IDEs like Arduino.
     
    This is the page on my blog featuring an article (in french but with automatic translation provided) :
    http://xv4y.radioclub.asia/2012/12/18/librairie-pour-piloter-un-dds-ad9850-avec-un-launchpadmsp430-ou-un-arduino/
     
    Here a page where you can download the library (the third link from the top) :
    http://xv4y.radioclub.asia/boutique/docs/
     
    Please feel free to give me your comments.
     
    Yan.
  2. Like
    xv4y got a reaction from Rickta59 in Tips on reducing SRAM footprint with Energia/MSP430   
    That's true, and each architecture has its pros and cons (ok, so nobody's hurt).
    However, having more RAM give a little bit more flexibility in programming, and for people like me that are new to embedded computing, is more suited to high-level languages.
    Code legibility and reusability comes at a cost : memory usage...
  3. Like
    xv4y reacted to reaper7 in [Energia Library] StellarPad EtherCard (enc28j60) library   
    This is a JeeLab ENC28J60 library mod for Energia StellarPad,
    working OK with other devices on the same SPI bus.
     
    Library:
    Ethercard_v09a.zip
    Ethercard_v09.zip
    Ethercard_v08.zip
    EtherCard_v07a.zip
    EtherCard_v07.zip
    EtherCard_v06.zip
    EtherCard_v05.zip
     
    New version 0.9a [28.06.2014]:
    1. fix wrong type of variable in emit_p
    2. fixes by Francis Van Den Bussche, email 9/5/2014
    3. fixed obvious bug, redmine issue #539
    4. update README info and links
    5. Add documentation on class BufferFiller
     
    New version 0.9 [20.06.2014]:
    1. added all fixes since my last release -> exactly between 01-03.05.2014 (https://github.com/jcw/ethercard/commits/master)
    2. library (v09) from now should work on MSP430F5529 too, please test
     
    New version 0.8 [26.04.2014]:
    1. Fixes issue #492 (DNS lookup fails)
     
    New version 0.7a [07.04.2014]:
    1. changes inside dhcp.cpp - Custom DHCP option processing #119
     
    New version 0.7 [05.04.2014]:
    1. contains all github fixes since the last release.
    2. working with oryginal spi library from Energia 0101E0012
     
    New version 0.6 [27.04.2013]:
    1. For clarity *.ino files I decided to move SPI initialize to library.
    from now begin look like this: ether.begin(sizeof Ethernet::buffer, mymac, CS_PIN, SPI_MODULE).
    eg.:
    - ether.begin(sizeof Ethernet::buffer, mymac) -> DEFAULT initialize eth on SPI 2 & Chip Select on PB_5
    - ether.begin(sizeof Ethernet::buffer, mymac, PD_1, 3) -> initialize eth on SPI 3 & Chip Select on PD_1
    SPI speed is defined in enc28j60.cpp file (line 256), maybe more sense is move SPI speed to begin too?
     
    New version 0.5 [20.04.2013]:
    1. "DHCP fix" - Andy Lindsay github commit
     
    New version 0.4 [12.04.2013]:
    1. "Implemented a simple UDP listening server, that listens for packets on ports and triggers callbacks" - brianlah87 github commit
     
    New version 0.3 [04.04.2013]:
    1. "adding header arg to browseUrl" - jscrane github commit
     
    New version 0.2 [24.02.2013]:
    1. "Accept of tcp packets refactored to a separate method" - mrbig github commit
    2. New example for the above: "quasiMultiport" -> You can open more browser windows on different ports with different contents e.g.
    http://stella_ip, http://stella_ip:1224, http://stella_ip:22222, etc... 3. New function setupWakeUp() in enc28j60.cpp/h -> You can setup enc28j60 to filter/receive only WOL package for e.g. WakeUp host (StellarPad) from hibernation,(enc28j60 pdf - chapter 12.2.1 pt1-3), return to normal mode through existing function enableBroadcast()
    P.S. pt2 & 3 is my low quality ideas, so - don't report problem with them to jeelib
     
    still is some bugs e.g. DHCP with mac addr starting with first number > 0 not working for me :-/
     
    Connections (If You are using default Energia SPI bus 2):
     
     
    My sandwich StellarPad + universal ENC28J60 module from e.g. eBay + LCD5110 with tongue (nrf24l01+):

    Sandwich get temperature from remote sensor (based on my second StellarPad and this project moved to Energia) via MiRF library,
    display temp on LCD5110 modified library (number & graph idea by timotet) and create a simply web page to display temp
    This is a very simply and fast making test platform
  4. Like
    xv4y got a reaction from dubnet in Tips on reducing SRAM footprint with Energia/MSP430   
    As Rei Vilo already covered the mass memory aspect with good tips about reducing the Flash size of your binaries for the MSP430, I will share with you my conclusions about how to do the same but with SRAM usage.
     
    Just to make things clear, in Flash, all the "static" things are written, not to be modified runtime (except when using the MSPFlash library, but that's another story). It is there you store your program code, your constants...
    In SRAM, you will find the variables you declare yourself and use in your program and also a few things that are hidden to most of us. This things are stored in what is called the Stack and the Heap. They are used for variables copies, variable transfer to a routine or function, buffers in some libraries...
    This is a bit simplified but you know the big picture now.
     
    The MSP430G2553 of the LaunchPad has 16kB of Flash and only 512B of SRAM. For comparison, that's twice as less as the typical Arduino Nano ATMega328. Halving the Flash size is ok for most of the program we write for those tiny controllers, however halving the SRAM put a lot of pressure because in some cases you can quickly run out of Heap :
    - when you heavily use strings for Serial or LCD output
    - when you want to draw graphics (charts) to a "big" LCD screen
    - when you have to do some maths like matrix computation
    - when you use a lot of long unsigned int (4 octets each).
    - when you do all above and want to pass the variables to a sub-routine...
     
    I was writing a small program that is finished and running well now. It will be used in a HAM Radio kit I am currently prototyping at that I will sell online. Only 12kB of binary so that's ok for the Flash. However since the very early developments it has been plagued by sometime unpredictable crashes. Sometime just adding a line to the code or worst a character to a string to display could make the whole program to crash.
    In this program I was :
    - doing some maths on 2x 162 bytes arrays (convolutional encoding, scrambling...) for digital data transmissions over a low S/N radio link,
    - printing many strings on a LCD screen (and to Serial in earlier programs),
    - doing some maths on long unsigned int to control a DDS...
     
    After many hours of troubleshooting and rewriting, and correcting my rewritings, and rewriting my corrections and throwing everything by the window to start a new code...
    My conclusions are somewhat reversed to that of Rei Vilo for Flash usage.
    Try to reuse the same global variable when possible. This is against code readability of course but many variables are used only once in a code and can be reused a few lines later with just a "x=0" statement to make sure you don't start from unknown values. The garbage collector in the compiler seems to work well so use it a lot! That means when you can write a piece of code in a function of its own, do it. Without any new explicit creation of variable just a few lines of code were making my program crash. It was some kind of "Setup Menu" in the setup() {} loop with a lot of text and while loops to check for user input and refresh the displayed information. This was using a lot of memory that was not freed before the end of the setup(). If some variable are only used inside a function/routine part of a program, declare the needed variables inside the function. The memory will be freed at the exit of the function. Try not to use too much parameters in the functions, especially if they are big variables. Again that's against code legibility but parameters passing use a mechanism that is not free for RAM usage. Global variables are sometime your friends...  Good coding!
    Yan.
  5. Like
    xv4y got a reaction from timsoer in [Energia Library] Analog Devices AD9850 DDS   
    Hi,
     
    This is a rather simple library to control a DDS chip from Analog Devices, the AD9850.
    I use it with Energia on a MSP430G2553 but given the simplicity of the code it should work on virtually any micro-controler using IDEs like Arduino.
     
    This is the page on my blog featuring an article (in french but with automatic translation provided) :
    http://xv4y.radioclub.asia/2012/12/18/librairie-pour-piloter-un-dds-ad9850-avec-un-launchpadmsp430-ou-un-arduino/
     
    Here a page where you can download the library (the third link from the top) :
    http://xv4y.radioclub.asia/boutique/docs/
     
    Please feel free to give me your comments.
     
    Yan.
  6. Like
    xv4y reacted to energia in [Energia Library] CMSIS-DSP for Energia   
    That's awesome @@spirilis! I will be sure to play around with this in the next couple of weeks. I can think of all kind of cool stuff to do with this!
     
    Robert
  7. Like
    xv4y reacted to spirilis in [Energia Library] CMSIS-DSP for Energia   
    Hi folks-
    I sat down and played around with this today for kicks.  Here's a CMSIS_DSP library (includes the .c files from ARM's CMSIS-DSP distribution, header files, and a single CMSIS_DSP.h that includes arm_math.h to make it simpler) for Energia.
     
    CMSIS_DSP_Energia.zip
     
    CMSIS-DSP is ARM's standard library for utilizing DSP algorithms on the ARM Cortex-M series chips; in particular it contains optimizations suitable for the Cortex-M4, along with primitives for using the extended instructions.
     
    API documentation is located here: http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html
     
    The FIR32_TEST example came from something I saw (possibly a CMSIS-DSP stock example) back when I was compiling CMSIS-DSP under Linux for straight C TivaWare use.
     
    The library provides 4 datatypes; F32 (float), Q31 (int32), Q15 (int16), Q7 (int8); the latter 3 datatypes can only store fractional (1.0 >= n >= -1.0) numbers, but if your datasets can use that I believe the library makes use of the Cortex-M4's SIMD instructions for parallelism.
     
    I couldn't get Energia to include an .a file for the binaries, so I had to copy all the .c files and Energia has to build each one when you use the library; this extends the compile time a bit.
     
    Enjoy!
  8. Like
    xv4y reacted to energia in New Energia release 0101E0012 - 03/20/2014   
    I am happy to announce that release 0101E0012 just went up on energia.nu. 
     
    I want to thank everybody for their support and contributions. Energia would not have been possible without such an awesome community!
     
    Details of the release can be found on http://energia.nu
  9. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Hi Sirri,
     
    Your workaround should work but the problem is not here.
    The problem is that by default, Energia is sourcing the ACLK from the VLO 12 KHz instead of the 32KHz crystal.
    This make the RTC around 2-3 times slower.
    We should be able to change this by settings in the sRTC lib code but unfortunately it does not work as expected.
    Rob is currently working on this issue :
    http://forum.43oh.com/topic/2993-new-energia-release-0101e0009-12062012/page-2
     
    For now, the right solution is to go inside Energia files to edit the hardware/msp430/cores/msp430/wiring.c file and comment out the line BCSCTL3 |= LFXT1S.
     
    Regards,
    Yan.
  10. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Hi,
     
    I have updated the library to be a little bit cleaner :
    http://xv4y.radioclub.asia/2012/12/19/bibliotheque-rtc-pour-energia-version-1-02/
    Here's the downloads page :
    http://xv4y.radioclub.asia/boutique/docs/
     
    And, well, guys, I am sorry but I don't think I will put much more work on it.
    It works for my purpose, so...
    I have a DS1307 in my hands but will hook it to an Arduino for a "weather station" project I have. The Arduino having the EEPROM embedded is more suited for this project as it allows to save measurements and compute statistics...
     
    Yan.
  11. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Hi,
     
    This is for using "inboard" RTC capabilities of the LaunchPad.
    If you solder the provided 32KHz Xtal to the LaunchPad board and using the MSP430G2553 internal clocks/timer, you can have a really accurate RTC clock. However, you have to the time calculation yourself. This library only implements time. A little bit more work would allow you to compute days, months, years... The real difficulty is that the UTC calendar is a little bit more complex than just adding numbers, since the Earth rotation is not exactly 365 days, you have bissextiles years, leap seconds...
     
    Yan.
  12. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Thanks for the suggestion.
    As for low-level init you are right I should do it in another routine as I have done in the AD9850 lib following the structure I saw in Rei Vilo 3110 library.
     
    I will try to do this tomorrow, it is a bit late for coding right now...
     
    Yan.
  13. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Huh... well... the truth is that I don't know.
    You need to divide by 8 because if not the Timer will overflow. Why I have written is divided by 8 twice ???
     
    I guess the comments are not accurate. I have two versions of the library one with a better precision than one second.
    I have uploaded updated libs here, but I still need to correct the comments I think :
    http://xv4y.radioclub.asia/boutique/docs/
     
    Yan.
  14. Like
    xv4y got a reaction from AnthonyKl in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Hi,
     
    On this page you can find the code for a simple C library using the RTC capabilities included in the MSP430g2553 shipped with the LaunchPad.
    I know TI already offer a nice RTC lib but it is in assembler and not easy to compile outisde of the given IDE.
    This one has been designed to work under Energia and should be easier to port.
     
    http://xv4y.radioclub.asia/2012/05/22/bibliotheque-rtc-pour-le-msp430/
     
    Regards,
    Yannick.
  15. Like
    xv4y reacted to oPossum in Change Frequency to SI570 DXO on I2C. (not fully fonctionnal).   
    Try this:
    const uint64_t RFREQ_INIT =      ((uint64_t)(i2cInitBuf[2] & 0x3F) << 32)   | ((uint32_t)i2cReadBuf[3] << 24)   | ((uint32_t)i2cReadBuf[4] << 16)   | ((uint16_t)i2cReadBuf[5] << 8)   | i2cReadBuf[6];       const float FREQ_MHZ_INIT = (float)RFEQ_INIT / 268435456.0;  // 268435456 = 2^28
  16. Like
    xv4y reacted to f4dtr in Change Frequency to SI570 DXO on I2C. (not fully fonctionnal).   
    Hi all !

    On another thread (cheat sheet thread), I have explain I use  launchpad for driving a SI570.
    some of you have need I share my work. it's ok... ;-) look attachment file.
     
    For understand my work, i preconise to read the datasheet.
    The SI570 have 2 mode for change frequency, i use the "long" mode. I recalc all parameters in every change frequency.
    But i simplify the calcul by the systematic use of initial frequency in place of read all registers for determinize actual ferquency to recalc new freq. (I think attiny/softrock already uses this trick.)
    but, I have 2 problems (in Fxtal_init) , and 1 function not implemented (in SetFrequency). I do not have time to look for now.
    but this is a good example of driving SI570, all logic is present.
     
    this code is divide in function. the principal is :
    void Init_FXTAL( void ) => read and calcul your Fxtal. this frequency is different for every SI570... (98% finish, but not fonctionnal) void setFrequency(float FOUT_NEW) => Change to your frequency in parameters (Mhz) (80% finish but not fonctionnal) void Set10(void) => Set SI570 to 10Mhz. fonctionnal with my SI570. void Set20m(void) => loop frequency 20m band (13.5Mhz to 14.5 Mhz by 100Khz). fonctional with my SI570. first problem :   uint64_t RFREQ_INIT = 0x0;   RFREQ_INIT = ((i2cInitBuf[2] & 0x3F) << 32);   RFREQ_INIT = RFREQ_INIT | (i2cReadBuf[3] << 24);   RFREQ_INIT = RFREQ_INIT | (i2cReadBuf[4] << 16);   RFREQ_INIT = RFREQ_INIT | (i2cReadBuf[5] << 8);   RFREQ_INIT = RFREQ_INIT | i2cReadBuf[6]; this result is not good. i think i have a problem with "unsigned".... bug ?
     
         2. Second problem :
    (float) RFREQ_MHZ_INIT = (uint64_t) RFREQ_INIT / 268435456;  // 268435456 = 2^28 if RFREQ is ok but the result is wrong... lack precision ? rounded ?
     
    Fonction not implemented :
     
    for change frequency to all value, the N1_DIV and HS_DIV must be calculed before change registers.
    i not program this part, i expect my correction (or your ;-) ) of my precedents problems for think it. ;-)
     
     
    in clonclusion :
     
    this code is not finished, but I do not have time now.
    This version provides all the elements of SI570 register read/write register comprehension.
    I think many things can be improved, it is only a draft of a future library maybe. but for now, it allowed me to test my trap and filter. time spent / results and so far positive report.

    I probably would end one day, when I need more function, or more accurately.
    I hope that this code you'll help to understand the Si570. good luck! and if you made ??a full library, think warn me! ;-)
     
    more explain/comment in code, good read ! ;-)
     
    Jean-Yves
    F4DTR.
     
    ps: sorry for my bad english. if you don't understand mail me, or if you want to correct me (english or code), youre welcome !
     
    si570.ino
  17. Like
    xv4y got a reaction from russcky in Real-Time Clock (RTC) Library for the MSP430/LaunchPad   
    Hi,
     
    Have you downloaded the RTCPlus lib by Grahamf72 and put it in a libraries sub-directory in the Energia sketch directory ?
    Refer to this thread for more details :
    http://forum.43oh.com/topic/3375-energia-library-msp430-real-time-clock/
     
    Regards,
    Yannick.
  18. Like
    xv4y reacted to Rei Vilo in Book Review: Getting Started with the MSP430 LaunchPad   
    @xv4y Thanks for the update.
     
    Even at USD52.89, the bundle has no direct competitor to discover embedded computing.
     
    USD52.89 = LaunchPad MSP430 9.99 + Educational BoosterPack 24.95 + book 17.95.
  19. Like
    xv4y reacted to boarboar in Porting the Mirf/Nrf24 library   
    Actually, this one is working correctly:
     
    http://www.open.com.au/mikem/arduino/NRF24/
     
    Do not forget to supply the constructor with the correct PIN numbers for CSN and CE.
     
    And be aware of the SPI issue with 2553 -
     
    http://forum.43oh.com/topic/3163-fixed-%E2%80%94-msp430g2553-spi-issue-first-byte-not-read/
     
    You'll need to fix usci_spi.cpp. (Alternatively - change the library adding fake reads)
     
    Br
    Alexander
  20. Like
    xv4y reacted to simpleavr in Educational BoosterPack 8 bit FFT Spectrum Analyzer Attempt   
    So what have you been doing with your Educational BoosterPack lately 
     

     
    This is based on the fix_fft code that's been floating around for many years. I tried both 16 bit and 8 bit, currently fixed to 8 bit as I see no difference for my needs (i.e. limited precision, range), I would invest in a good pre-amp for better results.  
    Things to do
    More precision timing to achieve the frequency band I want. Better front-end, currently using 1/2 LM258. Adopt non-linear horizontal scale, currently linear scale at about 800Hz...1.6Khz, 2.4KHz, 3.2Khz.... Adopt logarithm amplitude to make the bars make sense to your eyes. Add / enhance effects like attack / retreat rate. Add dynamic sampling / scaling to input signals.
  21. Like
    xv4y got a reaction from Rei Vilo in Book Review: Getting Started with the MSP430 LaunchPad   
    Hi Rei Vilo,
     
    Nice write-up.
    Unfortunately the MSP430 is not at 4,30$ anymore. 9,99$ whit shipping included is still a bargain but not as attractive as before.
    I was lucky to stock a pile of box before the price increase but now I must be remaining only a few units... time to re-stock soon.
     
    Regards,
    Yan.
  22. Like
    xv4y reacted to Rei Vilo in Book Review: Getting Started with the MSP430 LaunchPad   
    How to discover embedded computing? 

    One major difficulty when trying to answer this question is the number of fields covered: electronics, computing, programming. Another difficulty is making the connections between those different fields.
     

     
    Finding a good book is key to make the exploration easy. Getting Started with the MSP430 LaunchPad provides such a guided discovery.
     
    The book offers a step-by-step introduction to embedded computing with hands-on projects. Each chapter starts with a project, introduces the concepts and then discusses them. 
     
    I imagine the perfect bundle for less than USD47.50 to discover embedded computing, including: LaunchPad MSP430 4.30 + Educational BoosterPack 24.95 + book 17.95. 
     
    Read my review!
     
    Buy Getting Started with the MSP430 Launchpad from Amazon.
     
    Edit:
    - Added Amazon link
    - PIC uploaded to 43oh.
  23. Like
    xv4y reacted to Rei Vilo in Code source for VFO using AD9850/AD9851 DDS   
    Yannick,
     
    Glad to see my LCD_5110 library is useful
  24. Like
    xv4y got a reaction from bluehash in Code source for VFO using AD9850/AD9851 DDS   
    Hi,
     
    This will ring a bell to radioamateurs (HAM radio) but other may just ignore...
    I have posted to my blog a code for a simple VFO (Variable Frequency Oscillator) or better said an RF frequency generator using an AD9850 DDS chip.
    This code is simple and has no special trick but might give you inspiration.
     
    http://xv4y.radioclub.asia/2013/03/19/code-source-vfo-avec-dds-ad9850ad9851-et-launchpad-msp430/
     
    The pins are "wired" for my WSPR agile beacon generator kit, but everything can be changed to your taste or needs.
    The text of the blog article is in french but has no additional information than the one in the source code (commented in english).
    The needed libraries are on my download page :
    http://xv4y.radioclub.asia/boutique/docs/
     
    Regards,
    Yannick.
  25. Like
    xv4y got a reaction from bluehash in Issues downloading Energia?   
    Hi guys,
     
    I am a bit far from the forum now... busy working somehow.
    Robert, if you need a mirror I have free data space for you on my professional hosting accounts.
    My website are hosted by OVH, the number one host in Europe.
    I can give you a private FTP login+pwd so you can upload by yourself.
    The base URL will be like energia.radioclub.asia but it may be mirror.energia.nu if you can create a sub-domain and have it pointed to the OVH servers.
     
    Regards,
    Yan.
×
×
  • Create New...