Why anybody in their right mind would design a bus protocol that a) can't be bit-banged reliably by an embedded processor such as a PIC because it requires latching data on a rising clock and the slave device can "stretch" the clock as long as it wants so you can't just count cycles, b) has no provisions for a bus reset if the senders and receivers get out of sync and get to the point where they have no idea what the bus state is supposed to be, and c) has no provisions for a timeout, meaning that the bus could, like, hang for freakin' FOREVER... oh nevermind. Nobody in their right mind did design this stupid sensors bus. It was maniacs on day release from Bellevue Insane Asylum who designed it, gibbering maniacally over their keyboards as they scribbled the specification. AGH!
Gotta go, time for my meds. The doctors say that i2c-caused insanity is common for people charged with writing i2c device drivers but is curable, usually. This penguin can only hope...
-- Badtux the Techie Penguin
I've heard that pot is a good med, but I didn't get it. I've never tried any of the other drugs, so I don't know about them.
ReplyDeleteWait, beer is a drug they say, okay, I can live with that, it works for me and doesn't get me in trouble.
Tux, have you been writing code for a RISC processor in assembler language again? Compared to that, the I2C stuff is a piece of cake. ;-)
ReplyDeleteOk, I'm off to debug some RISC processor code (in machine language, no less!).
Dave
The PIC resembles a RISC, yes. PIC assembly language is another one of those demented inventions of the residents of Bellevue Insane Asylum, but compared to i2c, PIC assembly language is downright sensible... at least the PIC, like, does everything necessary to get the job done. i2c does not. Folks hack timeouts and bus resets into i2c, but the wire protocol has absolutely no provisions for them, so that's all it is -- hacks.
ReplyDeleteWhat? You think that's tough. It's a cake-walk. Used PICs for bit-banging I2C on Wireless BTS equipment. Shipped a butt-load of the stuff.
ReplyDeleteHope your meds work.