Jump to content
43oh

jpnorair

Members
  • Content Count

    718
  • Joined

  • Last visited

  • Days Won

    18

Reputation Activity

  1. Like
    jpnorair reacted to chicken in Coding for MSP430 in C++   
    You might want to check out oPossum's first link.
     
    You're right with your concerns regarding performance and memory when using regular C++ classes. My experience as well, at least if your project does not require OOP features (inheritance, dynamic dispatching etc). Though your point about "easy to navigate" is arguable and probably more depends on the author than the language.
     
    However oPossum does use C++ templates. As shown in his first post C++ templates have some advantages when implementing reusable and configurable libraries. Check it out - initially I was skeptical too.
    http://forum.43oh.com/topic/2358-software-iic-master-in-c-c-class-and-c-template/
     
    Regards
    Adrian
  2. Like
    jpnorair got a reaction from spirilis in [ ENDED ] Nov-Dec 2012 - 43oh Project of the Month Contest   
    I'm finishing an MSP430 + CC430 dev kit that does wireless, Energia, USB, and all kinds of other stuff that should knock the AVR Arduino folks on their butts. I will throw in 3-pack of these modules for the prize! (kit is called "OMG" for Opentag Module+Gadget) I would submit the project itself, but it doesn't seem right -- this is a long term project that just happens to be finishing-up during Nov/Dec.
  3. Like
    jpnorair got a reaction from thanhtran in Garage door opener   
    There are several glitches in these parts.
    They don't like to be forced into idle during RX or TX process. Don't do it, it can have unpredictable consequences.
    Don't use CS/CCA. It just doesn't work properly and it inexplicably takes longer than reading the RSSI directly upon lock.
    The WOR timer does not always send an interrupt when it expires.
    You need to reset TEST0 to a specified value from SRFS (I think that's the one) everytime you engage RX or TX. This is one of the most cryptic and most important errata to workaround. I suspect it could be causing your lockup.

  4. Like
    jpnorair got a reaction from gsutton in Coding for MSP430 in C++   
    Disclaimer: this is my general opinion based on a lot of experience developing hyper-optimized embedded stuff for communications, RTOS, signal processing, graphics, and crypto, for which I think C++ is horribly suited. There are always exceptions, so it's not a riff at anyone personally who likes C++. Of course, C++ can do everything that C can do, so what we are really discussing are "best practices" of typical C++ coders.
     
    That said, I've never seen a good, clean, elegantly optimized piece of C++ code, apart from what I've seen from some game devs. As a case study, in 2010 I was contracted to solve a performance bottleneck caused by OpenCV for BeagleBoard. After taking a month to remove all of the "C++ best practices" in favor of C practices, guess what, 20x performance improvement. I will outline here some of the dumbest C++ practices for embedded & performance-oriented code:
    malloc everywhere (or just using objects instead of pointers). Seriously? Are you spawning threads? no? Then why in the name of Zeus are you mallocing?
    Passing objects when a pointer will do. You can argue that the compiler might be optimizing these out, but, in my experience, it's a lot better to be able to just scan through the C and find the problems than to have to analyze the crap out of it during runtime or read through generated assembly, required because there isn't a transparent connection between the compiler and the code.
     
    Storing sequentially accessed data, often of multiple objects of the same class, in the objects instead of in a coherent data block. In archs that have slow memory access -- MSP430 is one -- this is a great way to waste CPU cycles. On bigger multicore systems with shared L2 Cache it can actually be much, much worse.
     
    Inheriting objects into other objects, such that design changes during optimization cause cascaded errors that are difficult to find in large projects.
     
    Making efficiency compromises in order to design objects for multiple inheritance.
     
    Using conditional logic instead of arithmetic transforms and bit twiddling, and using pointers naively because strong typing is a religion.
     
    Hiding-away object class definitions deep into the file structure, or making stuff private when you're building an open source project. Open Source... the guy from Russia who downloaded your shit just changed all the private classes to public, anyway. Save Boris the 30 minutes and just make a comment.
     
    On the note of comments, comments are better than "self-commenting code." Self-commenting code is a disgrace. I'm not German, so I'm not trained at an early age to ReadWordsThatAreSixtyLettersLongWithWeirdCapitalizationRules. For whatever reason, I see this practice a lot in C++ and Java, but rarely in C.

    I could probably think of more, but those are the ones that come to mind. Anyway, I'll throw down the gauntlet. I will offer a free optimization consultation of C++ source to doubters on this thread.
  5. Like
    jpnorair got a reaction from mtlevine0 in RGB LED PC Case Fan   
    Have you ever used Eagle before? I use DipTrace. It is a billion times more intuitive. The autorouter is not great, but I do RF boards mainly, so autorouting is always going to be bad. Anyway, DipTrace is like a cheap version of the old Protel, with the added benefit that it can import Eagle footprint libs into DipTrace.
  6. Like
    jpnorair got a reaction from bluehash in Hi from Finland   
    Answer: Salmiakki. It is best enjoyed while watching rally driving.
  7. Like
    jpnorair got a reaction from GeekDoc in RFID-Reader w/o special chips   
    The TMS3705 provides an LF Front-end for TI's LF, which can be made to support ISO 18000-2 HDX. 18000-2 FDX is more difficult because it uses backscatter modulation. The TMS3705 is really basic -- it doesn't do much protocol at all, but it will give you an LF front-end and a ref design for the antenna in a SOIC-16. There's also a dev kit for it.
  8. Like
    jpnorair got a reaction from thanhtran in MSP430F5510 warms with RST pin pulled low   
    Your board might have a flaw. I have never experienced this, exactly, but I have had similar experiences with faulty boards. I have a broken EXP5529 board, so even if it's from TI, it doesn't mean it is flawless.
     
    Anyway, always buy two boards.
  9. Like
    jpnorair reacted to hova in Vehicle anti-theft / RFID fob.   
    Some inside info for you. There are many systems that use something similar , but there are actually laws (and codes of ethic) that dictate how these work (for the most part).
     
    A : You do not want to disable something that ; in the event of a failure (of the device) , you would cause the vehicle to lose power or shut off.
    B : Refer to A.
     
    Most remote start and almost all ad-hoc immobilzer systems use the Starter interrupt. In every car (most) there is a wire going from your ignition to your starter relay. This is on of the very few places you could interrupt the starting of a car , without affecting its driveability. A lot of remote start applications monitor either an injector or cam/crank signal to verify that the module is working. Some of them do interrupt the fuel supply , but this is only if the ID tag (any number of implements such as PASSLOCK , RFID) is out of range. This is a very risky system , as if you are in a 10,000lb truck (just for example) , going down the interstate at 80mph , and you lose fuel , you in turn lose power steering , and 90% of brake power. This , as I'm sure you can imagine , is a bad thing.
     
    The safest way is the way it is always done , but putting other implements in place to make it more difficult or impossible to gain access to the circuitry. With enough time , I would have no problem bypassing any security measure that may be put into place if I was thouroughly motivated. (pop the trans into neutral and push it , tow it , break the ignition cylinder and jump the starter , bump start it , picking the ignition lock , or the ever popular master key.)
     
    You're best best would be a multi-front approach. Such as
    A: Starter Interrupt (from the ignition cylinder , as many remote starts and buy-here-pay here code boxes work)
    B: Starter Relay interrupt (located behind the glovebox or somewhere inconspicuous , even mounted remotely , possibly adding another relay to power the relay. Using a uC , you could have several failsafes (lights on , door open for example , or any number of circuits that can be tapped into to monitor a condition of your choice)
    C: Tamper proof screws and bolts to secure the column and dash cladding (Tamper proof torx dont count. Single use flathead screws would be your best bet , but your mechanic probably wont have these {i happen to have a master set , so this wouldn't be foolproof , it would just take longer})
    D : An alarm system (you could easily make this , so that if your doors are open , and your rfid key isnt within range , the alarm would sound. Alerting you to nefarious activities) .
     
    The thing that comes to mind at this point is the new mazda's use an RFID key that automatically unlocks the doors if you are within a certain range. You dont even put a key in. As long as you have the FOB/CARD on your person , you simply get in the car , and turn a knob (switch). When you get out , and walk out of range , the car beeps , and/or shuts off.
     
    The possibilities for notification are endless. I'm fairly certain you could make the MSP ring your cell , send you an email , make an app do a dance , or whatever your heart and mind can conjure. The main thing you need to watch , is as I said , dont modify the fuel or battery circuitry unless you are using a mechanical device. A fuel kill switch can be (and I have done a few times ) wired into the headlight circuitry , or other such circuits (although headlights are one of the few that have the power surplus , and will be applicable without the car already running). A battery kill is going to be difficult to make , even mechanically. There are race switches available that can handle the amps , but finding an 800amp relay may be an issue. Running 0gauge wire inside the cabin is extremely noticeable , and if a thief blows your hood latch , they will be even more motivated by the thought of a juicy stereo system once they see huge wiring going inside the car.Which at that point a decent thief would just remove your battery , break a window , and pop it into neutral."Decent" being an ironic sentiment , you know what I mean.
     
     
    I'd be happy to discuss your options via pm , if you're concerned about your secrets getting out. I have access to wiring diagrams and schematics for any car out there , so I could point you in the direction that would be most effective on whatever vehile you are looking to secure.
     
     
    Heres a couple of non-biased links , just to show what I am babbling about.
     
    Tamper Proof one-way machine screws (example) sorry if outside links are frowned upon. This was just the first site google popped up with them.
    http://www.coxhardware.com/p-2235-8-32-one-way-head-machine-screws.aspx?gclid=CK-Pmr3dubMCFao7MgodB38AiA
     
    Turns out there are a few 800a/100v relays. I dont do too much online ordering ,so I use what is available locally , and these are most certainly not.
     
    http://pewa.panasonic.com/components/relays/automotive-relays/high-capacity-dc-automotive/
     
    Buy here pay here code box. I have installed these , along with GPS enabled models. Paytech is the brand I have previously installed , but for the most part , they are easily bypassed. How they work : pay your months bill , get a 5 digit code , enter it , and it let's you start your car for another 30 days... Power , ground , interrupt relay (and relay power/gnd). The gps models require you to run an antenna which is usually a complete PITA.
    http://www.payteck.cc/news.html
     
    There are also ways to prevent your transmission from being tampered with , but this usually resorts to putting a metal plate on the undercarriage , covering the engine/trans. Again , this is limited unless you use thick steel , and tamper proof bolts. A good thief(lol) will have the facilities to cut the bolts , and remove the pan. If this isnt an option , a tow truck can always be employed , so you are never 100% covered. Few people will question someone hooking a car up to a stinger (tow truck) in a crowded mall parking lot. Even if the guy comes out , the person can use some social engineering to dupe the victim , either saying he was parked illegally , owed fines , etc. The only way to stop this if you happen to catch them , is to call the cops and tell them what is going on , and perhaps using your own judgement how much your car is really worth (IE:concealed carry , violent means).
     
     
    This is all at your own risk , I make no warranty or guaruntees hitherto. I am an ASE certified technician , fluent in locksmithing , vehicle circuitry , failsafes , and the like ; but I cannot persuade you to do anything you dont deem logical and safe. DO NOT pull a gun on the guy repo'ing your car , and say I told you to do it.
     
     
    Sorry , disclaimers suck , but I have to cover my rear as well.
    I'll help any way I can.
    -hov
  10. Like
    jpnorair got a reaction from jsolarski in [ ENDED ] Nov-Dec 2012 - 43oh Project of the Month Contest   
    I'm finishing an MSP430 + CC430 dev kit that does wireless, Energia, USB, and all kinds of other stuff that should knock the AVR Arduino folks on their butts. I will throw in 3-pack of these modules for the prize! (kit is called "OMG" for Opentag Module+Gadget) I would submit the project itself, but it doesn't seem right -- this is a long term project that just happens to be finishing-up during Nov/Dec.
  11. Like
    jpnorair got a reaction from spirilis in MSP430 DMA   
    I understand what you want to do, and unfortunately it is not possible. Using DMA will *still* give you greater performance, though, because it copies 1 byte per clock cycle instead of 1 byte per 8 clock cycles. If that it not enough performance, you should be using a Cortex M. Considering that you never had a low power requirement, you probably should have been using a Cortex M from the beginning.
  12. Like
    jpnorair got a reaction from bluehash in MSP430 DMA   
    I agree that the Cortex M DMA is much more sophisticated, but MSP430 is not an architecture designed for extensive data movement.
     
    The reason to have DMA on MSP430 is to enable fewer interrupts for peripheral copies, and less power usage servicing interrupts. For memcpy() it allows a performance advantage because DMA copies 1 word per 2 clock cycle. Doing a Duff Device in code is more like 5-10 cycles per word copy. As memcpy() is officially a blocking call, even in the CPU is usable during the DMA transfer, it must use a busywait loop in parallel to the transfer operation.
     
    I have worked with USB on MSP430 and Cortex M. The CM3 is must better suited for any kind of complexed MAC. The MSP430 is still OK unless you are targeting a high throughput application, or an application with many USB endpoints. So far you have done a great job on the USB project -- if you needed high throughput, though, I am curious why you chose MSP430.
  13. Like
    jpnorair got a reaction from RobG in [ ENDED ] Nov-Dec 2012 - 43oh Project of the Month Contest   
    I'm finishing an MSP430 + CC430 dev kit that does wireless, Energia, USB, and all kinds of other stuff that should knock the AVR Arduino folks on their butts. I will throw in 3-pack of these modules for the prize! (kit is called "OMG" for Opentag Module+Gadget) I would submit the project itself, but it doesn't seem right -- this is a long term project that just happens to be finishing-up during Nov/Dec.
  14. Like
    jpnorair reacted to abecedarian in [ ENDED ] Nov-Dec 2012 - 43oh Project of the Month Contest   
    I'll offer up (mostly) the same thing I did on stellarisiti.com:
     
    1) I will contribute $10 US to the prize, be it a gift certificate to whichever online source or cash prize, at a minimum, assuming the winner uses an MSP430 Launchpad.
    ... OR ...
    2) I will contribute $20 US to the prize, if the project also includes a C2000, Stellaris Launchpad or a 2nd MSP430.
    ... OR ...
    3) I will contribute $40 US to the prize, if the project includes an MSP430 Launchpad and at least two of the following: MSP430, C2000 or Stellaris processor.
     
    The criteria are mutually exclusive- if the winner meets the criteria for [3], the winner can't claim [2] and [1], for example.
     
     
    I will entertain, pending community opinion of course, the idea of "runner ups", provided those meet certain other standards. A runner up cannot get a prize above the winner: for instance if the winner doesn't meet the [3] criteria, neither can the runner up, right? Therefore the runner up(s) would win the prize(s) below the winner... catch my drift? Anyone could hook up a few MCU's and make some lights blink, but it's more about doing the most with the hardware and software than just hooking things up and making lights blink.
     
    I will stipulate that if you enter the same project here, on 43oh.com as well on stellarisiti.com, you cannot claim a prize from both, should you win.
     
     
    (My wife is going to hate me for doing this... :grin:)
  15. Like
    jpnorair got a reaction from jazz in MSP430 USB Benchmark   
    I'm finishing the latest version of my USB CDC subsystem. It is written in C and now compiles quite small: about 1.4KB -- I have made hundreds of architectural improvements and optimizations over the basic TI USB library, mostly for the purpose of reducing code size. I will benchmark it on 256 byte transfer size soon. My system is not intended for streaming transfers, so in normal usage there is protocol parsing latency. I will write a special benchmark app, though, which does no protocol parsing and uses none of the task-based controls. I am pretty busy with some other things, so I'll probably get to it in about 2 weeks.
  16. Like
    jpnorair reacted to jazz in MSP430 USB Benchmark   
    I'm expecting from your benchmark, confirmation of my results, because officially TI max transfer rate (presented for CDC) 512 KB/s is far from the values that can be reached (using bigger transfer at once, for example 2 MB). It will be OK if you prepare test for transfer of more than 1 MB data (at once) between uC/PC.
     
    I done genric bulk benchmark for dummy transfer (1 MB/s), normal data transfer without double buffering (close to 900 KB/s) and with double buffering (over 1000 KB/s). I will post benchmark software here so anybody will be able to do it.
  17. Like
    jpnorair got a reaction from bluehash in MSP430 USB Benchmark   
    I'm finishing the latest version of my USB CDC subsystem. It is written in C and now compiles quite small: about 1.4KB -- I have made hundreds of architectural improvements and optimizations over the basic TI USB library, mostly for the purpose of reducing code size. I will benchmark it on 256 byte transfer size soon. My system is not intended for streaming transfers, so in normal usage there is protocol parsing latency. I will write a special benchmark app, though, which does no protocol parsing and uses none of the task-based controls. I am pretty busy with some other things, so I'll probably get to it in about 2 weeks.
  18. Like
    jpnorair reacted to jazz in MSP430 with USB support?   
    I done my in assembler, stable & workable CDC, and it is under 2.7KB, on MSP430F5508. Unfortunately (under Win32) there is problem (can transfer only one packet per frame if the packet size is less than 64 bytes) with (original) usbser.sys, and now I am trying with winusb.sys.
  19. Like
    jpnorair got a reaction from bluehash in maximum range for ez430-rf2500?   
    Years ago I used a CC2510 with Smart RF Studio and a larger antenna to achieve ~150m outdoor line-of-sight. I don't actually remember what modulation I was using, but a good guess is 28kbps FSK +/- 50kHz, given some of the things I work with.
     
    If you want range, you can develop your software on the 2500 and then switch to the CC430, CC11xx, or another sub-1GHz transceiver. If you can build a decent antenna, you can get insane range from the 433 MHz band. I have achieved reliable 1km outdoor NLOS with a CC1101 using 28 kbps GFSK +/- 50kHz @ 433 MHz, -3dBm. In the USA you can use the 900 MHz band with greater power, but it also falls-off faster. In most other places in the world, the 862/866/868 bands are regulated more strictly. In any case, there's basically no good reason to use 2.4 GHz unless you're doing something high-throughput.
  20. Like
    jpnorair got a reaction from bluehash in MSP430 with USB support?   
    To close the loop on this, some time ago I managed to get a generally stable & workable CDC-only implementation of the MSP430 USB firmware working. I've tested mostly on Mac & Linux. It's also trimmed-down to under 3.5KB, and I expect I could get it down to maybe 2.7KB if I really tried. The team that coded the MSP USB library has __atrocious__ coding style. The code is on GitHub as part of my OpenTag project. The platform is a 5509-based stick.
  21. Like
    jpnorair got a reaction from pine in maximum range for ez430-rf2500?   
    Years ago I used a CC2510 with Smart RF Studio and a larger antenna to achieve ~150m outdoor line-of-sight. I don't actually remember what modulation I was using, but a good guess is 28kbps FSK +/- 50kHz, given some of the things I work with.
     
    If you want range, you can develop your software on the 2500 and then switch to the CC430, CC11xx, or another sub-1GHz transceiver. If you can build a decent antenna, you can get insane range from the 433 MHz band. I have achieved reliable 1km outdoor NLOS with a CC1101 using 28 kbps GFSK +/- 50kHz @ 433 MHz, -3dBm. In the USA you can use the 900 MHz band with greater power, but it also falls-off faster. In most other places in the world, the 862/866/868 bands are regulated more strictly. In any case, there's basically no good reason to use 2.4 GHz unless you're doing something high-throughput.
  22. Like
    jpnorair got a reaction from larsie in MSP430 with USB support?   
    To close the loop on this, some time ago I managed to get a generally stable & workable CDC-only implementation of the MSP430 USB firmware working. I've tested mostly on Mac & Linux. It's also trimmed-down to under 3.5KB, and I expect I could get it down to maybe 2.7KB if I really tried. The team that coded the MSP USB library has __atrocious__ coding style. The code is on GitHub as part of my OpenTag project. The platform is a 5509-based stick.
  23. Like
    jpnorair got a reaction from larsie in MSP430 with USB support?   
    Soldering the package might be a breeze, but getting the USB working can be difficult. TI has a Windows-based configurator program that can dump out a mostly-working driver to your specifications, but I've found the CDC (i.e. virtual COM port) to be a giant pain to implement. In my tests, sometimes it works, sometimes it doesn't -- although I will admit that the USB port is hooked up to a Linux host, which has not been TI's forte in past USB device driver attempts. When it doesn't work, it will also crash your firmware because it will get stuck in a Suspend-Reset loop.
     
    I'm hoping that it's something I'm doing wrong, but, in any case, I'd recommend HID over CDC if you can manage that.
×
×
  • Create New...