Jump to content
43oh

tripwire

Members
  • Content Count

    193
  • Joined

  • Last visited

  • Days Won

    14

Reputation Activity

  1. Like
    tripwire reacted to energia in Putting a While Loop within a While Loops   
    If you repeatedly call analogWrite() in a loop very fast, the PWM signal will not have the time to complete a full period @ 490 Hz. Hence, there is a chance you get garbage. Reading Arduino source code, the same is true for the avr implementation.
     
    Robert
  2. Like
    tripwire reacted to bluehash in Have feedback for TI? Please share here.   
    Hello 43oh Members and Guests!
    In a few weeks, I'll have a chance to meet people within TI. Among them are those who work on the Launchpad platform, marketing, web team and designers of their micro-controllers+other chips that they offer.
     
    Do you have any good feedback for them? Do you have any critical feedback for them?(They would appreciate this) Any new features you would like them to add to their Launchpad platform?(pins/form-factor/buttons/debuggers/LED feedback) Any BoosterPack inputs? Any Energia inputs/concerns. The TI Store. The TI website(I'll have a chance to meet the web team too, feedback will be helpful) Web presence. Any more that you can think of.  
    TI is one of the few companies I know that try to get close the community. A few of them are members of 43oh, some helping out, some in stealth mode. So please use this opportunity to let them know your views. 
     
    Thank you all!
  3. Like
    tripwire reacted to spirilis in Access to all MSP430 timers.   
    what's a "Basic Timer"?  I don't think the G2553 has it anyhow...
     
    It has Timer_A and WDT.  MSP430 Wolverine series chips (FR5969) has WDT, RTC, Timer_A and Timer_B... F5529 has similar...
     
    Basically Energia does give you what you need, although the Timer_A PWM output stuff is done via analogWrite or you can use the timers directly via their SFR registers (TA0CTL, TA0CCTLx, etc) so long as you don't try to use analogWrite at the same time.  WDT is (ab-)used for the millis()/micros() "tick" along with the sleep, sleepSeconds timer.
  4. Like
    tripwire reacted to cubeberg in Access to all MSP430 timers.   
    Some of the timers are already in use under the covers - executing the loop on a specific interval, tracking time (millis/micros), etc. so losing some is a trade-off of using Energia vs Code Composer or mspgcc.  
    You'll find that some libraries use timers as well, so you'll need to watch out for that as well.
     
    I believe you can technically use interrupts within Energia like you would with MSPGCC, there just isn't a nice wrapper for everything.  Keep in mind that it's intended to be hardware agnostic to an extent as well - so that your code could work on an MSP430, but also an MSP432 or Tiva if you need more horsepower.  
     
    Depending on what you're looking to do - it may be a case of finding a different way of approaching the problem, maybe taking the time to write a library for a special function, or possibly making the jump to Code Composer (there's even a nice import function in Code Composer for Energia sketches).  
     
    FYI - I'm a C# dev as well.  With enough digging through examples - the MSP430 is not too difficult to master although it seems daunting at first (the code samples they provide for the 2553 are fantastic though and Grace is very valuable for configuring tricky timers and peripherals).  Now a CC3200 or MSP432 - that's a whole different beast - I tend to use Energia for larger chips since I haven't invested enough time on learning the driverlibs and architecture yet.
  5. Like
    tripwire reacted to chicken in MSP432 digitalRead() / Interrupt not working?   
    I think the proposed Aflag ^= 1 workaround does not really solve your problem. You still only get an interrupt on one of the transitions (high-low or low-high), but instead of reading the current pin state, you simply inverse the current state of the variable.
     
    From reading the e2e thread and without reading at the datasheet, it looks like the MSP432 hardware only supports configuring the interrupt for one of the transitions at a time, i.e. no native support of CHANGE.
     
    It could be worked around by re-configuring within the interrupt. E.g. if currently high, trigger on going low; if currently low, trigger on going high. Calling attachInterrupt within the interrupt probably won't work, so you'd have to go to the register level to implement that.
     
    Maybe there's already an Energia library for reading quadrature encoders that takes care of those low-level details.
  6. Like
    tripwire reacted to energia in How is Energia MT organized?   
    Right now EMT is not compiled from source. We link against a pre-compiled binary. Please see hardware/emt/ti/runtime/wiring/msp432/linker.cmd for which precompiled libraries are linked with. The sources of the Wiring framework can be found here: https://github.com/energia/emt.
     
    What we do is we create something called a closure that has all the binaries / headers included. I then take that closure and consume it during the build of Energia.
    We realize that this is not the ideal way to do it since it is very difficult to rebuild the wiring framework from source. For that reason, the next release of Energia based on Arduino 1.6 will utilize the core package management system. With that release the Wiring framework will always be build from source just as we do with the other none emt implementations. SYS/BIOS / TI-RTOS will not be build from source however since that would take way to long when you hit verify on a Sketch. Reason is that it is very unlikely that you would want to change anything in those sources. We will post instructions for how to recreate those binaries if you do want to change things in those sources.
     
    The next release is about a month out.
     
    Robert
  7. Like
    tripwire reacted to cooldoubtless in Please Help Serial Port Issue   
    Hey, I used CCS for my MSP430G2452 Launch Pad. But i completely removed it and i use now Energia. I installed driver too. My os is windows 10 and the jumpers are as the image i attach below. I see nothing when i write even a basic write function. My boundrate 9600. In the Tool menu of the Energia i choose my board but it doesnt give me chance to change the com port. Its com port is COM2. My pc has 2 usb 3.0 ports and 1 usb 2.0 port and use usb 2.0 for board. Please help.

  8. Like
    tripwire reacted to Rickta59 in Please Help Serial Port Issue   
    You are right @@cooldoubtless, it is broken.
     
    It looks like some recent ( or at least since the last time I looked .. which was years ) checkin into the source code has broken the TimerSerial code. The msp430g2231 and msp430g2452 use TimerSerial as Serial because they lack a uart. This requires that the pins used are the one from the timer_a. The TimerSerial code also needs to work with the 1.4 launchpad boards as they had no simple way to change the rx and tx assignments.
     
    The change below is what I did to make it work for only the msp430g2452 and msp430g2231:
    $ git diff diff --git a/hardware/msp430/variants/launchpad/pins_energia.h b/hardware/msp430/vari index 04b8574..13bf887 100644 --- a/hardware/msp430/variants/launchpad/pins_energia.h +++ b/hardware/msp430/variants/launchpad/pins_energia.h @@ -44,8 +44,13 @@ static const uint8_t TWISCL1 = 9; /* P2.1 SW I2C */ static const uint8_t TWISDA1 = 10; /* P2.2 SW I2C */ static const uint8_t TWISDA0 = 15; /* P1.7 */ static const uint8_t TWISCL0 = 14; /* P1.6 */ +#if 0 static const uint8_t DEBUG_UARTRXD = 3; /* Receive Data (RXD) at P1.1 */ static const uint8_t DEBUG_UARTTXD = 4; /* Transmit Data (TXD) at P1.2 */ +#else +static const uint8_t DEBUG_UARTRXD = 4; /* Receive  Data (RXD) at P1.2 */ +static const uint8_t DEBUG_UARTTXD = 3; /* Transmit Data (TXD) at P1.1*/ +#endif #define TWISDA1_SET_MODE (INPUT) #define TWISCL1_SET_MODE (INPUT) #if defined(__MSP430_HAS_USCI__)   You can see I switched the pin numbers. For the msp430g2452, the TX pin is 3 (P1.1) and the RX pin is 4 (P1.2). My change above will break support for all the USCI based UART versions.  
     
    The Energia code really should be checking which type of UART is being used and flip the pin numbers.  You might want to file a bug on the Energia github issues page and complain. @@energia
     
    Edit: .. never mind I filed one for you: https://github.com/energia/Energia/issues/874
     
    -rick 
  9. Like
    tripwire reacted to chicken in [POTM] dAISy - A Simple AIS Receiver   
    Ah sorry, I was looking at the original schematic posted in this thread.
     
    The 220pF is an AC coupling cap. It's there to avoid any DC from the antenna port to get to the radio. Anything on the order of 100pF should be fine. 220pF was what I had at hand.
     
    Here's a good explanation of coupling caps:
    http://www.learningaboutelectronics.com/Articles/What-is-a-coupling-capacitor
  10. Like
    tripwire reacted to dubnet in Is there a way in Energia to access the LPM's?   
    @@JasonP Turns out it wasn't a task related issue after all. I had disconnected the jumpers to the XDS110 portion of the board so that power being measured by Energy Trace (via a MSP-FET) was only the target MCU. However, I overlooked the internal/external JTAG switch. Once it was set to the external connector, power consumption dropped from 100uA to less than 4uA. A classic facepalm moment...
  11. Like
    tripwire reacted to dubnet in Is there a way in Energia to access the LPM's?   
    With the MSP432 Launchpad you can use CCS6 and Energy Trace to measure LPM supply currents. You can import your Energia sketches into CCS and do full debug as well.  I haven't had a lot of success getting much below 100uA on the 432 with my testing, both with Energia MT using long delays in the program, and with a TI LPM3 (maybe LPM3.5, can't remember for sure) demo program under CCS.  Under Energia I shut down the serial port prior to the delay (which helped) and the CCS demo program supposedly put all the ports in a low power configuration prior to calling LPM3.x  I am sure that I am missing something and am planning to dig deeper when I get some free time. 
  12. Like
    tripwire reacted to greeeg in Olimex MSP430-G2744BP BoosterPack   
    Back in 2013 TI announced they would be releasing the G2744 in PDIP 40 package. http://43oh.com/2013/03/ti-announces-bigger-and-better-value-line-msp430-controllers/
     
    But later they removed that option and never distributed them. It appears that only Olimex have them. Which makes it very difficult to justify IMO.
     
    It basically means, for every project you can't just by a single IC, you would need to buy the whole dev-board from Olimex.
     
     
    It is unclear if Olimex is just sitting on stack now, or if TI actually still make the PDIP chips for them.
  13. Like
    tripwire reacted to BRey in Energia MT SPI transfer question   
    I am slowly learning about RTOS with Energia MT. In working out some issues with libraries, I found this in the SPI transfer() function:
     
      /* wait for transfer to complete (ie for callback to be called) */
        while (transferComplete == 0) {
            ;
        }
    Lines 191-194 here:  https://github.com/energia/emt/blob/a350116673c64a5ba71a034b3baaa384b888776e/src/ti/runtime/wiring/SPI.cpp
    (Energia MT uses DMA for the SPI transfer and an interrupt callback routine sets transferComplete=1)
     
    Other RTOS reading leads to me believe this is not the best way to do this, or is this so fast that using an RTOS wait doesn't make sense?  (The AIR430boost library uses a semaphore)
     
    B
  14. Like
    tripwire reacted to spirilis in Energia MT SPI transfer question   
    I guess SPI single-byte transfers usually are ridiculously fast to the point that it's more efficient to busy-wait the CPU than to let the RTOS go through multiple context-switches (via some delay) until the task is ready to write the next byte.  Task switching in RTOS land makes more sense for buffer-at-once (>=4 bytes we'll say) transfers with DMA.
     
    Not too familiar with the TI-RTOS stuff, but if the AIR430Boost library does large buffer-per-request type of SPI transfers, then semaphore (task-suspend) synchronization is the ideal.
     
    It's sort've a shame that Arduino/Energia doesn't really have buffer-transactional API functions built in.  There is the .beginTransaction and .endTransaction stuff (not sure if Energia implements it, it didn't for msp430 or Tiva last time I checked) but what I've seen of the implementation has implied that this is more about encapsulating SPI settings and securing the SPI bus against interrupt service routine intrusion (i.e. you still do byte-by-byte transfers that are real-time on the bus with the sketch code's execution, but you can expect any ISRs that have registered the fact they do in-ISR SPI transfers have had their IRQ lines disabled temporarily).
  15. Like
    tripwire reacted to spirilis in RANT: Cloud of this, IoT of that . . .   
    The real problem always boils down to the ownership IMO. Cloud this, cloud that smells offensively to me of greedy entrepreneurs trying to shoehorn a rent-seeking paradigm into something that should be anything but. It's stunting the widespread adoption IMO by keeping it only within the realm of the wealthy and early-adopting type of folks. The terms themself in combination with the verbiage used around it defines the space of what people know and think about, to the marketer's advantage.
  16. Like
    tripwire reacted to cde in Stupidest Thing you had to Troubleshoot?   
    Yeah, VIH levels are tricky. The AVR Mega line is supposed to accept VCC * 0.6 as input high, but that's the minimum. So 3 at 5V. But if your at 5.1V and the input is at 2.9V...
  17. Like
    tripwire reacted to Fred in My F5529 LaunchPad is back from 2 weeks vacation   
    I'd say that if the FET / hub side of things is where the problem is, then it makes a good candidate to be programmed using the FET on the other launchpad and left permanently in your project. You could even cut the broken FET part off.
     
    (Edited for phone keyboard typos.)
  18. Like
    tripwire reacted to tonyp12 in Hard intvec rejumping through Soft intvec for Firmware updates   
    The idea is that any new firmware does not include the upper 512bytes of Flash,
    but as IRQ vectors will change with new firmware but is now part of the firmware-block as compiler Intvec have been moved -512 bytes down.
    If you put your custom Loader in the upper 512bytes too and as you never erase this block, much less chance of bricking.
     
    I guess opcode for BR could change from msp family? but this does work on a G2553.
    ?CCS could use pragma location if it can not handle @
     
    Not all vectors are available or used, so you should fill them with random value instead for the BSL password if you want some security.
    But at least the BSL password will now stay the same from reversions.
    static const unsigned int jumptable[49] @0xFF9E = {   0x4210,0xFDE0,     // indirect BR &0x----   0x4210,0xFDE2,   0x4210,0xFDE4,   0x4210,0xFDE6,   0x4210,0xFDE8,   0x4210,0xFDEA,   0x4210,0xFDEC,   0x4210,0xFDEE,   0x4210,0xFDF0,   0x4210,0xFDF2,   0x4210,0xFDF4,   0x4210,0xFDF6,   0x4210,0xFDF8,   0x4210,0xFDFA,   0x4210,0xFDFC,   0x4210,0xFDFE,   0x0000,            // BSL signature   0xFF9E,0xFFA2,     // real intvec   0xFFA6,0xFFAA,   0xFFAE,0xFFB2,   0xFFB6,0xFFBA,   0xFFBE,0xFFC2,   0xFFC6,0xFFCA,   0xFFCE,0xFFD2,   0xFFD6,0xFFDA  }; int main( void ) {    WDTCTL = WDTPW + WDTHOLD;    // Stop watchdog timer   if (jumptable[0] == 0xffff) {while(1){};}; // need to use array for something Override default location of linker file and make a copy of it and move it to local project folder and edit:
    // ------------------------------------- // Signature memory and interrupt vectors //   -Z(CONST)SIGNATURE=FFDE-FFDF  // used by BSL -Z(CODE)INTVEC=FDE0-FDFF      // normally FFE0-FFFF -Z(CODE)RESET=FDFE-FDFF       // normally FFFE-FFFF
  19. Like
    tripwire reacted to Rickta59 in Changing Heap/Stack   
    If you moved the stack so that it occupies the lower end of ram, and pushed up the .bss and .data sections you could allocate a fixed stack that could throw an exception if it exceeded its limits. See this article http://embeddedgurus.com/state-space/2014/02/are-we-shooting-ourselves-in-the-foot-with-stack-overflow/ and find the section called 'A Smarter Way'  
    http://embeddedgurus.com/state-space/files/2014/02/fig3.jpg
     
     
    This approach would be best used during development and not during production. You could easily have two ld scripts, one setup for development and one setup for release.
     
    -rick
  20. Like
    tripwire reacted to spirilis in My time with FreeRTOS on the TM4C   
    OK, brief rundown of the "analysis" process for getting started with uDMA.
     
    A cursory look at the uDMA chapter in the TM4C123GH6PM datasheet:
    Micro Direct Memory Access (?DMA)The TM4C123GH6PM microcontroller includes a Direct Memory Access (DMA) controller, knownas micro-DMA (?DMA). The ?DMA controller provides a way to offload data transfer tasks from theCortex

  21. Like
    tripwire reacted to spirilis in My time with FreeRTOS on the TM4C   
    Huh... SSICR1 doesn't have the bit that SSIAdvFrameHoldEnable sets, at least on the TM4C123GH6PM, and check out driverlib/rom.h:
    #if defined(TARGET_IS_TM4C129_RA0) || \ defined(TARGET_IS_TM4C129_RA1) || \ defined(TARGET_IS_TM4C129_RA2) #define ROM_SSIAdvFrameHoldEnable \ ((void (*)(uint32_t ui32Base))ROM_SSITABLE[20]) Sounds like a Snowflake (TM4C129)-only feature.
  22. Like
    tripwire reacted to energia in Low energy API: reduced transmit power, reduced clock ?   
    Do you need your WiFi to be always on? Attached are a couple low power Sketches that put the processor to sleep for a certain amount of time. One Sketch will have WiFi always connected and the other will disconnect from WiFi during that time putting the host MCU and the network processor to sleep for that time.
     
    This significantly reduces the overall power consumption. 
     
    This will eventually be integrated into Energia but could help you in the meantime.
     
    WiFiPowerSketches.zip
  23. Like
    tripwire reacted to spirilis in My time with FreeRTOS on the TM4C   
    Elaborating, what I meant was the SSI peripheral may have this as a built-in thing... a quick way to find out may be to test different bitrates.  I have this configured for 8MHz presently but I'll try 500KHz, 1MHz, then 20MHz (I think it can do that).
     
    First, at 8MHz (also it appears it can't do a clean perfect 8MHz since it's dividing binary from 80MHz), the width between bytes is 0.24uS (just checked with the saleae)
     
    Now, 500KHz:

     
    1MHz:

     
    20MHz:

     
    (forget the "f" frequency for those last 2, the Saleae software is making the assumption that the space between bytes is part of the waveform)
     
    The timing between bytes is proportional to the speed, so it's probably a constant # of SPI clock cycles that it uses as a delay.  Unfortunately this does not appear to be configurable.
     
    You can do up to 32-bit SPI comms with this peripheral, which should provide a constant 32-bit waveform, but I would imagine each 32-bit word would then be spaced by a similarly speed-proportionate amount of time.
  24. Like
    tripwire reacted to spirilis in Putting a While Loop within a While Loops   
    what is "++10" or "--10"?  never seen that notation
     
    usually it's += 10 or -= 10
     
    also can you please indent the code correctly?  It's hard to ascertain what right-braces "}" corresponds to which loop the way it's formatted here.
  25. Like
    tripwire reacted to agaelema in Embedded_Printf   
    My initial objective is not create the smaller or better code, is just learn more things related to embedded world.
     
    This code has a lot to improve in size and performance, but anyway, can be useful for someone, even though there are many others.
     
    Thanks for the link, I will study it. The approach to convert the number seems to be more efficient.
×
×
  • Create New...