HOME  |  NEWS  |  BLOGS  |  MESSAGES  |  FEATURES  |  VIDEOS  |  WEBINARS  |  INDUSTRIES  |  FOCUS ON FUNDAMENTALS
  |  REGISTER  |  LOGIN  |  HELP
Comments
You must login to participate in this chat. Please login.

ENjoying the Archived lectures AND the recorded comments! 

Iron

Catching up via Archive lecture.

Gold

Yes, download source code

These sessions are always at 2pm EDT/11AM PST. They do not seem to change

Iron

Thanks for having this on archive.  The original "add to calendar" had this presentation at 12:00PM PST, not the real 11:00AM that it happened at.  Thanks for the class.  I look forward to tomorrow.

Iron

Thanks Charles.  Reviewing Audio at the moment.  Looking forward to tomrrow's class.

Iron

Thanks again all!! We will put all of this into one fell swoop tomorrow - will be a lot to cover!

Iron

@tomboalogo, I agree, but in some applications, I've come up with problems improving the code on a system that was already previously designed.  I have hit the memory limits of the microcontroller.  So at times, it does become an issue.

Iron

@jguernsey - that's why I don't sweat it so much about char vs. int for a state var or such other 'optimizing' - at the end of the day, you didn't save all that much

Iron

Thanks Charles and all, interesting and a great way to spend my lunch time. See all tomorrow.

Iron

Thank you. looking forward for tomorrow's lecture. Have a great day

Iron

Again, I enjoy the discussions on programming style and I am learning from you as you learn (hopefully) from me and from each other.  I hope to give insight into the methodology rather than the programming.  I admit that even I am appalled at the program structure but I am trying to be compact.  I work with OTHER people's code almost daily and against a number of companies' style books...
Bottom line - keep the cards and letters coming, folks!

Iron

I do that as well @Tomboalogo.  I also comment my code well to ensure the future viewer will understand the reasoning behind my implementation.

Iron

ooops didn't finish that thought - if that takes a little more codespace, so be it

Iron

I try to write code as simple and readable as possible so that the next guy to work on it (perhaps a 5 year older me) won't tear his/her hair out

Iron

@cjlord, no problem it's just a peek!

Iron

I agree with you Danlafleur.  Many times have I heard, "Coding is an Art." Whether there is some science to it or not, there is definitely "art" to it.

Iron

@danlafleur - then boy am I in trouble!

 

Iron

@JGurnsey, I've found over the years that programming style and logic are as individual as the person who created it. To understand someone's code is a peek inside his head.

Iron

The choice to complicate things by adding the wash flag was to save code space.  An example of a 'pure' state machine would mirror the diagram yesterday that has fill, run, and drain for wash AND for rinse. IMO neither answer is 'perfect' - but I am looking at this design from a tiny 8-bit world.

Iron

Note to DesignNews: your code for posting messages on the CE Center Live Chat page does not seem to work on Safari on a Mac. I had to go to Chrome and log in again.

Gold

@Cjlord, so your motor function basically using the parameter as flags for on/off and direction.

Iron

@danlafleur, That is why I asked about the implementation.  Couldn't the on/off behavior be the same for the solenoid as with the motor and just compare whether it is to be On/Off as a parameter and simple activate the correct solenoid?

Iron

The code for what the motor and solenoid functions do will be included and we may look briefly at them tomorrow.  Remember that I am simulating these real-life functions (including a motor driver) so that the outputs will be pretty much the same as the defines (one bit on or off for solenoid and two bits for the motor - one power and one direction).

Iron

Hello from Monrovia late

Iron

@Bob985 - no just laziness  ;-) 

 

I always #define such things in .h files ( where they belong IMHO)

Iron

@JGuernsey, our company used to build a control system that operated pulse latching solenoid valves. One solenoid opened the valve, the other solenoid closed it. This was for power saving on battery powered sites.

Iron

Some compilers don't complain about that test.  But LINT is a static code analysis tool that checks code for potential bugs.  It will consider that a possible bug.

Iron

Is it typical to not use abstraction when working with 8-bit systems? Suppose FF or BB needed to be used in the future to indicate a fault - if the value for indicating the 7-segment display was to be blanked were a # define value, you could change the value in one place and not have to worry that you missed an instance in your code.

Gold

just checked the CW compiler and it doesn't complain about 

if ( test <= 0){

}

where test is an unsigned char

Iron

He checks the state of the door switch and water level, don't those count as inputs?

Iron

Why did you choose a Mealy machine (inputs+state) versus a Moore machine design (just state)?

Q: Charles, is your source code going to include the functions for the motor and the solenoid, so I can investigate the reasoning behind using the 2 separate on/off water functions vs. the motor direction on/off single function?

Iron

Thanks all!!! Let me grab another cuppa coffee and I will be back in one minute!

 

