element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
NexGen Flight Simuator NexGen: Hacking; Gray 2 BCD Encoder (using TTL)
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 2 Nov 2022 5:27 PM Date Created
  • Views 1277 views
  • Likes 5 likes
  • Comments 8 comments
  • flight simulator
  • nexgen
  • diy hardware
  • diy cockpit
  • mcp23017
  • 74LS7400
  • 74LS148
  • 74LS08
  • ttl logic
  • Gray Code
  • BCD Code
Related
Recommended

NexGen: Hacking; Gray 2 BCD Encoder (using TTL)

phoenixcomm
phoenixcomm
2 Nov 2022

imageOK, I Have had it up to you know where with the GRAY CODE!! When I have written this decoder in software, it takes a loop or two, It just eats CPU time. This is ok if you can use interrupts. But the Ardunio does not return the interrupt value to you directly. No, it uses what is called a SIDE-EFFECT! Incredibly, this means you have to look for the interrupt number. This is from the Arduino website itself: "ISRs are special kinds of functions that have some unique limitations most other functions do not have. An ISR cannot have any parameters, and they shouldn't return anything." This is not correct, in fact, the return type must be a VOID.  So I have crawled back to my hardware days and came up with this: (diagram below). Now I can take the decoded BCD and apply it to an MCP23017. Now I have two choices waste a nibble (4-bits) which will handle 2 decoders or 4 decoders but I will have to do some bit shifting.  - CAH Nov 2, 2K22

image

Part Price Count Price
SN74LS00N 0.12 3 0.36
SN74LS08N 0.98 1 0.98
SN74LS148N 2.05 2 4.10
TOTAL 5.44

Prices are from Newark Electronics
(web pricing)

2 of 5 Gray Code BCD
INPUTS OUTPUTS
A B C D E D C B A
0 X X 0 0 0 0
1 X X 0 0 0 1
2 X X 0 0 1 0
3 X X 0 0 1 1
4 X X 0 1 0 0
5 X X 0 1 0 1
6 X X 0 1 1 0
7 X X 0 1 1 1
8 1 0 0 0
9 X X 1 0 0 1
  • Sign in to reply
Parents
  • dougw
    dougw over 2 years ago

    If you do the lookup in your MCU instead of an external memory there is no problem with jitter.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dougw
    dougw over 2 years ago

    If you do the lookup in your MCU instead of an external memory there is no problem with jitter.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • phoenixcomm
    phoenixcomm over 2 years ago in reply to dougw

    I don't waste the CPU for this.  most of the time its just MHZ and KHZ, in one radio I have 5 groups..:(

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube