Getorix_ has joined #glasgow
Getorix has quit [Ping timeout: 268 seconds]
<whitequark> electronic_eel: i finally went to implement the i2c access thingy, and there's a small issue
<whitequark> namely, the fx2 hardware is likely unable to follow an i2c read with a repeated start
<whitequark> which is kind of a bizarre restriction now that i think about it
<whitequark> i'm wondering if actually i can do it anyway by tickling an undocumented corner case, but the chances are low
<whitequark> tnt: thanks for the openvizsla btw, it let me find an annoying bug in my nrf24lu1 code a few days ago
<whitequark> ktemkin: and viewsb is awesome
<tnt> whitequark: glad it's useful :)
<whitequark> i rarely need it by this point, but when i do need it... it's invaluable
<whitequark> i wish i knew less about USB
<whitequark> electronic_eel: ok well this is super cursed
<whitequark> but i *can* get the fx2 i2c peripheral to follow a read with a repeated start by exploiting a race condition
<whitequark> assuming that i know before the read ends what the address will be
<whitequark> i'm not really sure if i should ship that though..
<whitequark> basically, you read from I2DAT (which triggers the transfer of a last byte, and if you just want to stop after that, you have to write STOP to I2CTL the very next cycle
<whitequark> which is actually really hard on 8051 but i do manage it
<whitequark> if you write START|STOP to I2CTL it just does STOP
<whitequark> but if you write START and then change I2DAT real quick to the address of the next device you want, then instead of a NAK,STOP it *actually* does a NAK,REPSTART,addr
<electronic_eel> whitequark: thanks for working on the internal i2c stuff
<electronic_eel> do we have some case where we really need read with repeated start?
<electronic_eel> it is of course really annoying that you can't do that properly on the fx2
<whitequark> i have no idea
<whitequark> but it would influence design for the protocol
<whitequark> so it's kind of important for future
thaytan has quit [Ping timeout: 258 seconds]
thaytan has joined #glasgow
<electronic_eel> let's hope cypress learned something and fixed it in the fx3, then I'd prefer if the protocol wouldn't need a major overhaul to support it
<electronic_eel> so maybe design the protocol so that it would be able to do it, but detect it on the fx2 and send an error reply?
<whitequark> i'm pretty sure fx3 is a completely new design
<whitequark> as for fx2, i mean, if we're going to the trouble of having packets for it and also detecting it, why not just implement it?
<whitequark> using the workaround i found
<electronic_eel> I haven't worked with the fx2 on that level yet to be able to judge how reliable the workaround is
<electronic_eel> can there be some corner case where the workaround may not work?
<whitequark> i don't foresee any issues with it
<whitequark> i think i'd need to disable interrupts for the small part of that instruction sequence that does the thing
<whitequark> actually
<whitequark> fun fact: i don't disable interrupts right now, so all i2c reads are subtly broken in principle
<electronic_eel> yeah, interrupts are one case where it could break
<whitequark> in case you receive one exactly between the instruction that does the I2DAT read and the one that does STOP write to I2CTL
<whitequark> there will be one extra byte read
<whitequark> that I2C peripheral design is fucking terrible is what it is
<whitequark> I never realized
<electronic_eel> I haven't read the manual for the fx2 i2c peripheral, but it sounds really bad
<whitequark> fun fact #2: the other OSS BSP for fx2, fx2lib, actually tries to do what I said but in C
<whitequark> like ... buf[i]=I2DAT;I2CTL=_STOP
<whitequark> which of course does not translate to the necessary instruction sequence, because you can literally not do this in plain 8051
<whitequark> doesn't even matter that it's C, you can't do it in assembly either
<whitequark> actually, you can't do it even in FX2's extended 8051 (really DS80C320, but they don't tell you that this is their IP, I just know it is because all the SFRs and cycle counts match)
<electronic_eel> does cypress offer some lib for i2c?
<whitequark> what you have to do is to use one of FX2's extra peripherals that provide basically memory access acceleration
<whitequark> and you have to note the memory layout of I2C registers
<whitequark> they tell you in the datasheet that you have to do it in 2 adjacent cycles, but they don't tell you *how*
<whitequark> you just sort of have to guess which feature of the chip to abuse
<electronic_eel> ouch, that is some kind of trickery required
<whitequark> oh, hm
<whitequark> according to my own comment, this is actually doable with plain 8051
<whitequark> electronic_eel: so, not sure how familiar you are with 8051
<electronic_eel> I have to go to work now, sorry
<whitequark> ah ok
<Stormwind_mobile> I was digging for sources for that fx2 part and found offers in the 10-15$ range, with one exception: 3,78 for a part "without warranty" or something. Never seen a listing like that at a distributor.
<whitequark> I assume those are pulls
<whitequark> pretty common when buying FPGAs in China
<whitequark> or really, anything in China, especially if it's out of production
<Stormwind_mobile> Of a BGA part?!
<Stormwind_mobile> Pulled I mean
<whitequark> I haven't personally seen BGA pulls before but I don't see any reason it couldn't be done
<whitequark> lemme ask on twitter if anyone had
<Stormwind_mobile> I guess no business customer is going to go through the trouble of reballing a 10$ part, right?
<whitequark> er, they would be reballed by the entity that pulled them
<Stormwind_mobile> For a x00$ FPGA, maybe
<Stormwind_mobile> Hopefully so!
<whitequark> and probably sold as new
<whitequark> like
m4ssi has joined #glasgow
<whitequark> i remember seeing USB flash drives which actually had a micro SD card inside *with testpoints soldered to the NAND footprint*
<whitequark> (many microSD cards have the internal NAND array exposed on tiny testpoints underneath, usually behind a layer of paint/lacquer too)
<whitequark> if you can do that sort of batshit insane stuff and still be profitable, reballing 10$ BGAs has got to be common
<Stormwind_mobile> I remember seeing pictures of these USB drives. Hilarious!
<Stormwind_mobile> Every penny counts, I suppose...
<whitequark> because you know, there are actual data rescue companies that refuse to do this sort of thing for microSD cards
<whitequark> as it's too expensive
<whitequark> and the pinout is usually hard to discover, though that one at least amortizes
<Stormwind_mobile> That would make for a funny "unpopular opinion"-tweet:
<Stormwind_mobile> "MicroSD cards are just BGAs without balls. Don't @ me!"
<whitequark> have you seen the ... bizarre... package LMS7002 comes in? https://limemicro.com/app/uploads/2018/07/LMS7002M_1.jpg
<whitequark> it's a QFN, supposedly
<whitequark> I insist it's a BGA without balls, and it would probably be much happier being an actual BGA
<awygle> Indeed.
Stormwind_mobile has quit [Ping timeout: 240 seconds]
Stormwind_mobile has joined #glasgow
<Stormwind_mobile> I got my hands on a PCI card with a bunch of Virtex II pro and some other FPGAs on them. Was thinking that it might be profitable pulling those chips and try my hand at reballing them. They are listed for 1200$ at digikey, although I seriously doubt anyone will pay that price nowadays.
<Stormwind_mobile> So now I need to make a Chinese eBay account to make that look legit?
<whitequark> listing them as reballs would make you look more legit tbh.
<whitequark> because everyone knows where suspiciously cheap FPGAs actually come from.
<Stormwind_mobile> Speaking of funny footprints: what would you call this one?
<whitequark> pretty common dual row QFN
<Stormwind_mobile> Really? First time I see this one
<whitequark> they are used a lot in low-end devices apparently
<whitequark> i've seen them in routers
<whitequark> reportedly it is impossible to rework them, and unsurprisingly so
<Stormwind_mobile> Actually, I am reversing a withings fitness tracker for fun and profit in the form of reusing the 128*32 OLED display. That tracker features the cc2564 chip, but in a BGA 56 (or WCSP or whatever, bare die) package that the datasheet doesn't mention
<Stormwind_mobile> Where do you all source your parts for Glasgow? Is it worth the hassle asking the chip vendors for samples? Do they actually hand these out?
<noopwafel> in .eu, I distributed parts order across digikey+mouser (+TME for that pink LED)
m4ssi has quit [Read error: Connection reset by peer]
m4ssi has joined #glasgow
thaytan has quit [Ping timeout: 260 seconds]
Stormwind_mobile has quit [Ping timeout: 240 seconds]
fibmod has quit [Ping timeout: 265 seconds]
thaytan has joined #glasgow
Stormwind_mobile has joined #glasgow
fibmod has joined #glasgow
Exec1N has joined #glasgow
<awygle> I cannot fathom the mind of anyone who looks at a QFN and says "this is Good... But if it was More, it would be Great"
Exec1N has quit [Ping timeout: 265 seconds]
<Stormwind_mobile> The interesting question is: "If a regular QFN is already "no lead", has a double row QFN more or less leads, and why?
<Stormwind_mobile> Hacker jeopardy question
Exec1N has joined #glasgow
Exec1N has quit [Ping timeout: 265 seconds]
Exec1N has joined #glasgow
m4ssi has quit [Remote host closed the connection]
<kc8apf> cue extremely cursed footprint that was making the rounds a few months ago
<kc8apf> does anyone know where to source cheap, direct footprint compatible SOIC-8 and SOIC-16 sockets?
bgamari_ is now known as bgamari
bvernoux has joined #glasgow
Exec1N has quit [Read error: Connection reset by peer]
Stormwind_mobile has quit [Ping timeout: 268 seconds]
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 268 seconds]
Exec1N has joined #glasgow
ExeciN has quit [Ping timeout: 265 seconds]
Seraxis has joined #glasgow
<davidc__> kc8apf: don't know off the top of my head, but if you find out....
<davidc__> kc8apf: IIRC I got a SOIC-8 compatible one from Digikey/Mouser a while back, but I don't recall it being cheap
<kc8apf> I've been searching. I saw them on a prototype server motherboard so I know they exist. I just can't find out who makes them
<davidc__> kc8apf: Emulation tech has lots of stuff, and I have the name of a taiwanese socket mfg around somewhere
<kc8apf> There are lots of gull-wing and open-top test/burn-in sockets but those are ridiculously expensive
<davidc__> ugh, Emulation Tech apparently got bought at some point and now their website is beyond useless
<davidc__> kc8apf: LOTES ACA-SPI-004 ; https://www.aliexpress.com/item/33041320407.html (I hate recommending aliexpress as a source, but they don't seem to have distribution elsewhere)
<davidc__> kc8apf: not the one I was thinking of, but similar style
<kc8apf> yeah, that's very close to what I want
<kc8apf> wish I could find a reliable distributor for things like that
<bvernoux> does anyone know a good cheap RGB Led driver ?
<bvernoux> I'm searching one for independant RGB Led (so 3 GPIO 1 per colour)
<awygle> I need a cheap SOIC->DIP adapter, if anybody has a source for that
Seraxis has quit [Quit: おやすみ]
Seraxis has joined #glasgow
<kc8apf> awygle: how cheap? The one-time-use kind are cheap. Socketed adapters that are easily available tend to be more expensive
<awygle> the one time use kind
<awygle> and ideally like... pennies, in qty 1000 or more
<awygle> I'll probably do a pcb...
Seraxis has quit [Quit: おやすみ]
Seraxis has joined #glasgow
Seraxis has quit [Remote host closed the connection]
Seraxis has joined #glasgow
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 240 seconds]
Stormwind_mobile has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 268 seconds]
Stormwind_mobile has joined #glasgow
<davidc__> awygle: I like proto-advantage for adapters, but they've gotten more expensive in recent years
<davidc__> awygle: a PCB you get made yourself at qty 1k is probably the cheapest; especially if you can do all SMT on one side
<awygle> yeah, that was my thought as well. kind of annoying but what can you do
<awygle> i also considered seeing if i could get bare dies and contact an ic packaging company to just _make_ me some DIP parts :p
<davidc__> eh, at a large enough volume, the original mfg might be willing to do a DIP run for you
<davidc__> But I can't imagine NREs will be less than $1k, which buys a lot of PCBs + headers
<electronic_eel> whitequark: just read through the i2c part of the ezusb-lib source from cypress. they just implement the veeery basics, no proper error handling,...
<electronic_eel> they completely ignore the case of repeated starts
<electronic_eel> so unfortunately no tricks we could learn from
bvernoux has quit [Quit: Leaving]
<electronic_eel> when browsing the source from cypress it felt a bit like a flashback to the '90ies
<electronic_eel> then I looked up the release date, the original fx2 is from 2001. wow 19 years old design
<electronic_eel> and they were fast - usb 2.0 was just specced in 2000, so they got their shit together to release it that fast after the spec was done
<gruetzkopf> which explains why they got so popular so fast
<electronic_eel> yeah, and the fx2 was able to deliver what usb highspeed promised
<electronic_eel> and if you look at what for example ftdi sold at that time, cypress was a different league
<gruetzkopf> they were really common in early usb2->ide adapters
<gruetzkopf> which is where i've first seen them back when my age was single-digit
<electronic_eel> ah, did the vendors combine the fx2 with a dedicated ide chip back then?
<electronic_eel> the first usb-ide adapters i took a deeper look at were genesys logic and the like which integrated everything
<kc8apf> gruetzkopf: somehow I assumed you were older
<gruetzkopf> you're not the first to say that
<electronic_eel> ah, seems they implemented ide completely on the fx2
<gruetzkopf> i'm just under a quarter of a century old
<gruetzkopf> yeah
<electronic_eel> probably should have bought one of these back then instead of the genesys stuff - IIRC I had trouble putting a hard disk into suspend mode through the adapter
<electronic_eel> they filtered or didn't implement a lot of commands