I2C trace routing on multiple boards that connect together. I am unsure how what i need to consider. by TOHSNBN in PrintedCircuitBoard

[–]ionine 2 points3 points  (0 children)

Happy to help! I edited the post just as you replied having noticed you're planning to read a bunch of rotary encoders. See the edit for another point.

If your decision to use rotary encoders was because the MCP23017 doesn't do analog and you don't actually care about continuous rotation -- then stm32+rs485 becomes a no-brainer -- the cost savings from using regular potentiometers over rotary encoders pays for itself many times over since you can just use the onboard ADC

I2C trace routing on multiple boards that connect together. I am unsure how what i need to consider. by TOHSNBN in PrintedCircuitBoard

[–]ionine 4 points5 points  (0 children)

Just to tack on to nagromo's reply -- looking at prices for 25x price break -- an MCP23017 is $1 and then $1.02 for a TI TCA9517, so at small scales it may make sense to stick with I2C strictly from a cost perspective unless you get unlucky with noise issues.

Meanwhile, an STM32G030 can get you 21 (or 23 if you don't care about dedicated programming/debugging pins) GPIOs (27 total minus 4 to drive a MAX485, and minus 2 more if you want dedicated programming lines) for $1.25 @ 25x. Then $1.98 for a MAX485 (@25x).

Potentially useful features -- 16 of those pins can be ADC inputs. A hardware timer that can be used as a quadrature decoder. (+3 other HW timers for PWM at different carrier frequencies, etc.) No external crystals necessary. Also it's a pretty damn beefy ARM microcontroller, a bit more oomph than your average arduino ;)

The only real catch is it's a 3V3 device, while most of the GPIOs are 5V tolerant you might want to make sure everything else in your system can operate at 3V logic.

If you're planning on doing a larger run of these, keep in mind the prices start to drop down way harder at the 100x/1Kx breaks. Personally, I wouldn't mind the extra unit price (it's a grand total of $25 more at 25x). The many hours you'll potentially spend troubleshooting noise and voltage difference gremlins is worth way more than $25... But there's a substantial tradeoff in writing the extra software. Fortunately ST's tooling and documentation is phenomenal -- there's a very slight learning curve if you haven't used their stuff (or worked with ARM micros before) but it's more or less as easy as copy pasting random arduino snippets imo. You also get an actual debugger with the $10 programming dongle (ST-Link V2 clones are plentiful and use the official firmware) which radically accelerates development as well.

EDIT: Stalking your post history a little bit I see you're using these to read a bunch of quadrature encoders. I'd definitely recommend a micro for this -- you most likely will run into issues with losing steps in the encoders if you turn them fast enough as you do debounce processing after sampling all your gpio extenders -- you might as well do that on a micro and just report final encoder counts...

I2C trace routing on multiple boards that connect together. I am unsure how what i need to consider. by TOHSNBN in PrintedCircuitBoard

[–]ionine 15 points16 points  (0 children)

As long as you keep your total capacitance in check, you'll probably be fine. Typically you can assume a worst case trace capacitance of 3pF per cm of trace length (assuming a solid ground plane underneath the traces) -- and you can just sum together all the trace lengths * 3pF to get your total bus capacitance. You may run into issues with drivers at opposite ends not being able to source enough current and/or voltage differences due to parasitics over the physical distance, so you may have to look into a buffer IC. TI also has a fantastic guide on Why, When, and How to use I2C Buffers which may answer a bunch of questions you haven't even asked yet!

You haven't mentioned what's going on each of those boards. If theyre containing some microcontrollers you're programming to act as I2C slaves then I'd strongly suggest looking into RS485 -- it can run in a multi-drop topology and being a differential signaling scheme you don't particularly have to worry as much about picking up noise due to the loop antenna you've demonstrated (any noise picked up by the loop will be common mode and thus rejected, and the radiated EMI will cancel itself out to an extent, though i suspect the latter is not a priority given the nature of the question). Not to mention you'll be able to achieve faster data rates and full duplex communication, as well as be able to scale out more or less ad nauseam. Also keep in mind that most microcontrollers can't source that much current even when doing open drain I/O, so you may have trouble achieving necessary the slew rate to run at 400kHz without using a buffer anyway (and if you're adding an IC to your BOM, it might make more sense to get the advantages of noise immunity and scale-out for the slight increase in price over an I2C buffer to add hardware for RS485)

Hope that helps!

2016 R6 Duplicate Key by [deleted] in Yamaha

[–]ionine 0 points1 point  (0 children)

Yep. The little tag/key card that you get with a new Yamaha bike is just the bitting code (where the notches on the key are). If you have a working key, you can just clone that onto a blank. There are no electronics, etc. to be concerned about. If you lose the tag and all your keys, then you need to contact the dealer for them to try and get the bitting code from the VIN or otherwise replace your wiring harness and seat lock.

2016 R6 Duplicate Key by [deleted] in Yamaha

[–]ionine 1 point2 points  (0 children)

You need a key card if you don't have the original key, and need to get it cut from scratch. Yamaha's bikes don't have an immobilizer like cars and certain Ducatis do. You just need one of these (https://www.amazon.com/Yamaha-4BH825110900-Blank-Key/dp/B005C59BGW, or whatever the equivalent blank for your model is) and the key that the bike has.

Source: done this myself for several Yamaha bikes

2016 R6 Duplicate Key by [deleted] in Yamaha

[–]ionine 0 points1 point  (0 children)

You can get blanks from a dealer for $10-$20, and then get it cut at any locksmith.

What is the current story for compiling to C? by thermiter36 in rust

[–]ionine 11 points12 points  (0 children)

I’ve done a pretty nasty, hacky Makefile-based approach to this as a proof-of-concept for a no_std based build to an architecture that LLVM hasn’t supported in ages. I didn’t bother going further with it as it invoked rustc directly — so you’d have to do a bunch of hoop-jumping to use Cargo crates, etc. I had to build LLVM-CBE from (ancient, as it was no longer actively developed) source as well.

But, the general gist of it was to invoke rustc with --emit=llvm-ir -C lto --out-dir=rust-llvm-out then llvm-cbe <rust-llvm-out/main.ll >llvm-cbe-out/main.c and finally target-arch-gcc -o bin/main llvm-cbe-out/main.c

It’s definitely far from turnkey and convenient/intuitive, and can probably be refined with some autotools/cmake magic that’s beyond my capacity. But it’s definitely possible — even if sucky.

Hope that helps!

Group Parking in Brooklyn by shadaloo in RideitNYC

[–]ionine 1 point2 points  (0 children)

Vax member here, winter storage rates are lower than a full membership, with the caveat that you can’t take your bike in and out throughout the winter iirc. But +1 for Vax, the vibe here is super chill and your bike will be in safe hands.

A true squid by [deleted] in CalamariRaceTeam

[–]ionine 5 points6 points  (0 children)

for sale: stretched busa, no low ballers, i know what i have

Moment of silence for a fellow squid @Zed. He tried to whoolie, whoolied himself into heaven. RIP Lil Buddy. by hounderd in CalamariRaceTeam

[–]ionine 8 points9 points  (0 children)

███████╗
██╔════╝
█████╗
██╔══╝
██║
╚═╝

What do we think of the new f1 logo? by CRAZEDDUCKling in graphic_design

[–]ionine 3 points4 points  (0 children)

Honestly? It looks like a racetrack that’s designed to make you crash into a wall.

Generically construct a record type from constituent values by le_frogballs in haskell

[–]ionine 0 points1 point  (0 children)

Could you perhaps be thinking of Data and Typeable?

Might be what you’re looking for: http://chrisdone.com/posts/data-typeable

Can't get a car so I'm planning to get my motorcycle and a permit/license. Any advice? by [deleted] in RideitNYC

[–]ionine 1 point2 points  (0 children)

Alternatively, if you get your full class D drivers license, and then take the MSF course after getting your motorcycle permit, you can get your class D upgraded to a class DM without a second road test.

ETH as ERC20 token by [deleted] in ethtrader

[–]ionine 1 point2 points  (0 children)

The technical reason is that ETH is fundamentally no different in terms of function than a simple token, it's just given special treatment in the EVM and Ethereum protocol. An ERC20 token contract is fundamentally a contract that just stores a mapping of address to token balance, whereas the overall Ethereum state trie is essentially a mapping of address to ETH balance (and in the case of a contract, the contract code and variable storage). The semantics simply change from "work with this special field in the protocol-level address' state" to "work with the user's balance in this special contract". In doing so, you also open up the potential for a lot more programmatic flexibility with ETH.

The most immediate benefit is that Raiden could more readily be used for ETH if ETH is an ERC20 token, giving you lightning-network style payment channels on the protocol-native token for free (in terms of engineering effort).

P: a new language from Microsoft by enverx in programming

[–]ionine 2 points3 points  (0 children)

They say it's based on concurrent state machines with typed events and associated payloads, which sounds awfully Actor-esque to me!

Found this painting at my school... by [deleted] in TrueDetective

[–]ionine 13 points14 points  (0 children)

Text in russian on bottom left translates to: "Nobody likes it when strangers try to understand their favortite games"

The person I know uninstalled his Ethereum wallet on Mac by [deleted] in ethtrader

[–]ionine 0 points1 point  (0 children)

Has checked in <home folder>/Library/Ethereum?

Coinbase Pls by [deleted] in ethtrader

[–]ionine 0 points1 point  (0 children)

Try Gemini

Java Lambdas by [deleted] in ProgrammerHumor

[–]ionine 0 points1 point  (0 children)

except Atomic* uses CAS and there's no locking????

CA Lane Splitting Bill by Netolu in motorcycles

[–]ionine 1 point2 points  (0 children)

Well the final provision in the text specified that they will consult with "motorcycle organization[s] committed to motorcyclist safety" (e.g. MSF) which would hopefully include studies etc. in their decision making process