|
Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs * Basic Loops * The LCD Display * Binary Numbers * Decisions ## Set up the Equipment ## Left or Right? ## Set up the Flowchart ## Single Bit Input ## Set up the Decisions ## Set up the Delays ## Set up the Left Output ## Set up the Right Output ## Adding the Switches ## Adding the LED array ## Final Flowchart ## Simulation * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory * A Simple Hi-Fi PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt |
(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login Set up the Left Output<^< Set up the Delays | Course Index | Set up the Right Output >^>(:nl:) # Follow the 'Yes' route from the 'Left switch pressed?' decision box. # Double-click on the first (upper) Output icon, to open the Output Properties dialogue box. # Set it up to look like the one below: ![]() ->A word of explanation! - This set up outputs the number 255 from the output port. Normally, this would light up all the LED's connected to the port. By clicking the 'Use Masking' box, and selecting bit 0, we make all the LED's inactive apart from LED 0, the right hand one. This is one way to turn on only bit 0. Here are two alternative ways of doing the same thing! ![]() ![]() ->Outputting the value '1' (= 0000 0001 in binary) switches on only the LED attached to bit 0. But this command will also force all the other pins on Port B to logic 0. The third option outputs value '255' (= 1111 1111 in binary,) and it puts all pins at logic 1. This should give you a hint of what the advantage of masking is: it allows you to alter the status of the lines on a port individually. Masking allows you to make a pin high or low without altering the status of the other pins on the same port. # Double-click on the second (lower) Output icon. Set up the properties as shown in the next diagram: ![]() ->Outputting value '0' turns off all LED's connected to Port B. (:nl:)(:table style="clear:both":)
| |
(:Summary: Website page footer:)
Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login
Page last modified on May 14, 2013, at 01:02 PM