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
ams OSRAM
  • Products
  • Manufacturers
  • ams OSRAM
  • More
  • Cancel
ams OSRAM
Forum as7421 problem with SMUX and GAIN configuration
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join ams OSRAM to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 6 replies
  • Subscribers 19 subscribers
  • Views 1066 views
  • Users 0 members are here
  • as7421
Related

as7421 problem with SMUX and GAIN configuration

TU1234
TU1234 over 1 year ago

Hello,

I'm trying to configure the SMUX and ADC gain of the as7421, but the files explaining the configuration specified in the datasheet are missing and the company's support does not respond to my messages. I have already readout the specified RAM, but have not yet been able to recognize a pattern in the data that has already been entered in order to know where I have to write which values into the RAM. Has anyone solved a similar problem? I would appreciate it.

  • Sign in to reply
  • Cancel

Top Replies

  • primalfido
    primalfido over 1 year ago +1 verified
    doing this from my phone so please bear with me. I have spent a good month figuring this chip out. They’re not explained in the datasheet. in fact, much is not explained. Did you know there are 5 LEDS…
Parents
  • primalfido
    +1 primalfido over 1 year ago

    doing this from my phone so please bear with me. I have spent a good month figuring this chip out. 


    They’re not explained in the datasheet. in fact, much is not explained. Did you know there are 5 LEDS? Not 4!!


    The smux is basically junk at boot up and needs to be set properly so there is no pattern.

    From what I’ve discovered through reversing it. The ASETUP ram locations are for the GAIN. ASETUPAB correspond to channels in the A and B integration and CD for the C and D integration. Both combined give the full 64 photodiodes. 

    You can set the values on eaxh cfg_ram between 0 and 8 giving a gain of 2^x. Setting 6 on CFG_RAM_x gives you a 64x Gain on photodiode x. I usually just fill all ram registers with the same value.

    SMUX is a bit harder. On each SMUX_x location. Each of the 32 CFG_RAM register represents 2 photodiodes as 4-bit nibbles. Each of the 4-bit nibbles can be set to either 1,2,3 or 4 representing each of the 4 available ADCs in each integration annd 0 as ground Each photodiode can be remapped to any integration cycle using this. However I am not quite sure which photodiode is mapped to which nibble.

    here is my procedure to set the smux with what works for me.

    go to each smux offset

    set all cfg_ram to zero

    then I use the configuration {0x21,0x21,0x21,0x21,0x43,0x43,0x43,0x43}

    set the offset to smux_a

    write the config only at cfg_ram_0 -> 7

    smux_b, write the config to 8->15

    smux_c, config 16-> 23

    smux_d config 24-> 31

    now the channel data read out is not in order of the datasheet PD listing and needs to be sorted correctly. I have some indices figured out. I will post them in a reply when I find them 

     

     

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Akropolidis
    0 Akropolidis 10 months ago in reply to primalfido

    Hello,

    I'm working on a sensor library for the AS7421 as well to use for a project and I was just wondering how you decided on the configuration ({0x21,0x21,0x21,0x21,0x43,0x43,0x43,0x43}) for the ram registers

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Akropolidis
    0 Akropolidis 10 months ago in reply to primalfido

    Hello,

    I'm working on a sensor library for the AS7421 as well to use for a project and I was just wondering how you decided on the configuration ({0x21,0x21,0x21,0x21,0x43,0x43,0x43,0x43}) for the ram registers

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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