Iron

IMHO: Thanks, everyone. Many eyes is a reason for code reviews and team programming.

Looking forward to implement the rest of code.

Iron

Thank you, Charles. Can't wait for tomorrow's lecture!

Iron

Thank you, Charles. Can't wait for tomorrow's lecture!

Iron

I typically use eclipse for all code project management, but the uP companies IDE for build and debug.

Iron

Thanks Charles. Great lecture and I learn some different coding style. Thanks.

Iron

Thanks again Charles. Will download the light version of CW

Thanks for this class, the format is very good with theory and implementation with small example project.

Iron

Thanks Charles, Chuck, & DigiKey

Iron

Excellent; Thanks Charles and Chuck!

Iron

@bartholemew - that actually is a better soln

Iron

Thank you for today's lecture Charles

Iron

Thank you very practical class.

Iron

Thank you Charles

 

Iron

IDE experience - Code Composer Studio for TI MSP430 dev board, Metrowerks Code Warrior for academics and Keil uVision4 ...

Another good session Charles. Thanks!

Iron

if(uc_minutes = 0) classic C error ... preventative measure is to code conditionals w/the expression on the LHS:

if(0 = uc_minutes)

and the compiler will catch it for you

IMHO having uc_Seconds count up and uc_Minutes count down is a potential for maintenance problems

@tomboalogo "I always use something like uc_minutes <= 0 so I don't forget to do =="

in this canse, since uc_minutes is unsigned, compiler may complain about <=0
Iron

@tomboalogo : <= doesnt work for unsigned types since unsigned types can NEVER be less than 0. LINT usually objects to < comparisons against 0 for unsigned types, including <=.

Need '==' on the if uc_minutes condition.

Iron

use #defines to set LED values. therefore the value set is human readable and obvious. The #define maps the port pattern to create the expected display (assuming the 2 LEDs are mapped to (1) 8-bit port.

Iron

I always use something like uc_minutes <= 0 so I don't forget to do ==

Iron

(Never turns off water!)

Iron

How do you use Intrupt?

Iron

calling funtIdle() from default case is not necessary since the state flag has already been set to Idle. The functIdle() will be called on the next entry of the switch case.

Iron

Agree with bitbanger55 - PrevStatus should be uc_PrevState.

Iron

Charles question: Spot the error(s)!!!

Blogger

Why aren't you using #defines for the values sent to the functions??!!

What variable is uc_PrevStatus ? Should it be uc_PrevState ?

psvail nice comment.  i've always wondered why i have seen constants on the left of the conditional

Iron

turn on / turn off could also be for a double acting solenoid

Iron

slide 18 line #148 has a bug:  want's to be '=='
A trick I learned is to put the constant on the left of the condition so compiler will complain about bugs like this.

Iron

Q: Why do you have a function to setMotor direction which also turns it on/off, but for the solenoid you have separate on/off functions?  My audio is not streaming properly atm, so I can't hear answers.  I will reload the audio at the end when it's archived.

Iron

Concur w/ bitbanger55 about WashFlag

Iron

@andrewcrlucas - char can be signed or unsigned

Iron

so then the code is wrong, he should be explicitly declaring the variables as 'unsigned char' not just 'char'

@andrewcrlucas  char is typically signed, but you are correct it is compiler dependant.  That's why he uses uc for unsigned.  We typically have an iso file that defines the variables as uint8_t for unsigned char, and int8_t for signed.

Iron

char is always sined thats why they invented unsigned char

Iron

Nope, char is signed

 

Iron

What was the question?

Iron

I agree w/ bitbanger55

Iron

Is 'char' always unsigned, I thought it was compiler dependent?

 

Q: Use of flags such as WashFlag defeats the whole flat-state machine concept, and makes additional state variables to be managed to represent state. It is a road leading to flag strewn perdition.

Hi,  I am sorry,  I am too late. from Bremen

Iron

Licenses for CodeWarrior when we bought it were around $2500.00.  If you join the freescale alliance you can get the price reduced to about 1/2 that.

 

Iron

Sure, could give it a try

I will compile the code.

Iron

What complier do you recommend for this code?

Iron

What does CodeWarrior cost?

Iron

I will compile the code 

Iron

Just looking for the theory.

Iron

I would download the code and play with it..

Iron

not likely to build, may compare for style

Iron

The format for this class is very good I am getting actual work related how to programming experience with real project example, So please keep this class format

Iron

not interested in compiling the code.  looking for style and coding technique

Iron

I would like to - might be a good place to learn.  Would this be translatable to an ARM?

Iron

Would be fun (and instructive) to actually play with the code

Iron

Pseudo code works for me since I would build this for a different micro.

Iron

i think downloading the code is a good idea but i will not use CW.

 

