Jump to content
43oh

veryalive

Members
  • Content Count

    140
  • Joined

  • Last visited

  • Days Won

    4

Reputation Activity

  1. Like
    veryalive reacted to Fmilburn in Nokia 5110 display   
    @@veryalive
     
    I use a version of this code posted by oPossum: http://forum.43oh.com/topic/1913-frequency-counter-using-launchpad-nokia-5110-lcd/
  2. Like
    veryalive got a reaction from zeke in Need a buck switching power supply design   
    Two in parallel?
  3. Like
    veryalive got a reaction from tripwire in Have feedback for TI? Please share here.   
    Shipping in The Netherlands is (only) $7 USD.
     
    But I think TI's Euro disti hub is in this country.
  4. Like
    veryalive reacted to spirilis in MSP430G2553 with NRF24L01 Wireless   
    yeah he PM'd me, I responded... not much to start with here.  some more details may help (e.g. full console dump in CCS and compiler version, etc)
  5. Like
    veryalive got a reaction from gsutton in FFT   
    @@Fmilburn.....  A very interesting writeup, thanks.   What a coincidence;   I am working with the AD9850 DDS module this week !
     
    Although your writeup is on FFTs done on ARM MSPs in the KHz range, here are some data and thoughts on the AD9850 DDS I captured which you, or others, may find useful.   Note that the DDS frequency range here is 7.0 MHz.   For instance, DDS spurs are not big at KHz, but being aware of them (as I'm sure you are!) is handy --  see 1 C    below.
     
     
    This info may be useful to folks embedding DDS into radio / signal processing devices and is part of an investigation I'm doing around :
     
     -- DDS - AD9850 module and breadboarded cousins: AD5930 (sweep); AD5933 (impedance); AD9834c (DDS); AD9835 (DDS).
     -- 'clock generator' Si5351  -  a rather interesting, tiny device with 3 high frequency outputs and an I2C interface.
     -- analog PLL - own designs.
     
     
    1- Spectral performance of AD9850 sine wave.
     
    Attached is a screenshot of the close-in spectrum output of the AD9850 as measured on a high-end-hobbyist SDR (software defined radio).   Although the sinusoid AD9850 on a scope can look nice, a spectrum analyser can show us a bit more.       Some notes....
     
    a)  The SDR is tuned to 7,000,000 Hertz with resolution bandwidth at 0.5 Hz, so two spectral lines are 1.0 Hertz. (yes, RBW = 0.5 Hz !)
         The DDS output has been trimmed (see 2a, below) and is seen to be about 1 Hz lower.
         The SDR frequency readout had been previously trimmed against a time-and-frequency standard long wave transmitter.
     
    B        The fundamental DDS output at 7.0 MHz is at -60 dBm.  Vertical divisoins are 10dBm.
     
    c)  Spurs (spurious) frequencies are seen at +- 100 Hz consistently around 7.0 MHz.  These are -90 dBm, only 30dB down from the fundamental - rather strong, but can be typical for such a DDS setup.  The other two spurs come and go at other DDS fundamentals.  
     
     (DDS spurs are complex, BUT - Analog Devices has a nice spur calculator with graphics of the step-waveform and the resulting spectrum)
     
     
    2- MSP430/432 code size reduction.    Integer arithmetic.
     
    Using integer arithmetic to generate the AD9850 frequency word. I also started with floating point.  For the 2553, the flash saved is important.
        This line of code worked on both the 2553 and 432 in CCS:    (not tested for overflows across all input to this function call).
     
     
    void sendFrequency(unsigned long frequency) { int b; P4OUT &= ~DATA; // use DATA line to time the following calculation P4OUT |= DATA; unsigned long freq_32val = ((frequency * 4294967296) / 125001340) ; // nominal 125000000 xtal P4OUT &= ~DATA; Some things to note:
     
    a) - the DDS clock divisor is 125,001,340 MHz instead of the nominal 125MHz.  This was determined empirically and is important for accuracy.
         This offset from nominal will be measured periodically with respect to temperature and stored in a 2553 Flash Info Segment.  SW trim.
     
    B   - code size : On a 2553 in CCS6.1, this calculation, setups and a few blinking LEDs was around 2.2 K bytes
      c) - execution time : the same setup as in   B   , with the 2553 set to the calibrated 1 MHz clock.                    The DATA line was raised during the routine's execution ...   Time =  about 13 mSec, I recall.  
     
    3- Environment
     
    - coded for MSP430G2553 LP (Energia17 and CCS6.1)      and MSP432 LP (CCS6.1)
    - SDR receiver and spectrum analysis on 'Perseus SDR'
    - signal coupling from the AD9850 to the SDR was through the air - about 50 cm distance.
        The SDR was connected to a short outdoor antenna, so the (quiet) background level of about -110dBm is local airwaves.
     
     
     
    None of this is particularly new, but I hope someone will find this writeup of use.
     
    This is intended for learning, possibly make a small, battery powered signal generator for my workbench.  As such, next steps are:
    - test other devices (esp Si5351)         - LCD freq display       - UART interface       - rotary encoder freq knob        - attenuator           - etc
           ..............    all driven by the MSP430/2
     
    Cheers,

  6. Like
    veryalive got a reaction from pjkim in MSP430-GCC v4.0.1.0 with code composer studio   
    ......    and from the ccs wiki  .....
     
    http://processors.wiki.ti.com/index.php/Compiler_Installation_and_Selection
     
     
    MSP GCC 5.x not seen by CCSMSP GCC compilers have an installation issue with CCS v6.1.2 and earlier where it will not properly register the 5.x msp gcc release. The 4.9 release will properly register and show as an available compiler version.
    In order to fix this issue, save below xml file, MSP430_GNU_5.0.xml, to this location: <ccs>\ccsv6\eclipse\plugins\com.ti.ccstudio.buildDefinitions.GNU_6.1.1.201512151800\resources\buildDefinitions\msp430\
    File:MSP430 GNU 5.0.zip
    Restart CCS.
    From your CCS project, update the compiler on the General tab to point to the new 5.x msp gcc release. Click ok. You should now see both msp gcc compiler versions as available choices.
    The issue will be fixed in CCS 6.1.3 and CCS 6.2
  7. Like
    veryalive got a reaction from bluehash in MSP430-GCC v4.0.1.0 with code composer studio   
    ......    and from the ccs wiki  .....
     
    http://processors.wiki.ti.com/index.php/Compiler_Installation_and_Selection
     
     
    MSP GCC 5.x not seen by CCSMSP GCC compilers have an installation issue with CCS v6.1.2 and earlier where it will not properly register the 5.x msp gcc release. The 4.9 release will properly register and show as an available compiler version.
    In order to fix this issue, save below xml file, MSP430_GNU_5.0.xml, to this location: <ccs>\ccsv6\eclipse\plugins\com.ti.ccstudio.buildDefinitions.GNU_6.1.1.201512151800\resources\buildDefinitions\msp430\
    File:MSP430 GNU 5.0.zip
    Restart CCS.
    From your CCS project, update the compiler on the General tab to point to the new 5.x msp gcc release. Click ok. You should now see both msp gcc compiler versions as available choices.
    The issue will be fixed in CCS 6.1.3 and CCS 6.2
  8. Like
    veryalive got a reaction from spirilis in MSP430-GCC v4.0.1.0 with code composer studio   
    ......    and from the ccs wiki  .....
     
    http://processors.wiki.ti.com/index.php/Compiler_Installation_and_Selection
     
     
    MSP GCC 5.x not seen by CCSMSP GCC compilers have an installation issue with CCS v6.1.2 and earlier where it will not properly register the 5.x msp gcc release. The 4.9 release will properly register and show as an available compiler version.
    In order to fix this issue, save below xml file, MSP430_GNU_5.0.xml, to this location: <ccs>\ccsv6\eclipse\plugins\com.ti.ccstudio.buildDefinitions.GNU_6.1.1.201512151800\resources\buildDefinitions\msp430\
    File:MSP430 GNU 5.0.zip
    Restart CCS.
    From your CCS project, update the compiler on the General tab to point to the new 5.x msp gcc release. Click ok. You should now see both msp gcc compiler versions as available choices.
    The issue will be fixed in CCS 6.1.3 and CCS 6.2
  9. Like
    veryalive got a reaction from tripwire in My F5529 LaunchPad is back from 2 weeks vacation   
    a question ....
     
     
    WHAT IS YOUR 5529 LP BOARD REV ???
     
     
    Rev 1.4 had weird problems with a kind of power switch driven by the emulator side.
     
    I had such problems with the Rev 1.4 board which I resolved by reflashing the EZ FET.   At TI'er on the E2E Forum helped me; this was about 2 years ago.
     
    In Rev 1.5   5529 LP, those power switches were removed....
     
     
    o
  10. Like
    veryalive got a reaction from pine in My F5529 LaunchPad is back from 2 weeks vacation   
    a question ....
     
     
    WHAT IS YOUR 5529 LP BOARD REV ???
     
     
    Rev 1.4 had weird problems with a kind of power switch driven by the emulator side.
     
    I had such problems with the Rev 1.4 board which I resolved by reflashing the EZ FET.   At TI'er on the E2E Forum helped me; this was about 2 years ago.
     
    In Rev 1.5   5529 LP, those power switches were removed....
     
     
    o
  11. Like
    veryalive got a reaction from zeke in My time with FreeRTOS on the TM4C   
    super work, mister spirilis !!
  12. Like
    veryalive got a reaction from gsutton in MSP430G2553 and viability   
    Not to forget that TI has the excellent CCS IDE which, in the free version with 16KB compiled code limit, allows professional development and debug of most any 2553 project you can imagine.
  13. Like
    veryalive reacted to tonyp12 in tiny msp430 preemptive multitasking system   
    Tested on G2553 Launchpad with IAR, I recommend G2955 with 1K RAM if you want more than 3 task
    #include "msp430.h" #include "common.h" //=========================(C) Tony Philipsson 2016 ======================= funcpnt const taskpnt[]={ task1, task2, task3, // <- PUT YOUR TASKS HERE }; const int stacksize[tasks] = {28}; // a blank value defaults to 24 stack words //========================================================================= int taskstackpnt[tasks]; unsigned int taskdelay[tasks]; char taskrun; int main( void ) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer if (CALBC1_8MHZ != 0xff){ // erased by mistake? BCSCTL1 = CALBC1_8MHZ; // Set DCO to factory calibrate 1MHz DCOCTL = CALDCO_8MHZ; } int* multistack = (int*) __get_SP_register(); int i=0; while(i<tasks-1){ int j = stacksize[i]; if (!j) j = 24; multistack -= j; *(multistack) = (int) taskpnt[++i]; // prefill in PC *(multistack-1) = GIE; // prefill in SR taskstackpnt[i] = (int) multistack-26; // needs 12 dummy push words } WDTCTL = WDTPW+WDTTMSEL+WDTCNTCL; // 4ms interval at 8MHz smclk IE1 |= WDTIE; __bis_SR_register(GIE); asm ("br &taskpnt"); // indirect jmp to first task } //============= TASK SWITCHER ISR ============= #pragma vector = WDT_VECTOR __raw __interrupt void taskswitcher(void) { asm ("push R15\n push R14\n push R13\n push R12\n" "push R11\n push R10\n push R9\n push R8\n" "push R7\n push R6\n push R5\n push R4"); taskstackpnt[taskrun] = __get_SP_register(); if (++taskrun == tasks) taskrun = 0; __set_SP_register(taskstackpnt[taskrun]); asm ("pop R4\n pop R5\n pop R6\n pop R7\n" "pop R8\n pop R9\n pop R10\n pop R11\n" "pop R12\n pop R13\n pop R14\n pop R15"); } #include "msp430.h" #include "common.h" __task void task1(void){ P1DIR |= BIT0; while(1){ __delay_cycles(800000); P1OUT |= BIT0; __delay_cycles(800000); P1OUT &=~BIT0; } } #include "msp430.h" #include "common.h" __task void task2(void){ P1DIR |= BIT6; while(1){ __delay_cycles(1200000); P1OUT |= BIT6; __delay_cycles(1200000); P1OUT &=~BIT6; } } #include "msp430.h" #include "common.h" unsigned int fibo(int); __task void task3(void){ int temp = 0; while(1){ fibo(++temp); } } unsigned int fibo(int n){ if (n < 2) return n; else return (fibo(n-1) + fibo(n-2)); } #ifndef COMMON_H_ #define COMMON_H_ #define tasks (sizeof(taskpnt)/2) __task void task1(void); __task void task2(void); __task void task3(void); typedef __task void (*funcpnt)(void); #endif
  14. Like
    veryalive got a reaction from roadrunner84 in Using 5volt LCDs on 3.3volt MSP430s - with no extra power supply   
    Hi forum,     I have many 5 volt LCDs.   Here's an idea for using them on 3.3 volt MSP430 systems, other 3 volt systems and LaunchPads.   Let's think of the typical 16 char  x 2 row LCD, with a 16 pin connector (pin 1 = GND, pin 2 = Vcc, pin 3 = Vee, etc) and operate the MSP and LCD off only one 3volt source.    No extra power supplies.   I've been using this technique for a long while, its nothing new, you may have already seen it.      PROBLEM STATEMENT - how to use a 5volt LCD unit on a 3.3 volt system without creating a separate 5v supply.     SOLUTION  SUMMARY - use a simple circuit to create a negative voltage from the MSP 430 ACLK.  This negative voltage then drives the LCD Vee on pin 3.   The ACLK ***must*** be enabled in your software.   You can enable ACLK in either CCS or Energia.      Current measurements and waveforms are shown below.   Clearly, you have to sacrifice use of the PORT P1_0 (red LED) pin, but this can be a reasonable trade off.   If you can't do this, then you can use another MSP output to generate the negative voltage.       HARDWARE -   a-- create a simple negative voltage charge pump (two capacitors, 2 diodes). - input is from MSP ACLK pin +- 12 KHz. - output is to LCD Vee, which is almost always pin 3.   b-- here is a simple charge pump circuit:       (please do google this if you've a question, it is really simple)                | |                    || ACLK -->---| |---------O----------||<|------O--------->---- to Vee, pin3 on LCD.             | |         |          ||        |             C1         |        D2          |                        |                    |                       ===                 =====                 D1    \ /             C2  =====                     =======                 |                        |                    |                        |                    |                        |                    |                      GROUND               GROUND     Typical component values are not critical. I used:  C1 = C2 = 1 uF.   D1 = D2 = Germanium 1N569. Results are below.   c--  then connect the LCD module as follows: - pin1 to GROUND - pin2 to +3.3 volts (same line as the MSP430 positive supply) - pin3 to the charge pump inverter circuit, above in para 'b'. - all the other pins (RS   R/W    E   DATA0-7) to PORT pins suitable for your application.   d--  the scope output of the waveform in actual operation is shown in the scope screen shot below.     SOFTWARE -  you must enable the ACLK / VLO to be output from the MSP430:   P2SEL |= 0x07; // aclk P2_0 pin8.  smclk P2_1 pin9.   ta0 3 P2DIR |= 0x07; BCSCTL3 = LFXT1S_2; // aclk = vloclk abt 12khz   This can be done in CCS or in Energia 'SETUP'.     CURRENT CONSUMPTION -  .... With this configuration: - MSP430F2272 at 1MHz,  PORTs 1,3,4 all set to OUTPUT LOW.  PORT 2 set up as above.     4 x 20 LCD with blue backlight (powered by 3.3volts to a reasonable back light output)   ....  here is the typical current consumption I measured:   - MSP430F2272 running tight loop, 1MHz    1.1  mA - loop + charge pump                      1.55 mA   <<<< so, only 0.45 mA for the charge pump - loop + charge pump + LCD backlight      9.44 mA    (these are high efficiency blue LEDs)     PLUS POINTS -  - only one power supply needed for a simple 430 + LCD project. - rather low current consumption - even lower current consumption by switching ACLK off (but then you should turn off the LCD Vcc +3.3 - use another PORT pin as the LCD Vcc)   MINUS POINTS -  - you have to use a MSP430 port pin   ALTERNATIVES -  - use a timer / int driven PORT pin to replace the ACLK. - LCD too much contrast? :       - insert series resistor to LCD Vee from charge pump to reduce neg volts - LCD not enough contrast? :       - use a negative voltage triple / quadrupler.       Hope someone can use this idea.....   Cheers.      
     
     
     
     
     

  15. Like
    veryalive reacted to Fmilburn in AD9850 Frequency Generator BoosterPack   
    @@yosh, @@terjeio,
     
    If you or others who contribute regularly to 43oh want one of my extras (I have 2) just let me know and I am happy to mail no charge. Otherwise they will sit in my desk and never get used.
  16. Like
    veryalive got a reaction from Tieri in Stupidest Thing you had to Troubleshoot?   
    @@Tieri           -  sisu
  17. Like
    veryalive got a reaction from cde in Using 5volt LCDs on 3.3volt MSP430s - with no extra power supply   
    Hi forum,     I have many 5 volt LCDs.   Here's an idea for using them on 3.3 volt MSP430 systems, other 3 volt systems and LaunchPads.   Let's think of the typical 16 char  x 2 row LCD, with a 16 pin connector (pin 1 = GND, pin 2 = Vcc, pin 3 = Vee, etc) and operate the MSP and LCD off only one 3volt source.    No extra power supplies.   I've been using this technique for a long while, its nothing new, you may have already seen it.      PROBLEM STATEMENT - how to use a 5volt LCD unit on a 3.3 volt system without creating a separate 5v supply.     SOLUTION  SUMMARY - use a simple circuit to create a negative voltage from the MSP 430 ACLK.  This negative voltage then drives the LCD Vee on pin 3.   The ACLK ***must*** be enabled in your software.   You can enable ACLK in either CCS or Energia.      Current measurements and waveforms are shown below.   Clearly, you have to sacrifice use of the PORT P1_0 (red LED) pin, but this can be a reasonable trade off.   If you can't do this, then you can use another MSP output to generate the negative voltage.       HARDWARE -   a-- create a simple negative voltage charge pump (two capacitors, 2 diodes). - input is from MSP ACLK pin +- 12 KHz. - output is to LCD Vee, which is almost always pin 3.   b-- here is a simple charge pump circuit:       (please do google this if you've a question, it is really simple)                | |                    || ACLK -->---| |---------O----------||<|------O--------->---- to Vee, pin3 on LCD.             | |         |          ||        |             C1         |        D2          |                        |                    |                       ===                 =====                 D1    \ /             C2  =====                     =======                 |                        |                    |                        |                    |                        |                    |                      GROUND               GROUND     Typical component values are not critical. I used:  C1 = C2 = 1 uF.   D1 = D2 = Germanium 1N569. Results are below.   c--  then connect the LCD module as follows: - pin1 to GROUND - pin2 to +3.3 volts (same line as the MSP430 positive supply) - pin3 to the charge pump inverter circuit, above in para 'b'. - all the other pins (RS   R/W    E   DATA0-7) to PORT pins suitable for your application.   d--  the scope output of the waveform in actual operation is shown in the scope screen shot below.     SOFTWARE -  you must enable the ACLK / VLO to be output from the MSP430:   P2SEL |= 0x07; // aclk P2_0 pin8.  smclk P2_1 pin9.   ta0 3 P2DIR |= 0x07; BCSCTL3 = LFXT1S_2; // aclk = vloclk abt 12khz   This can be done in CCS or in Energia 'SETUP'.     CURRENT CONSUMPTION -  .... With this configuration: - MSP430F2272 at 1MHz,  PORTs 1,3,4 all set to OUTPUT LOW.  PORT 2 set up as above.     4 x 20 LCD with blue backlight (powered by 3.3volts to a reasonable back light output)   ....  here is the typical current consumption I measured:   - MSP430F2272 running tight loop, 1MHz    1.1  mA - loop + charge pump                      1.55 mA   <<<< so, only 0.45 mA for the charge pump - loop + charge pump + LCD backlight      9.44 mA    (these are high efficiency blue LEDs)     PLUS POINTS -  - only one power supply needed for a simple 430 + LCD project. - rather low current consumption - even lower current consumption by switching ACLK off (but then you should turn off the LCD Vcc +3.3 - use another PORT pin as the LCD Vcc)   MINUS POINTS -  - you have to use a MSP430 port pin   ALTERNATIVES -  - use a timer / int driven PORT pin to replace the ACLK. - LCD too much contrast? :       - insert series resistor to LCD Vee from charge pump to reduce neg volts - LCD not enough contrast? :       - use a negative voltage triple / quadrupler.       Hope someone can use this idea.....   Cheers.      
     
     
     
     
     

  18. Like
    veryalive got a reaction from dubnet in Using 5volt LCDs on 3.3volt MSP430s - with no extra power supply   
    Hi forum,     I have many 5 volt LCDs.   Here's an idea for using them on 3.3 volt MSP430 systems, other 3 volt systems and LaunchPads.   Let's think of the typical 16 char  x 2 row LCD, with a 16 pin connector (pin 1 = GND, pin 2 = Vcc, pin 3 = Vee, etc) and operate the MSP and LCD off only one 3volt source.    No extra power supplies.   I've been using this technique for a long while, its nothing new, you may have already seen it.      PROBLEM STATEMENT - how to use a 5volt LCD unit on a 3.3 volt system without creating a separate 5v supply.     SOLUTION  SUMMARY - use a simple circuit to create a negative voltage from the MSP 430 ACLK.  This negative voltage then drives the LCD Vee on pin 3.   The ACLK ***must*** be enabled in your software.   You can enable ACLK in either CCS or Energia.      Current measurements and waveforms are shown below.   Clearly, you have to sacrifice use of the PORT P1_0 (red LED) pin, but this can be a reasonable trade off.   If you can't do this, then you can use another MSP output to generate the negative voltage.       HARDWARE -   a-- create a simple negative voltage charge pump (two capacitors, 2 diodes). - input is from MSP ACLK pin +- 12 KHz. - output is to LCD Vee, which is almost always pin 3.   b-- here is a simple charge pump circuit:       (please do google this if you've a question, it is really simple)                | |                    || ACLK -->---| |---------O----------||<|------O--------->---- to Vee, pin3 on LCD.             | |         |          ||        |             C1         |        D2          |                        |                    |                       ===                 =====                 D1    \ /             C2  =====                     =======                 |                        |                    |                        |                    |                        |                    |                      GROUND               GROUND     Typical component values are not critical. I used:  C1 = C2 = 1 uF.   D1 = D2 = Germanium 1N569. Results are below.   c--  then connect the LCD module as follows: - pin1 to GROUND - pin2 to +3.3 volts (same line as the MSP430 positive supply) - pin3 to the charge pump inverter circuit, above in para 'b'. - all the other pins (RS   R/W    E   DATA0-7) to PORT pins suitable for your application.   d--  the scope output of the waveform in actual operation is shown in the scope screen shot below.     SOFTWARE -  you must enable the ACLK / VLO to be output from the MSP430:   P2SEL |= 0x07; // aclk P2_0 pin8.  smclk P2_1 pin9.   ta0 3 P2DIR |= 0x07; BCSCTL3 = LFXT1S_2; // aclk = vloclk abt 12khz   This can be done in CCS or in Energia 'SETUP'.     CURRENT CONSUMPTION -  .... With this configuration: - MSP430F2272 at 1MHz,  PORTs 1,3,4 all set to OUTPUT LOW.  PORT 2 set up as above.     4 x 20 LCD with blue backlight (powered by 3.3volts to a reasonable back light output)   ....  here is the typical current consumption I measured:   - MSP430F2272 running tight loop, 1MHz    1.1  mA - loop + charge pump                      1.55 mA   <<<< so, only 0.45 mA for the charge pump - loop + charge pump + LCD backlight      9.44 mA    (these are high efficiency blue LEDs)     PLUS POINTS -  - only one power supply needed for a simple 430 + LCD project. - rather low current consumption - even lower current consumption by switching ACLK off (but then you should turn off the LCD Vcc +3.3 - use another PORT pin as the LCD Vcc)   MINUS POINTS -  - you have to use a MSP430 port pin   ALTERNATIVES -  - use a timer / int driven PORT pin to replace the ACLK. - LCD too much contrast? :       - insert series resistor to LCD Vee from charge pump to reduce neg volts - LCD not enough contrast? :       - use a negative voltage triple / quadrupler.       Hope someone can use this idea.....   Cheers.      
     
     
     
     
     

  19. Like
    veryalive got a reaction from Fmilburn in Ultra Low Power   
    @@sven222
     
     
    Hi again,
     
    In fact, I did notice that the ports were initialized in your code.    In the spirit of helping you avoid some strange stuff I found out myself, here is a better explanation...
     
    The main point is that, AFTER RESET -  P2SEL initial value is indeed 0xC0.      See the 0x00 Family guide slau144, page 333, chapter 8.3, table 8.2.      These must be changed to '00' for normal port IO.    The default is so that the 2553 comes up working OK if a 32KHz xtal is installed.
     
     
    This means that even if you write to P2DIR and P2OUT, they will not do anything to P2.6 and P2.7 output port  IO  bits.  
    This will do something else !
     
     
     
    From the 2553 data sheet, Port schematics, pages 53 +  .....
     
    For P2DIR BIT6 set  -  P2.6 will become Timer0_A3 TA1.              (assuming that P2SEL 6 is still at '1' )
    And P2.7 will be XOUT.
     
     
     
     
     
    Just so you are aware.....      
    tcheuss,
  20. Like
    veryalive got a reaction from sven222 in Ultra Low Power   
    @@sven222
     
     
    Hi again,
     
    In fact, I did notice that the ports were initialized in your code.    In the spirit of helping you avoid some strange stuff I found out myself, here is a better explanation...
     
    The main point is that, AFTER RESET -  P2SEL initial value is indeed 0xC0.      See the 0x00 Family guide slau144, page 333, chapter 8.3, table 8.2.      These must be changed to '00' for normal port IO.    The default is so that the 2553 comes up working OK if a 32KHz xtal is installed.
     
     
    This means that even if you write to P2DIR and P2OUT, they will not do anything to P2.6 and P2.7 output port  IO  bits.  
    This will do something else !
     
     
     
    From the 2553 data sheet, Port schematics, pages 53 +  .....
     
    For P2DIR BIT6 set  -  P2.6 will become Timer0_A3 TA1.              (assuming that P2SEL 6 is still at '1' )
    And P2.7 will be XOUT.
     
     
     
     
     
    Just so you are aware.....      
    tcheuss,
  21. Like
    veryalive got a reaction from Fmilburn in FFT   
    @@Fmilburn.....  A very interesting writeup, thanks.   What a coincidence;   I am working with the AD9850 DDS module this week !
     
    Although your writeup is on FFTs done on ARM MSPs in the KHz range, here are some data and thoughts on the AD9850 DDS I captured which you, or others, may find useful.   Note that the DDS frequency range here is 7.0 MHz.   For instance, DDS spurs are not big at KHz, but being aware of them (as I'm sure you are!) is handy --  see 1 C    below.
     
     
    This info may be useful to folks embedding DDS into radio / signal processing devices and is part of an investigation I'm doing around :
     
     -- DDS - AD9850 module and breadboarded cousins: AD5930 (sweep); AD5933 (impedance); AD9834c (DDS); AD9835 (DDS).
     -- 'clock generator' Si5351  -  a rather interesting, tiny device with 3 high frequency outputs and an I2C interface.
     -- analog PLL - own designs.
     
     
    1- Spectral performance of AD9850 sine wave.
     
    Attached is a screenshot of the close-in spectrum output of the AD9850 as measured on a high-end-hobbyist SDR (software defined radio).   Although the sinusoid AD9850 on a scope can look nice, a spectrum analyser can show us a bit more.       Some notes....
     
    a)  The SDR is tuned to 7,000,000 Hertz with resolution bandwidth at 0.5 Hz, so two spectral lines are 1.0 Hertz. (yes, RBW = 0.5 Hz !)
         The DDS output has been trimmed (see 2a, below) and is seen to be about 1 Hz lower.
         The SDR frequency readout had been previously trimmed against a time-and-frequency standard long wave transmitter.
     
    B        The fundamental DDS output at 7.0 MHz is at -60 dBm.  Vertical divisoins are 10dBm.
     
    c)  Spurs (spurious) frequencies are seen at +- 100 Hz consistently around 7.0 MHz.  These are -90 dBm, only 30dB down from the fundamental - rather strong, but can be typical for such a DDS setup.  The other two spurs come and go at other DDS fundamentals.  
     
     (DDS spurs are complex, BUT - Analog Devices has a nice spur calculator with graphics of the step-waveform and the resulting spectrum)
     
     
    2- MSP430/432 code size reduction.    Integer arithmetic.
     
    Using integer arithmetic to generate the AD9850 frequency word. I also started with floating point.  For the 2553, the flash saved is important.
        This line of code worked on both the 2553 and 432 in CCS:    (not tested for overflows across all input to this function call).
     
     
    void sendFrequency(unsigned long frequency) { int b; P4OUT &= ~DATA; // use DATA line to time the following calculation P4OUT |= DATA; unsigned long freq_32val = ((frequency * 4294967296) / 125001340) ; // nominal 125000000 xtal P4OUT &= ~DATA; Some things to note:
     
    a) - the DDS clock divisor is 125,001,340 MHz instead of the nominal 125MHz.  This was determined empirically and is important for accuracy.
         This offset from nominal will be measured periodically with respect to temperature and stored in a 2553 Flash Info Segment.  SW trim.
     
    B   - code size : On a 2553 in CCS6.1, this calculation, setups and a few blinking LEDs was around 2.2 K bytes
      c) - execution time : the same setup as in   B   , with the 2553 set to the calibrated 1 MHz clock.                    The DATA line was raised during the routine's execution ...   Time =  about 13 mSec, I recall.  
     
    3- Environment
     
    - coded for MSP430G2553 LP (Energia17 and CCS6.1)      and MSP432 LP (CCS6.1)
    - SDR receiver and spectrum analysis on 'Perseus SDR'
    - signal coupling from the AD9850 to the SDR was through the air - about 50 cm distance.
        The SDR was connected to a short outdoor antenna, so the (quiet) background level of about -110dBm is local airwaves.
     
     
     
    None of this is particularly new, but I hope someone will find this writeup of use.
     
    This is intended for learning, possibly make a small, battery powered signal generator for my workbench.  As such, next steps are:
    - test other devices (esp Si5351)         - LCD freq display       - UART interface       - rotary encoder freq knob        - attenuator           - etc
           ..............    all driven by the MSP430/2
     
    Cheers,

  22. Like
    veryalive got a reaction from bluehash in FFT   
    @@Fmilburn.....  A very interesting writeup, thanks.   What a coincidence;   I am working with the AD9850 DDS module this week !
     
    Although your writeup is on FFTs done on ARM MSPs in the KHz range, here are some data and thoughts on the AD9850 DDS I captured which you, or others, may find useful.   Note that the DDS frequency range here is 7.0 MHz.   For instance, DDS spurs are not big at KHz, but being aware of them (as I'm sure you are!) is handy --  see 1 C    below.
     
     
    This info may be useful to folks embedding DDS into radio / signal processing devices and is part of an investigation I'm doing around :
     
     -- DDS - AD9850 module and breadboarded cousins: AD5930 (sweep); AD5933 (impedance); AD9834c (DDS); AD9835 (DDS).
     -- 'clock generator' Si5351  -  a rather interesting, tiny device with 3 high frequency outputs and an I2C interface.
     -- analog PLL - own designs.
     
     
    1- Spectral performance of AD9850 sine wave.
     
    Attached is a screenshot of the close-in spectrum output of the AD9850 as measured on a high-end-hobbyist SDR (software defined radio).   Although the sinusoid AD9850 on a scope can look nice, a spectrum analyser can show us a bit more.       Some notes....
     
    a)  The SDR is tuned to 7,000,000 Hertz with resolution bandwidth at 0.5 Hz, so two spectral lines are 1.0 Hertz. (yes, RBW = 0.5 Hz !)
         The DDS output has been trimmed (see 2a, below) and is seen to be about 1 Hz lower.
         The SDR frequency readout had been previously trimmed against a time-and-frequency standard long wave transmitter.
     
    B        The fundamental DDS output at 7.0 MHz is at -60 dBm.  Vertical divisoins are 10dBm.
     
    c)  Spurs (spurious) frequencies are seen at +- 100 Hz consistently around 7.0 MHz.  These are -90 dBm, only 30dB down from the fundamental - rather strong, but can be typical for such a DDS setup.  The other two spurs come and go at other DDS fundamentals.  
     
     (DDS spurs are complex, BUT - Analog Devices has a nice spur calculator with graphics of the step-waveform and the resulting spectrum)
     
     
    2- MSP430/432 code size reduction.    Integer arithmetic.
     
    Using integer arithmetic to generate the AD9850 frequency word. I also started with floating point.  For the 2553, the flash saved is important.
        This line of code worked on both the 2553 and 432 in CCS:    (not tested for overflows across all input to this function call).
     
     
    void sendFrequency(unsigned long frequency) { int b; P4OUT &= ~DATA; // use DATA line to time the following calculation P4OUT |= DATA; unsigned long freq_32val = ((frequency * 4294967296) / 125001340) ; // nominal 125000000 xtal P4OUT &= ~DATA; Some things to note:
     
    a) - the DDS clock divisor is 125,001,340 MHz instead of the nominal 125MHz.  This was determined empirically and is important for accuracy.
         This offset from nominal will be measured periodically with respect to temperature and stored in a 2553 Flash Info Segment.  SW trim.
     
    B   - code size : On a 2553 in CCS6.1, this calculation, setups and a few blinking LEDs was around 2.2 K bytes
      c) - execution time : the same setup as in   B   , with the 2553 set to the calibrated 1 MHz clock.                    The DATA line was raised during the routine's execution ...   Time =  about 13 mSec, I recall.  
     
    3- Environment
     
    - coded for MSP430G2553 LP (Energia17 and CCS6.1)      and MSP432 LP (CCS6.1)
    - SDR receiver and spectrum analysis on 'Perseus SDR'
    - signal coupling from the AD9850 to the SDR was through the air - about 50 cm distance.
        The SDR was connected to a short outdoor antenna, so the (quiet) background level of about -110dBm is local airwaves.
     
     
     
    None of this is particularly new, but I hope someone will find this writeup of use.
     
    This is intended for learning, possibly make a small, battery powered signal generator for my workbench.  As such, next steps are:
    - test other devices (esp Si5351)         - LCD freq display       - UART interface       - rotary encoder freq knob        - attenuator           - etc
           ..............    all driven by the MSP430/2
     
    Cheers,

  23. Like
    veryalive reacted to USWaterRockets in Using multiple I2C modules on MSP432   
    I took a look at a simple project I wanted to use Energia for a few days ago, and it looks like everything has evolved from the original Arduino software, using the wiring framework. From my experience, and from what I have seen in various projects done by other people using Arduino, the whole setup is geared towards making it really easy for someone to get up and running using the standard peripheral set that came on the original Arduino board. So, if you have a better CPU with more features, or has an existing feature with improvements, you really cannot use them unless someone comes along and makes a driver for them specifically. At that point, you're at the mercy of the person who wrote the driver to support you with documentation, and you have to hope that they fully coded the new peripheral, and not just the part of it they needed for their personal project.
     
    In my case, I was attempting to use the ADC14 with the internal 2.5V reference on the MSP432. It required me to find two nonstandard functions in Energia. One to enable 14-bit mode, and another to turn on the reference. Each worked great, until I tried to use them together, then it broke, and the readings went all crazy.
     
    When I investigated the problem, I read up on the ADC14 peripheral, and it turns out that it has some really amazing capabilities for running autonomously with multiple different inputs and different configurations for each one. There's really no way to access any of this from Energia that I could find. So my brief encounter with a simple project supports the position that the Arduino way of doing things is wonderful for doing certain things, but actually is harmful to the learning process of newer CPUs. 
     
    Coincidentally, I ran across someone doing work on software for an Arduino based 3D printer, and I was shocked to find out that they used a single hardware driver for the serial port, and a second port used in the software used a bit-banging software serial emulation on a printer board based on the ATMega256 (which has 4 hardware serial ports inside). I also took a peek at the code and it appears that the serial transmit functions do not use a circular buffer, so they spin-wait and block until the send buffer is complete. 
     
    I would guess that if the rest of the Arduino drivers do a lot of blocking, that it makes a good case to use the MSP432 with Energia MT, so you can use the multitasking to prevent I/O blocking.
     
    So, in the event you're doing something unusual, or you have ideas that require precise timing with concurrent peripheral access, then you should be looking at CCS and not Energia. Arduino/Energia has a definite place for doing many things easily and quickly, but it has some limitations that might make it more frustrating than necessary when used for other projects.
     
    Something that you might want to look at, which is hardly mentioned, is the MSP432 DriverLib. This is a library of drivers for the MSP432 that you write code around using CCS. The drivers provide better support for the advanced peripherals in the MSP432 than does Energia. But the price you pay is that you have to read the user manual for the peripheral you want to use, so you can understand the functions in DriverLib.
     
    The neat thing about the DriverLib that gets little attention is that the driver functions are embedded in the CPU's ROM, so you can save code space by compiling/linking to the ROM based drivers.  
     
    I ended up using a hybrid system, where I used driverlib to do the common and tedious clock and peripheral configuration to get my MSP432 up and running, and I added my own interrupt handlers, because I needed to do some extra work that was more efficient to do inside the interrupts.
     
    I hope you get a chance to check it out and let us know what you eventually do.
  24. Like
    veryalive reacted to energia in MSP432 on Energia17 - (1) compile errors (2) Application UARTs   
    Ow, and maybe another thing to try is ccs cloud over at http://dev.ti.com. This also uses DSLite. Curious if that works on not. 
     
    Robert
  25. Like
    veryalive reacted to energia in MSP432 on Energia17 - (1) compile errors (2) Application UARTs   
    @@veryalive could you please try running DSLite from a DOS command prompt? If you turn on "Verbose" during upload in the preferences then you should see the DSLite command in the log window of Energia. It will look something like:
    /Applications/Energia.app/Contents/Resources/Java/tools/common/DSLite/DebugServer/bin/DSLite load /Applications/Energia.app/Contents/Resources/Java/tools/common/DSLite/MSP432P401R.ccxml /var/folders/v_/7pwxl8mx4dx6_yk2zn_g8r4r0000gn/T/build2838856801100244434.tmp/Blink.cpp.elf  This is on a Mac so in your case the path's will be windows like paths.
     
    Hopefully this will give us some more information about what is going wrong.
     
    Thank you for your patience! Really appreciate it.
     
     
    Robert
×
×
  • Create New...