I group all my registers, ports, etc. by class in C_plus_plus because I find that the fucntions of non-trivial devices, like SPI, I2C, FLASH controllers, etc. can be spread all over the place. So I group them by functionality. I also don't need initilaiztion functions. I use the constructor to initilaize the object (with possible arguments). That way, one cannot use a device without it being properly initialized. This also means that there is zero overhead to reuse the code elsewhere.
Now about - getting started with each of the popular IDE/deveopment platforms.
Either a day for each one or a series for each one. Getting the bits and bobs connected together, gettting the configuration right, and a getting a program download/running/emulated can be a daunting task.
thanks everyone for posting links to tools you've used & liked -- some seem obscure (or, at least, *I* haven't ever come across), perhaps because they're niche? but definitely worth looking into. I have some good research to do now!
Just wanted to get a general idea of its use. I did a course in UML years ago, but found it isn't generally used in embedded systems projects, maybe because of lack of design / acceptance / size of projects (small)....
If you have C+ I would use those techniques but in C this has proven very useful. You can do OO in C but it gets so complicated it becomes hard to understand which destroys the idea of simple, readable code.
Duh, can you explain the syntax in the last line on Slide 20?
So the channel/NUM_PINS_PER_PORT is getting the pointer array entry to the hardware. Then channel is moduls so that we get the entry in the port (i.e which pin of 8 is it?) then we shift over to access the correct bit
Jacob- from today, it looks like you would write the config table code for the project as a whole from this example. (initializing SPI, analog, GPIO from the same spot) I like to write separate initializations for each driver I use - so SPI would be initialized in the SPIinit function inside the SPI driver, DIO would be initialized in the DIO driver, etc. What are your thoughts on this method?
Human readable code should be the goal in every case except for when some strange system or language construct forces you to do otherwise. Let the compilers do what they are good at and carry the burden for the machine's needs.
Do you like how human readable this code is? What are some advantages to having code written this way? Any disadvantages?
Yes I love how human readable that code is. Makes it very easy to understand for a new person to look at this code and realize what exaclty is going on. Disadvantage would be it takes more time to have to set up a table like that.
Good point JCheetham. If the purpose is to set up pins as input or output I just define a variable as a binary to show which pins are in and which are out. Then move that var into the PORTB or whatever.
when i first started writing code i preferred individual because it was much easier for me to understand what was goin on but now that i have a better understanding of how to code i like the initialization
Depends on whether I want to know what teh code is doing by looking at it. The table seems more efficient. I suppose that once I get used to it I would be more comfortable with it. So, I'll vote for the Table method.
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.
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.
Digital healthcare devices and wearable electronic products need to be thoroughly tested, lest they live short, ignominious lives, an expert will tell attendees at UBM’s upcoming Designers of Things conference in San Jose, Calif.
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.