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 1065 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
  • TU1234
    0 TU1234 over 1 year ago in reply to primalfido

    Many thanks for the informations. I also noticed that there are 5 LEDs.


    Do you know what the "P2RAM" is for? Does the bit "REG_BANK" have to be set to high for the configuration? I initially read the RAM at the offsets with both variants and there are only a few bits different.


    Do you know what "COMPDAC" is for? Does this RAM section also need to be initialized? I tried changing this section and the channel values ​​seem to change.


    The ASETUP seems to work. I tried to set all photodiodes in the SMUX to low in order to then assign individual photodiodes to the ADCs, but some channels still change when all values ​​in the SMUX are low.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • TU1234
    0 TU1234 over 1 year ago in reply to primalfido

    Many thanks for the informations. I also noticed that there are 5 LEDs.


    Do you know what the "P2RAM" is for? Does the bit "REG_BANK" have to be set to high for the configuration? I initially read the RAM at the offsets with both variants and there are only a few bits different.


    Do you know what "COMPDAC" is for? Does this RAM section also need to be initialized? I tried changing this section and the channel values ​​seem to change.


    The ASETUP seems to work. I tried to set all photodiodes in the SMUX to low in order to then assign individual photodiodes to the ADCs, but some channels still change when all values ​​in the SMUX are low.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • primalfido
    0 primalfido 11 months ago in reply to TU1234

    Hi there,

    I do not know what P2RAM does. I think COMPDAC is related to temperature compensation but I cannot know for sure. 

    You might be missing autozero, enable it and then set all of the SMUX RAM locations to 0 (i.e. ground), and you should see low/zero output from all of them.

    Additionally, using the default setup I stated above, you can arrange the channels in wavelength order using this ordering:

    1, 48, 2, 34, 16, 32, 18, 51, 4, 49, 3, 35, 17, 33, 19, 54, 0, 13, 50, 63, 52, 6, 38, 20, 36, 22, 55, 5, 53, 7, 39, 21, 37, 23, 40, 26, 42, 24, 56, 10, 58, 8, 41, 27, 43, 25, 57, 11, 59, 9, 44, 30, 46, 28, 60, 14, 62, 12, 45, 31, 47, 29, 61, 15

    This is what I have gotten from observing the LEDs on/off and it seems to match the shapes given in the datasheet. The 830 photodiodes might not be necessary in the right integration order but you can always average them .

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • TU1234
    0 TU1234 11 months ago in reply to primalfido

    Thank you very much for the answer. In the meantime, I sorted the photodiodes using the LEDs. I got the same result.

    I don't know why, but autozero doesn't seem to have any effect. I have tried autozero with different settings, but the result is always the same as when autozero is off.  The channels are only zero, if I write certain values in COMPDAC. So I think I can use COMPDAC as an offset. However, the last 16 bytes of COMPDAC seems to have no effect. The measurements are always the same, no matter what I write in there.

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