From jwbruce at ece.msstate.edu Mon Sep 6 09:51:51 2010 From: jwbruce at ece.msstate.edu (J. W. Bruce) Date: Mon Sep 6 09:52:13 2010 Subject: [ece4723] Fwd: The Embedded Muse 198 In-Reply-To: <201009061400.o86E09Tk002871@jade.serverhost.net> Message-ID: <12647660.88491283784711011.JavaMail.root@zimbra.ece.msstate.edu> Jack sends a somewhat periodic e-newsletter out to embedded systems engineers. There is usually something of interest or humor hidden in there. Enjoy your Labor Day holiday. jwb ------------------ J.W. Bruce, Ph.D., Associate Professor Department of Electrical and Computer Engineering Mississippi State University 406 Hardy Road, Simrall 335 Mississippi State, MS 39762-9571 Office: (662) 325-1530 FAX: (662) 325-2298 ----- Forwarded Message ----- From: jack@ganssle.com To: tem@freelists.org Sent: Monday, September 6, 2010 8:59:01 AM GMT -06:00 US/Canada Central Subject: The Embedded Muse 198 -------------------------------------------------------------- Embedded Muse 198 Copyright 2010 TGG September 6, 2010 Permanent link to this issue: www.ganssle.com/tem/tem198.htm -------------------------------------------------------------- You may redistribute this newsletter for noncommercial purposes. For commercial use contact info@ganssle.com. To subscribe or unsubscribe go to http://www.ganssle.com/tem-subunsub.html or drop Jack an email at jack@ganssle.com. EDITOR: Jack Ganssle, jack@ganssle.com Contents: - Editor's Notes - Quotes and Thoughts - Tools and Tips - Jobs! - Joke for the Week - About The Embedded Muse Editor's Notes -------------- Are you happy with your bug rates? If not, what are you doing about it? Are you asked to do more with less? Deliver faster, with more features? What action are you taking to achieve those goals? In fact it IS possible to accurately schedule a project, meet the deadline, and drastically reduce bugs. Learn how at my Better Firmware Faster class, presented at your facility. See http://www.ganssle.com/onsite.htm . Quotes and Thoughts ------------------ One test is worth a thousand opinions. - Author unknown A Thought About Free Software ----------------------------- Though I'm a great admirer of free and open source software (and I use some on a daily basis), I also think that a wide availability of proprietary code is very healthy for the industry. I'm happy to pay for tools, whether they are physical things like drills and hammers, or ethereal bits and bytes, as long as the tools are of high quality and fit my needs. Edwin Decoene posed an interesting question about using free software. To paraphrase his email, do you find that the general acceptance of FOSS means your boss is unwilling to spend money on any sort of proprietary tool? Is the boss's natural reaction to a purchase req to tell you to scour the `net for something that's equivalent and free? More on Debouncing ------------------ Tom Evans sent in his preferred debouncing scheme: This is a simplified version of the one in Muse 112, and it is hard coded for 3-count debounce, but there's only 3 lines of actual code in there so it is fast... and works equally well for 16 and 32-bit inputs ports. /** * \brief Debounce a byte/word/long of inputs * * This function is called from a periodic timer to perform a * standard "three-the-same" switch debounce. * * \param a_nCurrent - Current just-read switch values * as one-per-bit. * * \return Debounced value as one-per-bit. * * where A = Oldest Sample * B = Previous Sample * C = Current Sample * D = Last Debounced Output * * This function will work with the inputs defined to 8, 16 or 32 * bit values. * * \ A,B * \ Therefore Result = B.D + A.D + C.D + A.B.C * \ 00 01 11 10 = D(A+B+C) + A.B.C * C,D \------------| * 00 | 0 0 0 0 | * 01 | 0 1 1 1 | * 11 | 1 1 1 1 | * 10 | 0 0 1 0 | * |------------| * */ uint8_t DigitalDebounce(uint8_t a_nCurrent) { static uint8_t nOld = 0, nPrev = 0, nOutput = 0; nOutput = (nOutput & (nOld | nPrev | a_nCurrent)) | (nOld & nPrev & a_nCurrent); nOld = nPrev; nPrev = a_nCurrent; return nOutput; } Tools and Tips -------------- Erik Christiansen responded to a comment that a lot of IDEs won't do syntax highlighting when using a typedef like uint8_t: "One editor which highlights uint8_t, as well as the other stuff, right out of the box, is vim. Just type this in vim: :so $VIMRUNTIME/syntax/c.vim "(Or put it into your ~/.vimrc) to switch on 'C' highlighting. :help syntax "shows the help info, referring to C, perl, etc. If the highlighting needs to be customised, just hack the syntax file ... with vim. "Since I habitually flick from code to makefile to linker script, I'd need to enable vim's automatic syntax selection, though. Mind you, I find that I can't read a thing once there's four or five colours scattered all about. My eyes will only read one colour at the time. "Perhaps that's because we didn't have colour for the first half of my three decades at this game." Renan Greinert also had some thoughts on this: "It is also possible to highlight those types in Visual Studio (even Express editions). I've tested it on 2005, 2008 and 2010 versions. "You just have to create a file called "usertype.dat" and save it in the "Commom7/IDE" folder of the Visual Studio instalation. The content of this file are the types you want to highlight, each one in each line. "For example, here I use: //content of usertype.dat int8_t int16_t int32_t int64_t uint8_t uint16_t uint32_t uint64_t float_t float32_t float64_t char_t Jim Donelson gives another vote for CamStudio: "I have been using CamStudio (http://camstudio.org/) to record screen and sound and it has worked very well for me. I can't compare to Camtasia, but since it is free perhaps Bruce would." So did Roger Ball: "I'll second Bruce Wedding's recommendation of Camtasia from ToolSmith. I used it to create a set of user tutorials on one of our new products a couple of years ago. It was easy to use for making synchronized voice with screen-capture movies to really show & explain how to use our product. My thumb is way up on Camtasia. Ray Keefe makes this suggestion: "Another excellent Windows file searching tool is Agent Ransack which has a free lite version that permits commercial use. It also has an even more comprehensive version for only $39.95. http://mythicsoft.com/default.aspx " John votes for RPN on the Mac: "MacOS comes with a very nice calculator that has RPN mode (including binary, octal, and hex). "Ahh, good old HP calculators! Emphasis here on old -- the newer models were not designed for engineers. What engineer would have a "hex mode" forcing you to type three keystrokes to enter "A" to "F"? (My wife, not an engineer, still uses her 25-year-old HP LED-based RPN HP.)" Terje Frostad also has some RPN information: "There's an alternative to the free42 RPN calculator mentioned in your last Embedded Muse (197). Its called Excalibur, with current version 2.00 and it is quite remarkable I think. I use it every day. Even though it looks similar to my good old trusted HP 15C, it can do a lot more than that. It is like a combination of all the classic HP RPN calculators like HP11C, HP12C, HP15C, and HP16C, and it can still do more, and its all for free. It can be found by googling excalibur + rpn. The first hit I got was this one: http://www.softpedia.com/get/Science-CAD/Excalibur.shtml "Also I see some very good classic HP RPN calculator apps available for iPhone/iPOD Touch on Apples app store. Some are even made by HP. There are also a lot of other useful apps available for electronic design there, but not so much for programming yet." From Ernest Schloesser: "In your latest newsletter, snagit was mentioned. After having used snagit for many years, I now switched to 'greenshot': http://sourceforge.net/projects/greenshot/ "Capture a region of your screen, apply text and shapes, output to file, clipboard or printer. It does not record movies. "It costs less (open source) but will do less also. But, as with many tools, 50% percent of the functionality is often enough. It also uses less resources." Jobs! ----- Let me know if you're hiring firmware or embedded designers. No recruiters please, and I reserve the right to edit ads to fit the format and intents of this newsletter. Please keep it to 100 words. DISTek Integration, Inc. in Iowa has a number of openings for a variety of software engineers and related technical support people. Details of the positions we have to fill are at our web site: http://ww2.distek.com/positions.htm. MPD, Inc. in Owensboro, Kentucky is looking for a Software/Hardware Engineer - Embedded Systems. This respected leader in the breath alcohol instrument industry seeks engineer to design, implement and test software/hardware targeted for embedded systems. Efforts will contribute directly to new instrument development as well as to modifications and support of existing instrumentation. Position requirements: - Bachelor's degree in Electrical Engineering, Computer Engineering or equivalent - Three-seven years experience in (1) digital software /hardware development for instrumentation built on embedded systems, (2) C/C++ program development in conjunction with real time operating systems and (3) utilization of software version control tools - Solid skills in developing applications and SDKs for Windows CE/Mobile platform - Solid written and oral communication skills Send resumes to: MPD, Inc. Human Resource Department 316 East 9th Street Owensboro, Kentucky 42303 Inovonics is the industry leader in wireless sensor networks for commercial and life-safety applications. We are in beautiful Louisville, Colorado and seek a Senior Embedded Systems Engineer. S/He will design innovative embedded systems applications, many using Internet Protocol connectivity. DO YOU . . . - Have a BSEE or BSCS and 5+ years developing new products that include embedded Internet Protocol capability? - Know how to implement TCP/IP, UDP, SSL, HTTP, HTTPS, SNTP, DHCP, ARP, and Auto-IP in embedded systems? - Enjoy developing products using microcontroller firmware, and digital and mixed mode electronics? - Like working with other talented and motivated engineers as a team? If so, please e-mail resumes to lewing@inovonics.com for immediate consideration. Joke for the Week ----------------- Programming hierarchy, from David Plass: http://blog.linux-lancers.com/images/articles/2008/10/28/programmerhierarchy.jpg About The Embedded Muse ----------------------- The Embedded Muse is a newsletter sent via email by Jack Ganssle. Send complaints, comments, and contributions to me at jack@ganssle.com. The Embedded Muse is supported by The Ganssle Group, whose mission is to help embedded folks get better products to market faster. We offer seminars at your site offering hard-hitting ideas - and action - you can take now to improve firmware quality and decrease development time. Contact us at info@ganssle.com for more information. From jwbruce at ece.msstate.edu Tue Sep 7 10:57:11 2010 From: jwbruce at ece.msstate.edu (J. W. Bruce) Date: Tue Sep 7 11:38:04 2010 Subject: [ece4723] Fwd: Steal This (C/C++ Source) Code! In-Reply-To: <1103639503357.1101728959593.10680.3.271100D7@scheduler> Message-ID: <12478285.91591283875031017.JavaMail.root@zimbra.ece.msstate.edu> You might find some useful stuff here to save to you local HDD. jwb ------------------ J.W. Bruce, Ph.D., Associate Professor Department of Electrical and Computer Engineering Mississippi State University 406 Hardy Road, Simrall 335 Mississippi State, MS 39762-9571 Office: (662) 325-1530 FAX: (662) 325-2298 ----- Forwarded Message ----- From: "Michael Barr" To: jwbruce@ece.msstate.edu Sent: Tuesday, September 7, 2010 10:06:14 AM GMT -06:00 US/Canada Central Subject: Steal This (C/C++ Source) Code! Steal This (C/C++ Source) Code! Having trouble viewing this email? Click here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Firmware Update - September 7, 2010 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In this issue: -- Free CRC Implementation Code in C and C++ -- Free Embedded C Coding Standard Book -- Free Fast Accurate Memory Test Suite in C -- Free Binary Literal Macros in C Firmware Update is a free newsletter by embedded software expert Michael Barr. It is Copyright 2010 by Netrino, LLC, but may be reprinted for non-commercial purposes. Please forward it to colleagues who may benefit from the information. Free CRC Implementation Code in C and C++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cyclic redundancy codes (CRCs) are among the best checksums available to detect and/or correct errors in communications transmissions. Unfortunately, the modulo-2 arithmetic used to compute CRCs doesn't map easily into software. Writing CRC code yourself is not easy and is definitely a waste of time when you can use free code instead. Back in 1999, I developed and published an efficient high-level language implementation of the popular CRC-16, CRC-32, and CRC-CCITT checksums. I subsequently wrote a popular three-part article about checksums and CRCs for Embedded Systems Programming magazine. You can still find these articles, as well as the C and C++ source code in the public domain. Steal this code... Free Embedded C Coding Standard Book ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Coding Standard Book CoverIt is cheaper and easier to prevent bugs from creeping into embedded software than it is to find and kill them once they have entered. A key strategy in the fight against bugs is to write code in which the compiler, linker, or a static analysis tool can automatically detect bugs--before the code is even downloaded to ROM. Netrino's Embedded C Coding Standard book teaches simple practical rules you can follow to keep bugs out of embedded software. Everyone who attends the October 18-22 public session of the Embedded Software Boot Camp receives a free copy of my coding standard book. In addition, you'll learn: ? More than 50 practical tips for reducing bugs in embedded software (including all of the ten most common firmware flaws), ? How to decide if an RTOS is a good fit to your application, ? How to architect embedded software properly from the start, and ? How to write portable device drivers and interrupt handlers entirely in C. The week-long workshop consists of lectures and half a dozen small programming exercises plus one large capstone project. All hands-on projects target an ARM processor using the IAR Embedded Workbench compiler and J-Link debugger tools. The multithreaded exercises use Micrium's popular MicroC/OS-II RTOS, for which C source code is provided. Register early to save 25%... Free Fast Accurate Memory Test Suite in C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One piece of software that nearly every firmware developer must write at some point in his career is a memory test. Often, once the prototype hardware is ready, the board's designer would like some reassurance that he has wired the address and data lines correctly, and that the various memory chips are working properly. Even if that's not the case, it is desirable to test any onboard RAM at least as often as the system is reset. It is up to the embedded software developer, then, to figure out what can go wrong and design a suite of tests that will uncover potential problems. At first glance, writing a memory test may seem like a fairly simple endeavor. However, as you look at the problem more closely you will realize that it can be difficult to detect subtle memory problems with a simple test. In fact, as a result of programmer na?vet?, many embedded systems include memory tests that would detect only the most catastrophic memory failures. Incredibly, some of these may not even notice that the memory chips have been removed from the board! So why not save yourself a headache and steal the C source code that I developed in my Master's thesis work in way back in 1997. This code has been used by me in many products, as well as by thousands of your firmware engineer peers. Also steal this code... Free Binary Literal Macros in C ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A couple of years ago, Netrino engineer Dan Smith was writing stepper motor control firmware that interfaced to lots of registers with binary fields and sub-fields. After fiddling around with error-prone "off by 1 bit shift" masking and conversion from binary to hexadecimal literals in C, he happened across a useful post on a forum. In a nutshell, the "binary literal" technique is based on a set of C preprocessor macros named B8(), B16(), and B32(). No error-prone conversion to hexadecimal necessary and no figuring out which bits belong to which nibbles. And for efficiency, all the math is done at compile-time. Steal this code too... Quick Links... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ? Free Embedded Industry News ? Free Embedded Book Recommendations ? Free Embedded Systems Glossary ? Free Embedded Gurus Blog Network Contact Us... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ email: mbarr@netrino.com phone: 866.78.EMBED web: http://www.netrino.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Forward email Safe Unsubscribe This email was sent to jwbruce@ece.msstate.edu by mbarr@netrino.com . Update Profile/Email Address | Instant removal with SafeUnsubscribe ? | Privacy Policy . Email Marketing by Netrino, LLC | 6030 Marshalee Dr, Suite 355 | Elkridge | MD | 21075 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.ece.msstate.edu/pipermail/ece4723/attachments/20100907/e2f490d6/attachment-0001.html From jwbruce at ece.msstate.edu Fri Sep 10 16:01:50 2010 From: jwbruce at ece.msstate.edu (J. W. Bruce) Date: Fri Sep 10 16:02:09 2010 Subject: [ece4723] SVN repos In-Reply-To: <29005423.104181284152300547.JavaMail.root@zimbra.ece.msstate.edu> Message-ID: <26802520.104231284152509969.JavaMail.root@zimbra.ece.msstate.edu> The SVN repositories have been created for use in the embedded systems lab. You can find your repository at svn+ssh://svn.ece.msstate.edu/data/classes/ece4723/svn/xxxxxxx where xxxxxxxx is callisto europa ganymede io jupiter spot Each team will need to create three (3) directories at the top of their SVN repo. trunk tags branches If you need an introduction to SVN and its use, you will probably want to read this: http://svnbook.red-bean.com/ jwb ------------------ J.W. Bruce, Ph.D., Associate Professor Department of Electrical and Computer Engineering Mississippi State University 406 Hardy Road, Simrall 335 Mississippi State, MS 39762-9571 Office: (662) 325-1530 FAX: (662) 325-2298 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.ece.msstate.edu/pipermail/ece4723/attachments/20100910/95681829/attachment.html From jwbruce at ece.msstate.edu Wed Sep 15 16:03:14 2010 From: jwbruce at ece.msstate.edu (J. W. Bruce) Date: Wed Sep 15 16:03:25 2010 Subject: [ece4723] the MSU PIC24 distro In-Reply-To: <22589394.123981284584512939.JavaMail.root@zimbra.ece.msstate.edu> Message-ID: <10099258.124021284584594230.JavaMail.root@zimbra.ece.msstate.edu> FIRST: If you surf over to www.reesemicro.com, you will see in the "News" section for July 2010, that Dr. Reese modified the bootloader over the summer to make the bootloader more robust. Since the IVT was moved, the linker files must change. There is new folder called lkr_v2 with new linker scripts. However, the distro archive on the ECE3724 page right now is missing the new lkr_v2 folder. Dr. Jones and the micro TAs will update that distro archive file to fix this. It may take a day or so for them to rebuild and repackage it. Hold tight. THUS: Since the linker step has changed, I have not verified ESOS compiling and linking properly. It should (stress: should) be fine. But you never know. We'll know as soon as the new distro file comes out. FINALLY: Y'all are in the trenches with this beast. As you work out some of the finer details, please feel free to share these details with your team mates and student-to-come-after. You have the ability to edit and create in the ECE wiki. http://www.ece.msstate.edu/wiki/index.php/ECE4723_Embedded_Systems Place any suggestions, clarifications, or how-tos up there. Be sure to refer/link to the ECE3724 material as needed. ------------------ J.W. Bruce, Ph.D., Associate Professor Department of Electrical and Computer Engineering Mississippi State University 406 Hardy Road, Simrall 335 Mississippi State, MS 39762-9571 Office: (662) 325-1530 FAX: (662) 325-2298 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.ece.msstate.edu/pipermail/ece4723/attachments/20100915/6fdc8aeb/attachment.html From jwbruce at ece.msstate.edu Sat Sep 25 10:41:33 2010 From: jwbruce at ece.msstate.edu (J.W. Bruce) Date: Mon Sep 27 08:26:47 2010 Subject: [ece4723] Fwd: The Embedded Muse 200 Message-ID: <0kfwg78tkmkcovxgfcavrq5x.1285429292725@email.android.com> -------------- next part -------------- An embedded message was scrubbed... From: jack@ganssle.com Subject: The Embedded Muse 200 Date: Sat, 25 Sep 2010 09:21:49 -0400 Size: 24593 Url: http://www.ece.msstate.edu/pipermail/ece4723/attachments/20100925/a117b777/attachment-0001.mht From jwbruce at ece.msstate.edu Mon Sep 27 12:24:14 2010 From: jwbruce at ece.msstate.edu (J. W. Bruce) Date: Mon Sep 27 12:24:18 2010 Subject: [ece4723] Task3 In-Reply-To: <3376468.156861285608209850.JavaMail.root@zimbra.ece.msstate.edu> Message-ID: <31543532.156881285608254764.JavaMail.root@zimbra.ece.msstate.edu> We will work on Task3 one more week. Task4 has been posted if you want to see where we are going with this. ------------------ J.W. Bruce, Ph.D., Associate Professor Department of Electrical and Computer Engineering Mississippi State University 406 Hardy Road, Simrall 335 Mississippi State, MS 39762-9571 Office: (662) 325-1530 FAX: (662) 325-2298 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.ece.msstate.edu/pipermail/ece4723/attachments/20100927/4f51b155/attachment.html