5 ms·
tangential to 'how can a bit be wrong', when trying to see if a serial data line is working, i write 0xA5 ( 1010 0101 ) to send an alternating bitstream with a
by jareklupinski 3y ago
tangential to 'how can a bit be wrong', when trying to see if a serial data line is working, i write 0xA5 ( 1010 0101 ) to send an alternating bitstream with a twist so i can test the greatest number of things i think can be wrong at once
- genter 3y agoExcept that if you have the bit endian wrong, 0xA5 is the same forward and backward.
- ahoka 3y agoEndianness is byte order.
- mysterydip 3y agoBit endian is a thing in serial protocols. I had an issue with that when using a microcontroller to talk to an LCD last week.
- jareklupinski 3y agothat's true! 0xAA 0x55 would work to differentiate that case?
- theblazehen 3y ago0xAA 0x55 is actually used as the last two bytes in the MBR just for this purpose
- MadnessASAP 3y agoYes, AA and 55 are common test patterns for a variety of hardware. Haven't seen A5 in the wild but I suppose it could be useful as a initial "Let's setup a connection" where endianness is unknown. Assuming the next thing that is exchanged is an endian negotiation.
- genter 3y agoI like to have several sequential ones. Easier to see on the oscilloscope. (I spent last night getting a microcontroller to talk to a SPI device, so I'm still licking my wounds.)
- UweSchmidt 3y agoHow would a HNer who's not familiar in those nether regions of computing, but wants to feel the excitement of sending a bitstream over a (possibly faulty!) serial data line, get started? Two Arduinos and a cable maybe?
- olalonde 3y agoI would suggest to search for "Arduino starter kit" or "embedded starter kit" on Amazon. They come with lots of components and usually with some project guides.
- jareklupinski 3y agoyup that's what I was building :) i was sending pixel data out from an Arduino (ESP32 really but using Arduino IDE) to a bunch of shift registers that seemed to be 74x595 (but couldnt know for sure) to resurrect an LED display for a local art project, and reading the data coming back out from the last register let me know I was at least getting back what I was putting in, which helped me troubleshoot a few wire length and speed/stability issues to get started with electronics and hardware in general, I wrote a short tutorial: https://news.ycombinator.com/item?id=35116705 https://news.ycombinator.com/item?id=35116705
- UweSchmidt 3y agoThat tutorial of yours is a lot more than I expected to get out of my question, such a cool first project! Thanks!
- robocat 3y agoPersonally I would recommend finding fun or useful projects where you have an outcome you really desire. Start simple - one sensor like a bath overflow warner (arduino is good or maybe raspberry pi). Learning hardware just for the sake of it is tough to keep motivated and perhaps you would never use the skills you learn? Hardware adds a tougher level to debugging - but software experience gives you a fantastic start - a logical mind and rational drilling down. If you can fix your car you have the skills to start on electronics! A lot of skilled people grew up through the hardware generations e.g. I began learning basic electronics because on an Apple ][ everything was simpler and we were all at the same stage. My first job was writing low level serial driver code and regularly dealing with serial devices (e.g. on PC). Our modern context is just not the same. The internet is hard to learn from. It is difficult to write good articles to help - the experienced like me just know a huge variety of implicitly learned knowledge. I suggest you concentrate on a useful or fun outcome - I believe it's good life practice (and good engineering) to stay focused on the outcome and not get too side-tracked by explicitly trying to learn. We implicitly learn just by doing!