Iron

I 'd like download the code.

Iron

Yes, i will be trying this chip soon and dev kit

Yes I will Please go thorugh ALL process Like to get hands on programming experience 

Iron

Interested in downloading the code

Iron

Yes I would be happy to do so

Iron

I am interested in the source code for hands-on.

Iron

Yes, will download and play with the code.

Iron

yes will download the code   thanks

Iron

Charles' question: How many of you would like to build this yourselves?

Blogger

I tried CodeWarrior years ago.  Switched to other micros for commercial reasons.

Iron

Where will the code be available?

 

Iron

Code Composer Studio (Eclipse Based).

CCShell (Eclipse Based).

It is a good ideal if we run RTOS on this 60K rom 4k ram 8 bit MCU?

Iron

I use CodeWarrior with MC9S12C32 uC.

Iron

have used MPLAB with plug-ins more than any other IDE

Iron

Yes, I have used the CodeWarrior 10 for several of our products.  I have also used Eclipse for standard Java programming, Android App programming and C+ programming.

Iron

CodeWarrior old version.

Iron

Yes MPLAB, some others in the past.

Iron

no code warrior but eclipse and many ecilpse based IDE's (e.g. QNX momentics)

 

No, IAR Embedded Workbench for ARM. SlickEdit as an editor..

Iron

I have used CodeWarrior, but older version. Have also used Eclipse for an ARM processor-based project.

Iron

Not using currently. Used previous versions of Codewarrior 

Iron

eclipse for Blackfin and android

Iron

No, but have used TI CCS

 

Iron

got CW classic in another window right now but also use Eclipse

Iron

Not using currently & have not used.

Iron

not using codewarrior due to cost issues.

i'm using atmel studio 6.1

 

Iron

I've used CodeComposer Studio (TI) and MPLABX

 

not using code warrior of any version

Iron

Charles' question: Have any of you used CodeWarrior 10 before? If not, have you used another Eclipse-based IDE?

Blogger

Yes having the code before would be helpful

Iron

Yes - code available ahead of time is a big help.

Iron

hello people, how are you ?

 

Iron

nothing wrong with a swift and sincere apology.

Iron

Good evening from Iasi, Romania

Iron

Good Afternoon from Sunny Boston!, Audio is 5x5

Iron

Hello from Toronto, ON

Iron

Hi all -Audio is live! If you don't see the audio bar at the top of the screen, please refresh your browser. It may take a couple tries. When you see the audio bar, hit the play button. If you experience audio interruptions and are using IE, try using FF or Chrome as your browser. Many people experience issues with IE. Also, make sure your flash player is updated with the current version. Some companies block live audio streams, so if that is the case for your company, the class will be archived on this page immediately following the class and you can listen then. People don't experience any issues with the audio for the archived version.

Good morning from California

Iron

Hello from Toledo, Ohio

Iron

Bright sunny day from Solectria Renewables in Lawrence MA!

@Alaskaman66 : What do you jumping randomly ? I hope your code doesn't behave randomly.

Alaskaman - great Q - will try to include that answer in the talk, ok? it is time for the class

Iron

