|
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 * Goto (Connection Point) * 7-Segment Displays ## Set up the Equipment ## 7-Segment Displays ## Using a Single digit ## Using the Quad Display ## Getting the Timing Right * 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 Using the Quad Display<^< Using a Single digit | Course Index | Getting the Timing Right >^>(:nl:) Now let's try the '7 Segment Quad' display. Select the Outputs button and click on the '7 Segment Quad' component in the toolbar ![]() By default the 7-segment quad display is connected to all 8 pins on Port B, and the 'common' pins are set to Port A 0-3 (A0-A3). You can change this, but we will keep the default connections for now. Drag a 'Component Macro' icon onto the flowchart and open up the macro dialogue box. ![]() Scroll down the list of available macros for that component 'led_7seg_quad' and select the 'ShowDigit' macro. The 'ShowDigit' macro for the 7 Segment Quad display is the same as that used for the 7 Segment Single display , but with an extra parameter added - Digit. Digit is used to select which of the 4 7-segment displays to show the value on. These are numbered 0-3 from left to right. Let's display 1234 on the quad 7-segment display . Enter 0,1,0 into the parameters box and click on 'OK'. This will display the number 1 in the left-most 7-segment display. Next add 3 more macros with 1,2,0 2,3,0 and 3,4,0 in respectively. Now run the program, this works fine in simulation, but what about running the program on hardware? What happened? We sent the correct digit to all four 7-segments, but only the last one is lit. ![]() If you were observant, or had the program running slowly you might have seen what happened. Basically the first 7-segment display lit, then the next, then the next, then the last one. The problem is that unlike the LCD we can't light more than 1 7-segment display at any one time. How do we get around this? We'll find out on the next page, but why not think for a minute how you might solve the problem? (: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 03:29 PM