Add USB To Your Electronics Projects! - The USB Protocol Explained

  Рет қаралды 433,155

Sine Lab

Sine Lab

Жыл бұрын

USB is both the simplest and most complex interface to use. It is simple to plug in and let the computer handle. It is complex to create and run a microcontroller with it.
-- Links --
My Website: sinelab.net
Buy me a coffee: www.buymeacoffee.com/thesinelab
Bitcoin Address: bc1qwlfr2ml9km4r5vhpfh7f3m60k80whhcq3ysths
Ethereum Address: 0x7e8B8Ff8D6bD8DfB48b4A139694BB343f040Bb3f
Schematic: sinelab.net/pdf/usb_test.pdf
Code: sinelab.net/code/usbify.zip
ASF-USB: asf.microchip.com/docs/latest...
LUFA: www.fourwalledcubicle.com/LUFA...
USB Datasheet: sinelab.net/pdf/usb-20-specif...
ATmega16u2 Datasheet: sinelab.net/pdf/ATmega16u2.pdf
Adapter: www.aliexpress.us/item/225183...
--

Пікірлер: 375
@SineLab
@SineLab Жыл бұрын
For anyone wondering, here's a link to the SMD adapter: www.aliexpress.us/item/2251832624996364.html?spm=a2g0o.productlist.main.7.76c52ecbfcRb7K&algo_pvid=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c&algo_exp_id=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c-3&pdp_ext_f=%7B%22sku_id%22%3A%2264495190690%22%7D&pdp_npi=2%40dis%21USD%2111.8%219.91%21%21%21%21%21%40211bf12316751972869527289d06f4%2164495190690%21sea&curPageLogUid=S39oAQQcKzaA
@unknownerorr2740
@unknownerorr2740 Жыл бұрын
I have no idea how I ended up here. I'm light years away from this level of engineering. But this video was explained so well. This seems really helpful! Thank you for making this!
@SineLab
@SineLab Жыл бұрын
Thanks for watching! I'm sure you will find it more personally useful in the future. :)
@AutoFirePad
@AutoFirePad Жыл бұрын
These are your first steps...
@voice5sur5
@voice5sur5 Жыл бұрын
same i'm here and was able to watch 40% of the video despite having not skill or knowledge about what i'm watching. he did a good job.
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
If you've ever successfully used Arduino to do anything, you can handle this. Everything you need to know to use USB on a day-to-day basis is in the chip documentation. Most of these details about the exact workings of the protocol aren't relevant if you just want to make something with USB capability, and you can always come back later when you need to understand more. Good luck.
@vking4784
@vking4784 Жыл бұрын
I use to watch this stuff and think just this but i'm now gratefull that i did i outstand in a lot of ways at work and at clubs in uni because i just enjoyed the subject and focused on whatever came at hand on youtube so just whatch whatever stuff comes along if you dont learn anything its still a great way to have a keywords to search for and in no time you'll be able to undstand a lot of complicated stuff . Good luck to you
@alexstone691
@alexstone691 Жыл бұрын
I thought finally a VUSB tutorial that a mortal can understand, most distributers dont ship to Serbia and locals are ripoff and dont have most modern ics
@SineLab
@SineLab Жыл бұрын
I've added V-USB to my list of future videos. ;)
@alexstone691
@alexstone691 Жыл бұрын
@@SineLab I've made whole library with libusb without understanding the protocol, the video was quite useful not gonna lie
@lasskinn474
@lasskinn474 Жыл бұрын
@@SineLab please do, it would get at least somewhat popular.
@jessyltr581
@jessyltr581 Жыл бұрын
Seems like you could easily build a honnest buisness selling ics in Serbia then you'd beat competition through good customer support and parts availability.
@alexstone691
@alexstone691 Жыл бұрын
@@jessyltr581 Probably not, the country is pretty corrupt and taxes are high so if any politician or anyone important has anything to do with existing companies then youre screwed
@PhilXavierSierraJones
@PhilXavierSierraJones Жыл бұрын
If you *just* need serial connection to be turned into USB connection, CH340 (with some series of chips requiring even less external components than the rest, like CH340C) is a really, really cheap option.
@jan.tichavsky
@jan.tichavsky Жыл бұрын
Even better is to use the $1 RP2040 or whole Raspberry Pico board. USB with C or Python, plenty of power, good amount of I/O and the board is ready to use, embed in existing project.
@TheCuteZombie
@TheCuteZombie Жыл бұрын
The problem is, those implementations are already talked into exaustion by all other sources. Just type "diy USB" in any search engine and you are bombarded by usb to serial and the likes. Good for a cheap, fast and not customizable application, but horrendous for anyone actually trying to understand the protocol and create a more complex application.
@carlosgarcialalicata
@carlosgarcialalicata Жыл бұрын
I prefer CP2102N, smaller and even less external requirements
@urnoob5528
@urnoob5528 Жыл бұрын
@@jan.tichavsky ch340 is like cheaper and easier to use dont even need to program. and by plenty of power, do u mean strapping a whole other microcontroller to ur device or do u mean it consumes more power did u read what the comment said? we just need an interface to usb. for example, for a microcontroller or cpu like 8051 and 6502, mybe these are too old, what about atmega328p which a lot of people still uses then? we could just add a hardwired usb chip like ch340 nobody sane would put a rp2040 on there, at that point, just use the rp2040, and all the other parts in ur existing project has now become extra and obsolete 8051 and 6502 are too old for commercial products, but who to judge u if u use them for home or hobbyist project? that is another reason to opt for a usb chip, rp2040 overkills and defeats the purpose, it seems ironic to use rp2040 as the usb interface while these older micros are the actual brain of the project of course this assumes that u didnt start ur project with rp2040 in mind but other components if u have thought of usb, u would have chosen the appropriate components in the first place, like rp2040
@Mr.Leeroy
@Mr.Leeroy Жыл бұрын
USB to TTL is only one class of USB spec. It won't do HID, Mass Storage, other.. But, ofc, there are easier ways. Like Digispark based on tiny85 with premade libs, which can do some.
@BoredInNW6
@BoredInNW6 Жыл бұрын
Oh wow! I had no idea those solderless SMD adaptors existed! The whole video was good, but that bit of information was life changing!
@SineLab
@SineLab Жыл бұрын
Those adapters are really handy
@myetis1990
@myetis1990 Жыл бұрын
@@SineLab and expensive too :)
@Mr.Leeroy
@Mr.Leeroy Жыл бұрын
they are mainly aimed at pre-programming before assembly line, not prototyping.
@tissuepaper9962
@tissuepaper9962 Жыл бұрын
@@Mr.Leeroy I've also seen some companies using them as a way to make a universal development board for their whole range of chips. I want to say it was a TI board that I'm thinking of.
@teejay872
@teejay872 Жыл бұрын
@@myetis1990 They used to be in the hundert dollars pricerange. But you can get them for "cheap" in china nowdays.
@RegisMichelLeclerc
@RegisMichelLeclerc Жыл бұрын
Ben Eater has made a video on the USB protocol explaining it from the oscilloscope point of view, with an implementation on 6502.
@Mike98006
@Mike98006 Жыл бұрын
Great introduction to USB programming. It would be nice to see a video explaining how HID interfaces work and how they correlate with the low-level USB transfers described in this video.
@SineLab
@SineLab Жыл бұрын
Thanks for the idea!
@jercos
@jercos Жыл бұрын
Excellent overview, though for nearly $4 in the current market, I'd favor an RP2040/pi pico over an atmega. PIOs can handle matrix scanning, sensor interfacing, and even a second USB, while the SIO peripheral offers the low-latency pin access often missing from 32-bit mcus.
@SineLab
@SineLab Жыл бұрын
Pick whichever solution works best for your project :)
@Mr.Leeroy
@Mr.Leeroy Жыл бұрын
RP2040 can be had at $1 nowadays. So, yeah, it or Pico is a winner at availability. This video, on the other hand, is clearly a low level hardware exercise, and AVRs are still a great foundation for that.
@PainterVierax
@PainterVierax Жыл бұрын
@@Mr.Leeroy RP2040 is not a great solution either. This chip has very weak current output capabilities (max 12mA) and often requires the addition of discrete transistors. It's great to have two cores but they are quite obsolete ARM Cortex M0. Then compared to classic AVR or PIC, those 32bit MCUs have a convoluted HAL when digging a bit into advanced programming and they rarely have integrated logic level shifters to communicate with the still very popular 5V logic.
@Mr.Leeroy
@Mr.Leeroy Жыл бұрын
@@PainterVierax It is a bad practice to connect IO directly anyway (in any industrial device). STM32 is guaranteeing even less current (9mA IIRC). Most of the pins on RP2040 are 5v tolerant and level shifter requires 2 FETs, that are dirt cheap, I see zero issue with that.
@PainterVierax
@PainterVierax Жыл бұрын
@@Mr.Leeroy Direct i/o is only a bad practice when you have non-rugged MCUs because I saw that on almost every PCB design embedding MCUs, SoCs or good old processors. Though industrial devices generally don't use USB but Canbus, RS485 or Ethernet which require proper transceivers nonetheless. A proper RP2040-based devboard means that a lot of discrete components have to be around. I don't preach for STM32 either. Its HAL is atrociously convoluted.
@Listeningtomuzak
@Listeningtomuzak Жыл бұрын
I studied molecular biology. It’s amazing how DNA encodes its information so efficiently - i.e. at the most basic level our genes are coded following the same structure as the USB packet. There’s a binding site that allows for a protein complex to latch on upstream of the gene. Then that complex slides along the DNA, sniffing for the START sequence. Downstream of that is the body of the data, followed by a STOP sequence. At a higher level, there’s plenty of extra modifying data in and around the gene, as well as different interpretations of the data where chunks can be edited out. The bulk of this coding scheme evolved in very, very early life and every cell on earth depends on this established protocol. There’s so much more going on at the higher control level of gene translation that we still don’t understand - we need the brilliant minds of computer science to reveal to us how exactly the cell operates translation and gene expression.
@dc37009
@dc37009 3 ай бұрын
Beautifully illustrated ~Thanks ! ...and I think your talking about immortal scale, beyond Rain Man. I think AI will have something helpful to say on the subject !
@StephenBrown85
@StephenBrown85 Жыл бұрын
This was a really nice and concise intro - a lot of other videos on the topic are 45 minutes long and so boring I couldn't make it through!
@SineLab
@SineLab Жыл бұрын
Thank you for watching through it :)
@crossbones911
@crossbones911 Жыл бұрын
I agree. It's a good primer.
@soroush92
@soroush92 Жыл бұрын
God knows how many times I tried to find a useful resource to get familiar with usb protocol. God bless u and ur family sir. I will follow u forever ♥️
@lalchandra4590
@lalchandra4590 5 ай бұрын
Oh really this is 15 min long video. I think it's level is many hours of study in college. I shocked that this video's every frame is informative. Thanks for saving alot my time.
@dalesmith8666
@dalesmith8666 Жыл бұрын
The absolute easiest USB chip to use is the Microchip PIC18F4550, DIP40! Plenty of examples, great datasheet, and applications notes. Been using these for years! No surface mount nonsense, either! An excellent book is Jan Axleson USB Complete, for those that want to learn and experiment.
@andrew2004sydney
@andrew2004sydney Жыл бұрын
Cool video, dude! I was expecting the USB FTDI UART merry-go-round ride, but instead we went on the USB roller coaster, underwater in the dark! Thanks
@Delali
@Delali Жыл бұрын
This is really cool to learn. I kinda got a little lost mid-way but i think its because of all the technical terms. I'd definitely implement some of the ideas here soon on my channel. Always good to learn
@rusticbear195
@rusticbear195 4 ай бұрын
This is not at all what I was looking for, but I'm glad I got here. This was a wonderfully in depth guide
@michalsebek2089
@michalsebek2089 2 ай бұрын
Fun fact, on Arduino Uno, the chip handling the USB-serial conversion is actually the ATmega 16U2 microcontroller. Furthermore, you can easily reprogram it to another purpose. Although its IO is very limited, it is connected to the main ATmega328P microcontroller through two pins (the ones that normally serve as the serial line), so you can use a serial protocol to exchange data between the two microcontrollers on-board.
@myetis1990
@myetis1990 Жыл бұрын
thank you for the great content. cant wait to see the next video about usb. hope it will be a mass storage class tutorial. or DFU
@carlosbah4623
@carlosbah4623 5 ай бұрын
Just discovered this channel! Very good. ¡Gracias por compartir!
@snipsnap9995
@snipsnap9995 Жыл бұрын
This is exactly the type of video I was looking for a few months ago! This is the perfect start for those who want to hack around with USB
@thompsonschwabbel6622
@thompsonschwabbel6622 4 ай бұрын
i've harvested a bunch of analog turning knobs, sliders, latching and tactile switches from a ancient fried 8-channel sony mixpult. I'm gonna use them to upgrade my flightsim setup; this video is worth its time in gold since i had no idea how to cross the analog-digital bridge. thank you a thousand times.
@SineLab
@SineLab 4 ай бұрын
Thank you for watching and good look with your project :)
@1Chitus
@1Chitus 11 ай бұрын
Timestamps: @0:01 intro @1:00 selecting a microcontroller (why you need to be picky) @2:50 parts & circuit diagram. @3:57 USB protocol explained @12:32 Libraries to interface with USB protocol. Luff library FTW No need for drivers. @14:46 debugging programs.
@usamakr
@usamakr Жыл бұрын
Great overview. Thanks for putting the effort in making this content.
@SineLab
@SineLab Жыл бұрын
Glad you enjoyed it!
@cat22_a1
@cat22_a1 Жыл бұрын
Years ago I was tasked with writing a raw USB driver from scratch for Itanium. It was quite a challenge but i eventually got it working. All I had to go by was the spec. We had no libraries or even a file system. Code was loaded by direct injection using a special card.
@SodAlmighty
@SodAlmighty 11 ай бұрын
That was the most detailed and useful USB tutorial I've ever seen.
@SineLab
@SineLab 9 ай бұрын
I'm glad you found it helpful
@cognisent_
@cognisent_ Жыл бұрын
Well hello there, small channel that the KZfaq algorithm decided to promote! This video was awesome! I had no idea I'd be learning about the bit level USB protocol this Saturday. I am going to try to commit kjkjkjkk to memory because that seems like some fun trivia to store. I'm about to go binge the rest of your videos and I'm excited to see what you make next! Thanks for making awesome content, new friend 🫂!
@SineLab
@SineLab Жыл бұрын
Thank you, enjoy all of the videos I have to offer :)
@TradieTrev
@TradieTrev Жыл бұрын
That's a damn good explanation, this is totally how they made the rubber ducky/bad usb devices!
@ZomB1986
@ZomB1986 Жыл бұрын
If it's not a keyboard or serial endpoint, then you *still* don't have to write drivers for your PC. You can make a regular application that interfaces with USB hardware, like I did with a LabSphere spectrometer with proprietary communications (reverse engineered with Wireshark). I even did it in Java.
@GregMatoga
@GregMatoga Жыл бұрын
Sooo excited to test that out! Although, I have this lurking feeling of dread of programming a custom driver
@SineLab
@SineLab Жыл бұрын
Get ready to debug it! :)
@newmonengineering
@newmonengineering Жыл бұрын
I built a custom driver one time...Microsoft is not nice. Maybe Linux is better? I only programmed it for windows. It was a file based storage type driver and was an absolute nightmare. It did finally work after 6 months of playing with it. But like I say, Microsoft is not nice. It's a real pain to get working. So many parts to the puzzle and getting them all to work together is a serious pain. However now there are many HID compliant ways around drivers, it is probably the best route if you can modify one and use the standards they have for the various driverless devices in that category. All the best to you if you write a driver!
@BrightBlueJim
@BrightBlueJim 5 ай бұрын
A very common thing, at least among electronics hobbyists, is to NOT program a custom driver. Many projects I've seen just use one of the standard Human Interface Devices, like keyboard, joystick, serial, or mass storage, with the most common being serial. This allows your "driver" to just be user code (i.e., not a device driver at all) that takes care of one side of a client/server relationship between the host and device.
@stevekoehn1675
@stevekoehn1675 Жыл бұрын
You explain these concepts so efficiently and clearly. My brain is getting older and this is what I need! Thanks
@SineLab
@SineLab Жыл бұрын
I'm glad I could help!
@epolpier
@epolpier Жыл бұрын
Endpoint0 is not only for configuration. There are many classes that use it for "normal" communication using class specific requests.
@djmips
@djmips Жыл бұрын
Nice! I've always wanted to know this but had a big mental block about reading up on it since the documentation is vast.
@SineLab
@SineLab Жыл бұрын
Yes, the datasheet is overly complicated
@JoseGustavoAbreuMurta
@JoseGustavoAbreuMurta 5 ай бұрын
Very good explanation about USB. Thank you
@edwardvanhazendonk
@edwardvanhazendonk Жыл бұрын
Great explanation, good to understand and as always protocols are not always straight forward.
@chrisw1462
@chrisw1462 Жыл бұрын
Definitely looking forward to more of this series. I've been interested in making my own USB projects for quite some time, and have had to rely on things like the CH340 serial to USB chips and ESP32-2 and 3 microcontrollers that have built in USB.
@cutterboard4144
@cutterboard4144 Жыл бұрын
Its super simple with arduino and the right µc. i personally like to use the atmega32u4 "leonardo". But a few months ago i got my hands on some ESP32 chips with wlan and i might switch to them for future projects.
@urnoob5528
@urnoob5528 Жыл бұрын
and he still talked about built in usb, so in actuality u were left hanging
@xzddakfdmiug5832
@xzddakfdmiug5832 Жыл бұрын
Thanks for covering this interesting and popular protocol.
@SineLab
@SineLab Жыл бұрын
Thanks for watching!
@lfmtube
@lfmtube Жыл бұрын
Very useful and well made video. Thank you
@e74av
@e74av Жыл бұрын
One of the most interesting videos lately :)
@SineLab
@SineLab Жыл бұрын
Thank you for watching :)
@colinmcintyre1769
@colinmcintyre1769 Жыл бұрын
I didn't know I needed this. Thank you.
@SineLab
@SineLab Жыл бұрын
You're welcome :)
@YTInnovativeSolution
@YTInnovativeSolution 3 ай бұрын
So what you are saying is..... USB protocol is very similar to automotive CAN Bus communications and since auto makers also have 'K-Line' communications, that could be related too. Thanks for the info. Well delivered with the graphics.
@michaelzlprime
@michaelzlprime Жыл бұрын
Great and concise guide!
@BalugaWhale37
@BalugaWhale37 Жыл бұрын
Very comprehensive. The J/K explanation was most interesting.
@SineLab
@SineLab Жыл бұрын
Thank you! :)
@ServiceOrchestramegastore
@ServiceOrchestramegastore Жыл бұрын
Actually there are lot to learn in this tutorial than the topic. TFS!!
@SB-qm5wg
@SB-qm5wg Жыл бұрын
Excellent video. Good info. I enjoyed that. TY
@SineLab
@SineLab Жыл бұрын
Thanks for watching!
@sgwong513
@sgwong513 Жыл бұрын
great explanation. good to know how usb works.
@HollyTroll
@HollyTroll Жыл бұрын
this was very very informative - thank you!
@SineLab
@SineLab Жыл бұрын
You're welcome! Thanks for watching!
@MrRecorder1
@MrRecorder1 Жыл бұрын
Just wondering: I totally expected you to mention the FTDI-series of chips here. If you purely want to ADD USB to your project, I would go for those. They are pricey, but you can in fact mostly ADD them and leave the rest of your design unchanged (serial communication channels are needed ofc). Also you can get fully fledged modules for quick setup. I typically end up using arduino's to add USB-support for devised however. I like their versatility. And for home projects, who really cares if you use 20 microcontrollers for a task that really would only require one :D
@SineLab
@SineLab Жыл бұрын
You are right, if all you need is serial then that would be the best option, along with cheaper alternatives like the CH340. This video was more about usb devices like keyboards, mice, etc. :)
@akkudakkupl
@akkudakkupl Жыл бұрын
@NRGY VIA is not the right chip to serve async serial. You want an uart for that
@akkudakkupl
@akkudakkupl Жыл бұрын
@NRGY Read up on asynchronous serial communication. You need an UART to recieve it, you could do it in software, but that will limit the speed a lot, in addition your computer will have to waste time on doing serial stuff instead of doing computing stuff. There are no 'fifo' lines in RS232, there is RX and TX.
@AJMansfield1
@AJMansfield1 Жыл бұрын
Though even for a prototype it does sometimes feel a bit silly to have a USB serial uC talking to a GPIO expander uC talking to our applications uC talking to a GPS uC and a bluetooth uC and a battery charge controller uC which itself is talking to the battery's own protection uC...
@akkudakkupl
@akkudakkupl Жыл бұрын
@NRGY Read this en.wikipedia.org/wiki/Asynchronous_serial_communication
@Zhaymoor
@Zhaymoor Жыл бұрын
Great explanation, thank you
@qzorn4440
@qzorn4440 Жыл бұрын
wow after this I think I will stick to something simple like USB4 Thunderbolt. 🤣 Thank a lot for the great description.
@trollobite1629
@trollobite1629 2 ай бұрын
RS232 is a long way from being dead, it is literally everywhere especially in networking. You will find it on Cisco, Infeneria/Transmode, Cienna etc, it's so prevalent we have to carry USB to RS232 converter leads.
@neilbedwell7763
@neilbedwell7763 Жыл бұрын
Great video learnt a lot thanks
@MrVipulLal
@MrVipulLal Жыл бұрын
Great explanation. Many thanks 🙏
@SineLab
@SineLab Жыл бұрын
I'm glad you found it helpful!
@zetaconvex1987
@zetaconvex1987 Жыл бұрын
Niceley explained. You obviously know more than me. Just a point: I think the differential pair is to help with clock drift. It's nice to see a an MCU with USB support, although I have never dealt with standalone chips. My soldering isn't up to it. I go for boards that I can plug in. I've implemented a USB driver using an RP2040 and tinyusb. Amazingly, it actually works given the complexity of USB.
@tiger12506
@tiger12506 Жыл бұрын
The differential pair is for noise. You can subtract the one signal from the other to completely remove any "common-mode" noise -- that is, noise that is common to both wires (external noise). Further, equal and opposite voltages result in equal and opposite magnetic fields that cancel each other out in a twisted pair. The KJKJKJKK sync at the start of each packet is what fixes clock drift.
@zetaconvex1987
@zetaconvex1987 Жыл бұрын
@@tiger12506 My bad. I think I mean the whole JK thing. If you have a stream of zeros, for example, which is quite common, the lines will toggle, helping to mitigate clock drift.
@BrightBlueJim
@BrightBlueJim 5 ай бұрын
@@zetaconvex1987 That's actually part of the NRZI protocol, which unlike RS-232, does not assume that you have fixed and stable clocking, allowing the receiver (or device, in USB parlance) to synchronize with the clock on a bit-by-bit basis rather than between characters. NRZI always has at least one transition per bit. It also has the advantage of always having the same amount of time high and low, on every bit, which allows for connections that must be isolated through a transformer, since establishing the high and low references is simple. In practice, USB interfaces are rarely if ever actually isolated, expecting that the devices can always be set to use the same ground as the host, but the design allows for it just the same.
@Quazee137
@Quazee137 Жыл бұрын
Here is a though for a project. Use the RPi Pico with a 2.8" up to a 4" LCD display. Create icons for keys in a 4 by (5 or 6) matrix. With this you can have more than one set of usable macros. Have two keys for moving through the other sets. I see all these keypad type of macros key but they use mechanical keys with fixed icons on them. Hold both up/down same time to go into upload mode for keypad the icons and macros. ATM I am playing with MMBasic on the Picos sadly no USB HID abilities. For my current use as controllers it just works. I only need minicom and the pico. Just musing after looking at the many ways here on youtube. Have FUN.😄 I have a box of Arduino's in many forms along with STM32 boards just starting to learn to play with them. LOL forgot to say the LCD needs touch.
@rick_er2481
@rick_er2481 Жыл бұрын
Amazing content, looking forward to future video's
@SineLab
@SineLab Жыл бұрын
Stay tuned :)
@fpgaguy
@fpgaguy 5 ай бұрын
Very nicely done, and as a surprise you use vi, very nice indeed.
@SineLab
@SineLab 5 ай бұрын
Vi/Vim is a programmer's best friend :)
@fpgaguy
@fpgaguy 5 ай бұрын
@@SineLab I have been using since 85 but started when I first brought up Unix box at home I built from bsd 4 sources Back then there was not much X so it used termcap to a vt102.
@Gastell0
@Gastell0 Жыл бұрын
Native serial ports are still present on many business workstations, which is nice
@Mr.Leeroy
@Mr.Leeroy Жыл бұрын
they are on all consumer motherboards I know, just as a header and not IO plate connector. Look up COM port in a manual pdf for yours.
@morskoyzmey
@morskoyzmey Ай бұрын
Using serial interface (via USB port) you can easly connect your hardware with your software without writing your own driver (which is not a task for novice). What ability for your hardware a USB interface could give you without writing your own driver? A keyboard and other known HID emulation. Wow. What a uselsess functionality.
@prakashm1468
@prakashm1468 Жыл бұрын
Great video bro!! Thank you so much.
@SineLab
@SineLab Жыл бұрын
Thank you for watching it!
@JyrkiKoivisto
@JyrkiKoivisto 3 ай бұрын
I once coded a device driver for AROS operating system (vusbhc (virtual usb host contoller), hosted on Linux) that talked to the Amiga "native" usb stack and used the user space libusb on Linux to talk to the real usb hardware, a stack inside of a stack... :)
@JyrkiKoivisto
@JyrkiKoivisto 3 ай бұрын
kzfaq.info/get/bejne/eNl1iLiYuMyle2Q.htmlsi=806HN-iQ5J1ogvEs
@jonahy-m2099
@jonahy-m2099 Жыл бұрын
Great job👍😊
@Bianchi77
@Bianchi77 Жыл бұрын
Nice info, thanks for sharing it :)
@SineLab
@SineLab Жыл бұрын
You're welcome! :)
@petercheung63
@petercheung63 Жыл бұрын
super good video, thanks
@Harm10412
@Harm10412 Жыл бұрын
This was an awesome video!
@user-yn1vv8ey8u
@user-yn1vv8ey8u 6 ай бұрын
Excellent man.
@skanderbenmrad946
@skanderbenmrad946 Жыл бұрын
Very good. Thank's
@sagar73594
@sagar73594 Жыл бұрын
Great Scott, good one.
@marcdraco2189
@marcdraco2189 Ай бұрын
One minor thing, you appear to have misunderstood how balanced lines (D+/D-) work. Unless you were oversimplifying, there's more here than "simple" noise rejection. For example, I haven't tried this with USB, but a balanced pair doesn't need a ground to work. In fact the ground doesn't need to be connected at all because the difference in voltage between the two lines creates the signal when it's mixed at a differential amplifier. A much earlier use for this sort of thing is in "phantom powered" microphones which use the two "data" lines here to supply power to a small audio amplifier (strictly an impedance converter). Each line carries +48V (in theory, in practise it never reaches that when in circuit) out to the microphone with and two (opposing signals) on way back. However, some of these mics are "self-powered" and only need to use the two inner cables to send the sound back to the preamp. The outer screen is used as a Faraday shield and doesn't have to be connected to the circuit ground (and it can even create issues if it is). Ground (0 volts) is a reference. Any point in a circuit can be "ground" and in fact, at AC, both sides of a simple circuit look like ground. But since ground is a reference, in some cases the actual voltage between circuit ground and "earth" ground can be 1000s of volts. In cases like this differential signals completely isolate everything from that and each end (transmitter/receiver) can have its own idea of what "0 volts" is.
@mrtechie6810
@mrtechie6810 Жыл бұрын
Great! Now how would one change those pesky WiFi devices to use Ethernet? For example the Sonoff TH16. I need a remote smart thermostat on the building roof, and there is no WiFi AP there, so I would like to run a cable or use Ethernet over powerline.
@stompsalot
@stompsalot Жыл бұрын
this is so cool! thank you! subbed 😊
@SineLab
@SineLab Жыл бұрын
Thanks for subbing!
@timewave02012
@timewave02012 Жыл бұрын
On the software side, a lot of people have trouble grasping the concept of the HID report descriptor, and how it dictates the format of the HID reports, so that might be worth explaining if you're looking for topics. Canned driver/library code usually handles it poorly, with hardcoded report descriptors, and no obvious connection between the descriptor and the code that generates the reports.
@SineLab
@SineLab Жыл бұрын
Thanks, that's a good topic.
@mrkv4k
@mrkv4k Жыл бұрын
Great point. I'm building my own Joystick and this stuff gave me nightmares.
@timewave02012
@timewave02012 Жыл бұрын
@@mrkv4k Did you end up figuring it out?
@mrkv4k
@mrkv4k Жыл бұрын
@@timewave02012 Well, yes. After reading much of the USB documentation, going through some examples and a bit of try and error. I am using the PIC24FJ64GB004 uC and I managed to get it working with the Microchip Harmony example libarary, but I can't recommend it, because it's hard to extrapolate for an actuall application. I am building the mechanical part now, the electronic part is working and has a 32 possible button inputs and 7 analog channels (3-axis plus 4 sliders).
@gabrielphilips6980
@gabrielphilips6980 Жыл бұрын
Very good video, thank you for this.
@SineLab
@SineLab Жыл бұрын
You're welcome! :)
@RoamingAdhocrat
@RoamingAdhocrat Жыл бұрын
ooooh. this is relevant to my interests. subbed!!
@SineLab
@SineLab Жыл бұрын
Awesome, thank you!
@mr_noodler
@mr_noodler Жыл бұрын
Awesome video
@TheRailroad99
@TheRailroad99 2 ай бұрын
The hardware part was a great overview! The software one was a little too fast however. Just editing the callback does not explain at all how the stack works. (How to configure multiple/custom endpoints etc)
@dr_bobs_music
@dr_bobs_music 4 күн бұрын
I'm looking for a wireless USB extender, that is, one part acts like the male "A" end, the other acts like the female "A" end, and they connect by radio link. Neither the host nor the appliance know it's there. It would appear to be a cable, except the female/appliance end would supply the 5V power. Can you please point me to such a device?
@alexandru-cosminvintila6115
@alexandru-cosminvintila6115 Жыл бұрын
how about sending commands to a 3d printer via usb(the 3d printer has a ch340 that transforms usb data to serial for the 3d printer mcu)? Can this be a viable solution for sending, let's say G28 gcode command(go to home) to the 3d printer? Thank you,
@EStLouisAsassin
@EStLouisAsassin 5 ай бұрын
@SineLab Is it possible to convert an isa signal to usb? If not with this device,could you recommend a card that could accomplish this? Thanks !
@AleksandarRadev
@AleksandarRadev Жыл бұрын
Nice overview!
@SineLab
@SineLab Жыл бұрын
Thanks!
@ElectroWolf_Arts
@ElectroWolf_Arts 9 ай бұрын
the signal in 5:53 which one produces that pattern ?? the PC or the Device (keyboard for example) ?
@ncdave4life
@ncdave4life Жыл бұрын
Great tutorial! You should probably mention that you mean "USB 2.0" whenever you say "USB."
@nalinux
@nalinux Жыл бұрын
Very interesting, thanks.
@SineLab
@SineLab Жыл бұрын
Glad you enjoyed it!
@HuskyNET
@HuskyNET Жыл бұрын
I think you’ve mixed up NACK and STALL at 9:46. NACK means error and STALL means device busy.
@c1ph3rpunk
@c1ph3rpunk Жыл бұрын
Ben Eater has an excellent video on how the USB protocol works.
@raymondbyczko
@raymondbyczko Жыл бұрын
Thank you!
@SineLab
@SineLab Жыл бұрын
You're welcome!
@luisrey8986
@luisrey8986 Жыл бұрын
Excelente! 👍
@HenkvanHoek
@HenkvanHoek Жыл бұрын
I like the explanation a lot. Question, where did you get the smd adapter. I could not find it.
@SineLab
@SineLab Жыл бұрын
Here is a link to one on aliexpress: www.aliexpress.us/item/2251832624996364.html?spm=a2g0o.productlist.main.7.76c52ecbfcRb7K&algo_pvid=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c&algo_exp_id=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c-3&pdp_ext_f=%7B%22sku_id%22%3A%2264495190690%22%7D&pdp_npi=2%40dis%21USD%2111.8%219.91%21%21%21%21%21%40211bf12316751972869527289d06f4%2164495190690%21sea&curPageLogUid=S39oAQQcKzaA
@HenkvanHoek
@HenkvanHoek Жыл бұрын
@@SineLab ordered. Thanks!
@Guix555
@Guix555 Жыл бұрын
Thanks
@danielhildebrand7684
@danielhildebrand7684 Жыл бұрын
Thank you
@richpaul6806
@richpaul6806 Жыл бұрын
Im curious about that solderless adapter. Can you give some more information on where to buy something like that? Ive never seen one before.
@SineLab
@SineLab Жыл бұрын
Here's a link to one: www.aliexpress.us/item/2251832624996364.html?spm=a2g0o.productlist.main.7.76c52ecbfcRb7K&algo_pvid=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c&algo_exp_id=19f78b0c-252a-414f-99fe-3a8ca3f2ad5c-3&pdp_ext_f=%7B%22sku_id%22%3A%2264495190690%22%7D&pdp_npi=2%40dis%21USD%2111.8%219.91%21%21%21%21%21%40211bf12316751972869527289d06f4%2164495190690%21sea&curPageLogUid=S39oAQQcKzaA
@ShirishJadav162
@ShirishJadav162 Жыл бұрын
I want to make a small usb uart host such that I can connect some Arduino to its usb to collect serial data and store.. basically a usb serial data logger. Yes i can also log direct serial data but it's for a device that does not have gpio for seperate uart and sends data over usb serial. Any good suggestions ? Currently I do with raspberry pi but I want smaller simpler solution if possible.
@A_Canadian_In_Poland
@A_Canadian_In_Poland 4 ай бұрын
The Arduino board has a ATMega16U2 on it, pre-programmed as a USB to serial converter. Perhaps showing a project using it?
@SineLab
@SineLab 4 ай бұрын
That would make for an interesting project
@Umski
@Umski Жыл бұрын
About 20 years ago my 4th year project supervisor at uni casually suggested that I could implement a USB interface on an FPGA - needless to say it didn’t progress past a paper-based feasibility study 😂 I was following up to the J/K sync 🤯
@SineLab
@SineLab Жыл бұрын
What a project that could have been!
@EStLouisAsassin
@EStLouisAsassin 5 ай бұрын
@Sine Lab Is it possible to convert an isa signal to usb? If not with this device,could you recommend a card that could accomplish this? Thanks !
@SineLab
@SineLab 5 ай бұрын
I'm not sure what exactly you are referring to when you say an 'isa signal', but you should be able to write custom firmware to make it work.
@mayank8387
@mayank8387 Жыл бұрын
Thanks for sharing! :)
@SineLab
@SineLab Жыл бұрын
You're welcome! I'm glad you liked it! :)
@hesham1216
@hesham1216 Жыл бұрын
Can I use this circuit to add usb A to a mobile phone circuit?
@alexanderskusnov5119
@alexanderskusnov5119 22 күн бұрын
Small cable length?
@1billthekid
@1billthekid Жыл бұрын
I'm no electronics wiz, but since this would "supposedly" USBify everything, how easy would it be to add a USB port to an Amiga computer using your implementation? Would it mean utilizing the Amigas' serial port to do that? Thanks for the video!
@SineLab
@SineLab Жыл бұрын
Depends on what you plan on doing. If it is going to act as a device, then my method would work. If it needs to be a host, you should look for a micrcontroller with USB host capability.
@-AnyWho
@-AnyWho Жыл бұрын
i have a old led battery powered closet light that i never used cuz i don't buy batteries so i got a old usb cable cut one end off and soldered the black and red wire to the two main battery terminals and mounted it by my keyboard and plugged it in usb port on pc. now i have a night light for keyboard and it shuts off when i turn pc off ...
@joseakasoniq7577
@joseakasoniq7577 8 ай бұрын
One question. I have a pair of old CDJ´s (DENON DN-S3000) so they only work with CD and are able to read MP3 files. I was wondering if there is a possibility to hack this devices installing a USB Port instead of using CDs.
V-USB on an ATmega328! - V-USB and HID Explained
14:08
Sine Lab
Рет қаралды 42 М.
DIY Laser Projector - Built from an old hard drive
20:07
Ben Makes Everything
Рет қаралды 1,3 МЛН
1❤️
00:20
すしらーめん《りく》
Рет қаралды 32 МЛН
Sigma Girl Education #sigma #viral #comedy
00:16
CRAZY GREAPA
Рет қаралды 62 МЛН
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 125 М.
Extracting Firmware from Embedded Devices (SPI NOR Flash) ⚡
18:41
Flashback Team
Рет қаралды 519 М.
How does a USB keyboard work?
34:15
Ben Eater
Рет қаралды 3,2 МЛН
5 Ways To Generate A Sine Wave (Analog)
13:16
Sine Lab
Рет қаралды 77 М.
Hacker's Guide to UART Root Shells
17:40
Flashback Team
Рет қаралды 456 М.
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
Explaining USB: From 1.0 to USB4 V2.0
14:46
ExplainingComputers
Рет қаралды 359 М.
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,4 МЛН
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,5 МЛН
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 1,7 МЛН
Эволюция телефонов!
0:30
ТРЕНДИ ШОРТС
Рет қаралды 6 МЛН
The power button can never be pressed!!
0:57
Maker Y
Рет қаралды 53 МЛН