Charles: I posted a question yesterday that never showed up. Is the distinction of a state machine a software approach that captures each state in isolated blocks of code, or the processing pathway where the code moves from one state to the next in a predetermined fashion, instead of jumping randomly from state to state ( depending on what's going on)?

A suggestion, if you have a question for our instructor, prefix it with a bold Q: so it is easier for him to find.

Iron

I think I cut my grass last weekend for the last time this year. Leaves already dropping and geese going south.

Iron

Hello from Summerville, sunny South Carolina

Iron

At least the good news is that the grass got cut yesterday!

Iron

Hello from Gyor, Hungary

 

Iron

greetings from Seattle

Iron

Another hello from Albuquerque.

Iron

Thanks so much Stephaney for posting them so quickly!!!

Iron

Hello from Albuquerque.

Iron

Hi everyone - The slides are now available right under the "special educational materials" heading above the chat window. Please refresh your browser.

Again, this is your instructor - due to issues on my end, I was very very late sending today's slides (like right NOW)... they are uploading them to the website now.  A THOUSAND apologies!!! There have been some big challenges on my end the last 24 hours... but let's get some coffee and have this class!  See you in 15 minutes!

Iron

Is there a link to the slide deck for today?  I don't see it in the usual place

Iron

Greetings from Colorado

Iron

-Be sure to follow @designnews and @DigiKeyCEC on Twitter for the latest class information. We encourage you to tweet about today's class using the hashtag #CEC.

Blogger

-Please join our Digi-Key Continuing Education Center LinkedIn Group at http://linkd.in/yoNGeY

 

Blogger

Since Madison Avenue co-opted hump day with that silly commercial I can't break free of image of talking dromedary.

hello all and happy hump day from Edmonton, Alberta.

Iron

Hi everyone – Thank you for joining us. The slides will be available before the class starts. Thank you for your patience!

-The streaming audio player will appear on this web page when the show starts at 2 PM Eastern time today. Note however that some companies block live audio streams. If when the show starts you don't hear any audio, try refreshing your browser. If that doesn't work, try using Firefox or Google Chrome as your browser. Some users experience audio interruptions with IE. If that doesn't work, the class will be archived immediately following our live taping.

Blogger

Greetings from Boston Metro West. Nice afternoon 82ºF mostly sunny.

Iron

Greetings from the garden spot of the universe - Minneapolis!

@Charles Murray: Sure as soon as link is available

Iron

@Charles Murray - Sounds like Charles Lord is having "technical difficulties" with the slides... (see below)

Iron

Don't see a link for slide deck as of 2013-08-28 12:41 EDT .

-Be sure to click 'Today's Slide Deck' under Special Educational Materials above right to download the PowerPoint for today's session.

Blogger

@fjgalan Saludos desde America

Iron

I know ... I actually lived in the Merida (Yucatan) on this side of the Atlantic.

Iron

Hello from mild and muggy Beaverton, Oregon. (61º, 83% humidity)

Iron

My Valladolid is other side of Atlantic, near to Madrid (130 miles at North, or 200 Km how we say by here)

Iron

Hi everyone good morning.

Iron

hmm, I been in Valladolid...,Yucatan in Mexico

Iron

Sorry - there are some tech (and other) issues on my end - slides will be up later, but on time for class!
Instructor's fault, not Design News or Digi-Key!

Iron

Good afternoon from the other side of Atlantic Sea, in Valladolid, Spain; if you start here and follow parallel arrive to Rhode Islands :-)

Iron

Good afternoon from Rockwell Automation in cloudy Mayfield Hts. Ohio.

Good morning from Mobile, AL

Slides good,

Morning

Raining in North Pole again.

Iron

Good afternoon from GA. We don't have slides yet?

Iron

Good morning from Scottsdale

Iron

Good morning from Edmonton, AB

Iron

Good morning from Huntsville, AL

Iron

Good morning. Can we have the download file?

Iron

And we're back from foggy Aurora Ontario.

Iron

Good Morning, everyone

Iron

I'll miss the live feed today. I'll have to catch you on archive.

Gold

Morning from Portland Oregon

Iron

Sorry - there are some tech (and other) issues on my end - slides will be up later, but on time for class!

Iron


Partner Zone
Latest Analysis
Some humanoid walking robots are also good at running, balancing, and coordinated movements in group settings. Several of our sports robots have won regional or worldwide acclaim in the RoboCup soccer World Cup, or FIRST Robotics competitions. Others include the world's first hockey-playing robot and a trash-talking Scrabble player.
Sherlock Ohms highlights stories told by engineers who have used their deductive reasoning and technical prowess to troubleshoot and solve the most perplexing engineering mysteries.
Melissa Cavanagh of 3DP Unlimited talked to Design News about the company’s large format 3D printer, during Medical Design and Manufacturing Midwest.
The DDV-IP is a two-wheeled self-balancing robot that can deliver cold beverages to thirsty folks on hot summer days. A wireless RF remote enables manual control of the device beyond the act of self-balancing. All of the features of the DDV-IP result in an effective delivery vehicle while providing entertainment to the user.
Eric Doster of iFixit talks about the most surprising aspect of the Microsoft Surface Pro 3 teardown. In a presentation at Medical Design & Manufacturing Midwest, iFixit gave the Surface Pro 3 a score of one (out of a possible 10) for repairability.
More:Blogs|News
Design News Webinar Series
10/7/2014 8:00 a.m. California / 11:00 a.m. New York
9/25/2014 11:00 a.m. California / 2:00 p.m. New York
9/10/2014 11:00 a.m. California / 2:00 p.m. New York
7/23/2014 11:00 a.m. California / 2:00 p.m. New York
Quick Poll
The Continuing Education Center offers engineers an entirely new way to get the education they need to formulate next-generation solutions.
Oct 20 - 24, How to Design & Build an Embedded Web Server: An Embedded TCP/IP Tutorial
SEMESTERS: 1  |  2  |  3  |  4  |  5  |  6


Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.
Next Class: 10/28-10/30 11:00 AM
Sponsored by Stratasys
Next Class: 10/28-10/30 2:00 PM
Sponsored by Gates Corporation
Learn More   |   Login   |   Archived Classes
Twitter Feed
Design News Twitter Feed
Like Us on Facebook

Sponsored Content

Technology Marketplace

Copyright © 2014 UBM Canon, A UBM company, All rights reserved. Privacy Policy | Terms of Service