Jump to content
43oh

gordon

Members
  • Content Count

    536
  • Joined

  • Last visited

  • Days Won

    13

Reputation Activity

  1. Like
    gordon got a reaction from just_another_noob in Detecting interrupt edge   
    Not sure I understand, are you perhaps looking for (P1IES & BIT3) == 0? This will be true when interrupt on the rising edge is selected, conversely, (P1IES & BIT3) != 0 will be true when interrupt on the falling edge is selected.
     
    (PS. yes, I like to fully spell out conditionals )
  2. Like
    gordon reacted to rockets4kids in Need Cooking Help !   
    Assuming this is not a troll....
     
    The best source for "American" cooking is "The Joy of Cooking." There are a number of versions (1931, 1964, 1975, 1997, 2006) that reflect popular American cooking at the time of publication. You are *probably* going to want the 1964 edition which embodies 1950s palette.
  3. Like
    gordon reacted to zeke in Hot air pencil recommendation?   
    Uhm... I like a good hack but why bother with this one when you can get a hot air rework station for <$100?
     
    Dave Jones reviewed it on his EEVBlog: Atten 858D Hot Air Rework Review.
     
    Surely this would do the job for you.
  4. Like
    gordon reacted to jsolarski in Hot air pencil recommendation?   
    maybe try this
    http://www.instructables.com/id/DIY-Hot-Air-Soldering-Iron-1/
  5. Like
    gordon got a reaction from EngIP in What's the big idea with Linux?   
    Here's a bit of an advice how to get started. Even better, think of it as a collection of random thoughts as to how I would start this project. Bear in mind I have not been doing this for a while, so take things with a grain of salt.
     
    Do mind the actual router type and revision. The WRT54G family sports numerous members, not all of them are suitable for running Linux. Most of the 54GL ones are OK, but there was something whacky around revision 5, so do read up on this before buying.
     
    Definitely start by getting a serial connection to the board first. There are two of them are on the PCB, bringing them out is a matter of soldering some headers. They are 3.3V, so if you plan on plugging them into a real RS232 port (USB-serial converter), you need some level shifters as well (MAX232 or the alikes). If you have something like an FTDI serial cable which is 3.3V, you don't need level shifters. The one that you find CFE on will also be your system console in the Linux environment -- handy if you lose network connection to the device. Or looking at kernel stack traces .
     
    Break both of the serial ports out, it won't hurt. Verify you have a connection to the board and that you can reach CFE (the boot loader, sort of like a BIOS but isn't, for the WRT54GL). Poke around CFE a bit, but don't change things. If all goes well, you will not need to come in contact with it, but if all goes not well, it might be needed.
     
    You may also consider breaking out the JTAG. This will be needed if something goes really bad (you are not into these depths, so it should not). For accessing the JTAG port, there are a number of options ranging from cheap to not so, the simplest being a Wiggler clone (if you have a parallel port on your PC), or you may consider a more versatile option like an USBprog or some other multi-protocol device, like the Bus Pirate. I don't know if either of them works as a MIPS (E)JTAG though, these are just examples. Again, if all goes well, you won't need this at all.
     
    Don't waste time trying to make use of the router as a router. The WRT54GL is quite limited in flash space, so getting everyting on there ranges from quite a challenge to impossible. Don't mind about it doing routing, DSL, wireless, whatever (you may still be able to use it as a switch, though). You are not after this now. I think there are guides out there about expanding it's flash ("flash upgrade" is the colloquial term, however misleading this is, IMHO ), but you should generally be OK with the default 4M for starters.
     
    You will come by several OpenWrt revisions, and also the various projects about re-using the GPIO ports and bringing out I2C will be for various revisions. As driving these devices will involve (sometimes custom) kernel drivers, kernel versions are important. For that reason, just stick with the 2.4 kernel version images for this device. The majority of information out there will be for this. The actual OpenWrt revision (7.09, 8.04, 10.03) is less of concern as long as you are sticking with the 2.4 kernel. Use whichever OpenWrt revision the project you will use most things from uses.
     
    Finding the information, Google (of course ) will be your best friend. There are literally tons of information out there, on the OpenWrt wiki, forums, and individual's blogs, the usual places (I already found several I2C bus projects, the GPIO projects are by the buttload, you will not be short of information).
     
    I'll update this post if more things come to mind, but I think this generally will get you over the culture shock and put you on the right track. If anyone feels like adding something (or arguing with my POV for that matter), please do so .
  6. Like
    gordon got a reaction from EngIP in What's the big idea with Linux?   
    That is a (tiny) bit simpler matter. For starters, just get a good command of the shell, the toolchain and the API (which is mostly POSIX). For this, Cygwin is perfectly fine. Peruse then manual pages (man man).
     
    Also peruse online manual pages, and manual pages for OpenBSD, FreeBSD and NetBSD. The reason for this is that Linux man pages are generally somewhere between "incomplete crap", "inaccurate crap" and "lying crap"; the BSDs tend to do much better. Since all of them are Unix-lookalikes and all of them implement POSIX (with varying degree of success, but mostly there), there is a great deal of similarity, and you can re-use one another's API documentation to a considerable degree.
     
    You may also want to have a peek at SUSv4 (reading these manuals takes a bit of getting used to). You however need to observe the cases where facilities and functions documented in the above places differ a tiny bit from system to system (the deviations from the standard tend to be documented well, at least) -- told ya portability will take you to new heights of swearing.
     
    This is pretty overwhelming, so you probably want some book or online course material, but I can't be of help with these. The late W. Richard Stevens's Advanced Programming in the UNIX Environment used to be a gold standard, though by now probably newer ones just as good exist (it's not beginners material though).
     
    Write small and stupid programs that do small and stupid things. Write a bit of a network client, a bit of a network server. Take special care of getting familiar with inter-process communication techniques (IPC), concurrency techniques and issues, event-driven programming techniques (poll, select, epoll, ...).
     
    So far this is about 2 years' worth of things to do , but don't get scared, there are plenty small successes all along the way (yeah, frustration too).
     
    For the fun part, get yourself a Linksys WRT54GL (I suppose they are cheap by now) router (or anything else OpenWrt supports). The WRT54GL is a well-known, understood and documented (if you gather the stuff) piece of hardware, for which OpenWrt gives you a nice development environment (don't know if this one will work on Cygwin, though, but I see no particular reason why it shouldn't). Hack the hardware a bit (I think finding at least one I2C or SPI bus is no problem, but there are definitely a couple of GPIOs on the board), and write software for it using the OpenWrt toolchain. There probably isn't a simpler and cheaper way to taste the thing. Substitute the WRT54GL for something else, as appropriate -- I have stopped closely following these things a bit back. The OpenWrt TOH (and the Old TOH too, probably) is a good start.
     
    Good luck -- you are looking at one hell of a journey .
  7. Like
    gordon got a reaction from nuetron in [ ENDED ] June 2011 - 43oh Project of the Month Contest   
    You can, but you have to specify what your project is. You may improve upon your project until the closing date, but you can not change the project.
     
    This means that when POM opens, you may pledge "I am building a rocket silo control panel. So far I have two buttons and int main(){}, but stay tuned!", and this qualifies as your entry to the contest. You have to finish this by POM deadline. You have to finish this by POM deadline, ie. you can not say "Well, at the end of the day it turned out to be a marine wildlife exploration vessel" and expect to stay.
     
    Comments.
  8. Like
    gordon reacted to zeke in What's the big idea with Linux?   
    Remember that there's a lot of emotion bound up in this topic.
     
    If someone insists that you do something a specific way then you might start resenting that person. If a company insists that you code on a specific platform then you might start resenting them.
     
    It's all about freedom of choice and whether you can retain yours while doing something you love.
     
    Some people like coding in a walled garden but no windows, some like coding in the great outdoors where things seem wild and crazy and some just like to code behind the safety of big windows.
     
    Don't let anyone decide for you. Pick whatever OS makes you feel free then run with it.
  9. Like
    gordon reacted to nobody in Factory DCO calibration, how accurate?   
    It's simple: You are use MC_2 (count to 0xFFFF) = 0.065536 sec
    0.065536 * 600 = 39.3216 sec
     
    Use MC_1 and everything will be O.K.
     
    BTW: TI defines cca 3% accuracy of calibration...
  10. Like
    gordon got a reaction from EngIP in What's the big idea with Linux?   
    Because it is there on the majority of (at least a certain class of) embedded devices and systems. If you scale up from micros to bigger SOCs (which you probably will, eventually), the encounter will be unavoidable. Best get ahead of it.
     
    For me it's about as natural as (I'm guessing) Windows is to you. After the obligatory 8bit home computers and DOS I started using Linux. From my POV the question really is, why would anyone not use Linux? . Kidding, though. It's probably (likely) still quite a horrible (desktop) experience if you expect things to Just Work (disclaimer: I'm saying this with a little over 15 years of systems operations under my belt; I do know my way around), but at the same time this statement is quite biased: I have reasonably concrete ideas of how my (desktop) systems should look, smell and behave. This apparently contradicts about 110% of the current mainstream trends, so I tend to be grumpy about it (and at the same time I am shamelessly enjoying the exact same look and feel of my desktop for the last ~10 years).
     
    It completely doesn't matter on what system you learn. ISO C is ISO C on Windows, on Linux, and everywhere else. POSIX is the same everywhere. Platform-specific things exist everywhere, so there's no escape anyway. Trying to write truly portable code will greatly extend your swearing vocabulary.
     
    Start with Cygwin. It will give you most everything you would have on Linux for the getting familiar/doing programming aspect, without having to leave the comfort of the environment you got used to.
     
    Let it be on record that by replying to this, I am in no way, shape or form to be considered an "expert in C".
  11. Like
    gordon reacted to pheo in msp430afe253 TSSOP on a Schmartboard   
    So, today, i got my 0.65mm SOIC Schmartboard in the mail, and i'd like to share the result.
     
    The chip i've got is a msp430afe253ipwr, a very nice little chip with a lot of great features.
    I'm very proud to announce i've gotten it working with the Launchpad.
     
    The Schmartboard is a SOIC to DIP adapter available (cheaply!) from a few distributors.
    http://www.schmartboard.com/index.asp?page=products_smttodip&id=449
     
    A few notes about using the Schmartboard:
    I pulled this off using a very cheap 7$ department store soldering iron.
    That said, the lack of a good tip, good wattage, and a VERY steady hand prevented me from using the Schmartboards "super easy groove soldering" setup/trick.
    I read somewhere that when doing SMT soldering, use more solder!
    This may seem counter-intuitive, but adding LOTS of solder, and then wicking off the excess with solder braid seems to be a good practice.
     
    Anyhow, everything is working. All gpio ports, VCC, ground, RST, and TEST are connected. I don't know if there are any bridges yet, but all the gpio's will light the LED with P1DIR = P2DIR = 0xff.
     
    Im using the bleeding edge uniarch gcc and the git mspdebug. While gcc knows all about the afe253, mspdebug doesn't. I told mspdebug to treat the chip as a g2553, as they both have the same flash and ram size.
     
    Everything seems to work great.
     
    Cheers!

  12. Like
    gordon got a reaction from bluehash in Floating CCS License   
    The article zeke linked suggests three.
  13. Like
    gordon got a reaction from jsolarski in Beginner Questions   
    Depends on what you consider "supported" or what your needs/expectations are. As I have said before, with mspgcc4+mspdebug+vim I'm a perfectly happy hippo. There's also Insight for debugging, but it proved a bit shaky when I tried to use it (it's probably better with newer mspdebugs).
     
    Officially, CCS5.1 will (is said to) have proper Linux support. I don't really mind about it (except for trying to fish the compiler out and use it separately, without the Eclipse insanity).
     
    As for information, we have two topics, viewtopic.php?f=8&t=46 and viewtopic.php?f=8&t=449 dedicated to the subject. Book-wise the lot seems to have converged on MSP430 Microcontroller Basics (Amazon affiliate link with commission going to this blog).
     
    There is also a link to a quite comprehensive-looking tutorial (PDF) somewhere in the forums, but I can't find it now. Edit: found it: viewtopic.php?p=4479#p4473 (http://glitovsky.com/blog/?p=85).
     
    If you are new to programming in general, you also should pick up some C literature as well. Generally, K&R is everyone's first answer here, but according to a valued member while it teaches you C, it doesn't really teach you programming as such, so - depending on your previous experience - you may want to pick something else.
  14. Like
    gordon reacted to nobody in Critical sections - how?   
    Disable interrupts is the only safe way to do it.
     
    Don't worry, that you lose interrupt. Interrupt flags is set regardless of the interrupt is disabled or enabled. Interrupt routine begins immediately after you enable interrupts.
     
     
    ... Oh yes, it's another way to do it:
    Take advantage of the priority of interrupts: Place your critical instructions in a separate interrupt routine, which has a higher priority than other interruptions. (For example - use NMI - can also be started by the software way, setting the corresponding flag in the registry).
    But Disable interrupts is easier method.
  15. Like
    gordon reacted to xpg in Critical sections - how?   
    I think that any locking scheme is in vain. If the main-loop holds the lock while an interrupt is handled, the interrupt service routine has no way of passing the execution back to the main-loop. If you really want a data structure which you can update both from the main-loop and the interrupt service routing, I think you have to go with a lock-free scheme.
    Writing a lock-free queue is generally tricky, Dr. Dobb's has a nice example. However, I think that given only one consumer and one producer for the queue, it can be done with an cyclic queue on the MSP430. I haven't tested this, so please shoot it down if it doesn't work :-):
     

    #define QUEUE_MAX_SIZE 10 uint8_t queue_data[QUEUE_MAX_SIZE]; uint8_t queue_size = 0; uint8_t queue_head = 0; uint8_t queue_tail = 0; // pushFront cannot be called by both an ISR and the main-loop! void pushFront(uint8_t elem) { // First put the element in the queue. // Noone knows about it yet. queue_data[queue_head] = elem; queue_head = (queue_head + 1) % QUEUE_MAX_SIZE; if( queue_size < QUEUE_MAX_SIZE) { //Once we increase the queue_size, //the newly inserted element becomes "visible". // NOTE: If the 'ADD' instruction is generated for this, //this is an "atomic" operation. queue_size++; } else { // This is a potential race condition! // If the main-loop calls pushFront() and retrieves queue_tail // and is interrupted before it is written back, this will cause the // queue_tail to be corrupted (probably missing an increment). // Of course, we could simply choose that pushFront cannot insert // more elements that there are room for, avoiding // this conflict queue_tail = (queue_tail + 1) % QUEUE_MAX_SIZE; } } BOOL popBack(uint8_t *elem) { if( queue_size > 0) { // Fetch the element at the tail position. // Note, that this is not touched as long as no pushFront calls are performed on a full list. *elem = queue_data[queue_tail]; queue_tail = (queue_tail + 1) % QUEUE_MAX_SIZE; // Atomic operation if translated to 'DEC' queue_size--; return TRUE; } return FALSE; }
     
    As noted in the code, there is at least one "race condition". But it may be of use to someone nonetheless.
     
    Cheers,
    Paul
  16. Like
    gordon got a reaction from bluehash in mspgcc4 gcc vs. g++ code size   
    Any of you guys noticed that (probably only in certain circumstances/on certain code details of which I have not worked out) g++ tends to compile (sometimes substantially) smaller code than gcc (talking about MSPGCC4 that is)?
     
    gcc:

    $ msp430-gcc -Os -Wall -W -Wextra -Werror -g -mendup-at=main -mmcu=msp430x2211 -c main.c $ msp430-gcc -mmcu=msp430x2211 -o main.elf main.o $ msp430-objdump -DS main.elf > main.lst $ msp430-size main.elf text data bss dec hex filename 904 0 28 932 3a4 main.elf
     
    g++:

    $ msp430-g++ -Os -Wall -W -Wextra -Werror -g -mendup-at=main -mmcu=msp430x2211 -c main.c $ msp430-g++ -mmcu=msp430x2211 -o main.elf main.o $ msp430-objdump -DS main.elf > main.lst $ msp430-size main.elf text data bss dec hex filename 782 0 28 810 32a main.elf
     
    That's ~15% off of .text in this particular case, which is like a ~6% memory expansion for free.
     
    Nothing scientific about this yet, but if you are squeezing the last bits out of your MCU, this might save you an upgrade.
  17. Like
    gordon got a reaction from jsolarski in mspgcc4 gcc vs. g++ code size   
    Any of you guys noticed that (probably only in certain circumstances/on certain code details of which I have not worked out) g++ tends to compile (sometimes substantially) smaller code than gcc (talking about MSPGCC4 that is)?
     
    gcc:

    $ msp430-gcc -Os -Wall -W -Wextra -Werror -g -mendup-at=main -mmcu=msp430x2211 -c main.c $ msp430-gcc -mmcu=msp430x2211 -o main.elf main.o $ msp430-objdump -DS main.elf > main.lst $ msp430-size main.elf text data bss dec hex filename 904 0 28 932 3a4 main.elf
     
    g++:

    $ msp430-g++ -Os -Wall -W -Wextra -Werror -g -mendup-at=main -mmcu=msp430x2211 -c main.c $ msp430-g++ -mmcu=msp430x2211 -o main.elf main.o $ msp430-objdump -DS main.elf > main.lst $ msp430-size main.elf text data bss dec hex filename 782 0 28 810 32a main.elf
     
    That's ~15% off of .text in this particular case, which is like a ~6% memory expansion for free.
     
    Nothing scientific about this yet, but if you are squeezing the last bits out of your MCU, this might save you an upgrade.
  18. Like
    gordon reacted to oPossum in Need advice on components   
    Switch open == MSP430 port pin configured as input
    Switch closed == MSP430 port pin configured as output and driven low
  19. Like
    gordon reacted to RobG in Need advice on components   
    Capacitor can be used assuming you have common ground. I don't think you need to worry about isolating it.
    In cases where you do need to isolate ground, the most common method in audio is a transformer, usually 1:1 or 1:4.
  20. Like
    gordon got a reaction from jsolarski in Beginner's inventory needs   
    So You Want to Build Electronics is a nicely done blog post by our member PhirePhly on the ever-popular subject of "so I want to build electronics, what inventory do I need to get started?".
  21. Like
    gordon got a reaction from PhirePhly in Beginner's inventory needs   
    So You Want to Build Electronics is a nicely done blog post by our member PhirePhly on the ever-popular subject of "so I want to build electronics, what inventory do I need to get started?".
  22. Like
    gordon got a reaction from devilsnare in Microcontroller doesn't work off programmer   
    Sounds like you don't have reset (pin 10) pulled high on your board.
  23. Like
    gordon got a reaction from devilsnare in Microcontroller doesn't work off programmer   
    Connect it to VCC via a 10K or thereabouts resistor.
  24. Like
    gordon reacted to RobG in MSP430g2231 two interrupts   
    You can also use both ports, P1 and P2 which have separate interrupt vectors.
     

    #pragma vector=PORT1_VECTOR __interrupt void port1_Interrupt (void) { } #pragma vector=PORT2_VECTOR __interrupt void port2_Interrupt (void) { }
     
    Another tip, if you need your interrupt triggered on both edges, tie two pins together.
  25. Like
    gordon got a reaction from fj604 in The portable LaunchPad   
    No, really. The portable LaunchPad .
     
    Some time back I inherited a big pile of used, impractical-to-reuse DAT tapes. They've been lying around not doing much useful, but the arrival of the LaunchPad triggered an idea: their cases are ideal containers for small stuff.
     
    I keep an LP and a separate box of assorted random junk in my backpack all the time; they are safe (the cases are quite sturdy and close well), and are always at hand, should some time for a hacking session be found.
     

    Add a third one with one of these tiny breadboards and a couple of flexible jumper wires, and you have a full-fledged lab-on-the-go in space less than two packs of cigarettes .
     
    The cases also make nice storage for components in general -- a bit hard to fish things out of them (definitely harder than these storage units with drawers), on the plus side it's also much harder to spill half a million stingy beasts on the carpet.
×
×
  • Create New...