Bit Bang FT232 to Control SPI Devices

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ •

  • @chrismartin8489
    @chrismartin8489 Рік тому +1

    Excellent video. This helped me understand a problem I was having writing software to control an 8-channel relay board using the FTDI chip. Even when disconnected I was getting responses as if the board was connected. Then I watched your video and figured it out: I have a USB to serial converter on my PC too!! I would have never figured this out without your video. Now, how can I NOT recognize the USB to Serial converter?

  • @videolabguy
    @videolabguy 3 роки тому +2

    Thank you. This was one of the first videos that did not bury me alive in excess complexity. For my upcoming project, I would like to have four 8 bit parallel ports. This could be two bidirectional 8 bit ports. Two ports, one for a 2 way data bus and the other a control and status port. I need to move many gigabytes of video data into and out of memory sims for a solid state video recorder project I have in mind. Not necessarily in real time. But, faster is better. Obviously.
    Think animation capture and video looping (up to almost two hours) of SD non compressed video. For my way of thinking this is WAY easier than serial data. I think the terms "serial and parallel: have become corrupted since my Z80/M68000 days of assembly language programming. Searches for "parallel ports" only turns up deep BS about Centronics printer ports! Geez!!!! I fell behind with so called high level languages which, to me anyway, are extremely complex to deal with. Especially direct IO functions. Yes, I am a pure hardware guy.
    Thanks again, your video has gotten my toe in the door.

  • @ArsenioDev
    @ArsenioDev 6 років тому +1

    Fantastic video, knew the FTDI could do this but never found a nice clear resource like this. Thanks!

    • @swharden
      @swharden  6 років тому +1

      Arsenio Dev I always wished there were a clear resource for how to do this, so I made one! Glad you found it useful

  • @MrIsrael3000
    @MrIsrael3000 Рік тому

    does it make sense to use this to check a regular magnetic door sensor? sending +5v to the sensor it will respond with +5v if is closed, I know it is not intended for that, can this damage the port? what is the disadvantage/risk in doing something like that, any alternative/recommendation?

  • @rudymisek6032
    @rudymisek6032 3 роки тому

    This is so cool!! Never thought of using a FTDI converter like this, posibilities are endless. Thank you for making this video :)

  • @SwapPartLLC
    @SwapPartLLC Рік тому

    I've spent 2 days trying to get one of these to program a PIC18. Still not working, but I think it's because of the erratic clock signal. Apparently the issue goes away if you use an external oscillator. I just happened to have a 12MHz oscillator, so I superglued it on the chip and connected it with some magnet wire. But, when I try changing the settings with FT Prog, it keeps reverting back to the internal oscillator. It turns out that the chip is a clone. No surprise there though. I ordered a couple genuine chips from DigiKey, and also an FT232H. On the bright side, at least now I know the crazy clock isn't my code.

    • @SwapPartLLC
      @SwapPartLLC Рік тому

      OK, so I can now confirm that the clock issue does not exist with authentic FTDI chips (FT232RNL) from Digikey. I paid $7.60 each for 2 modules, and then $15.87 (including shipping and tax) for the 2 authentic chips. That comes out to $15.53 each. For what it's worth, it's still cheaper than buying a module from FTDI.

  • @LuisPedroSoaresMarnotoGasparLo

    Do you think it is possible to do this using the cheaper CH340 chip? It has RTS and DTR signals, but I'm not sure It's possible to control RX and TX like you did, individually...

  • @steevek
    @steevek 5 років тому

    Dear sir, I noticed inside video that the FTDI USB-to-serial converter had a squarely external crystal (must be connected to the FT232R chip). But in the market some of the converters uses internal oscillator. And it could become permanently unusable when run with FT Prog! This warning message shown in the FDTI utility web page. If this is correct, anyway to around with the possible damage issue? Many Thanks

    • @swharden
      @swharden  5 років тому

      FTProg can be used to configure the oscillator source for the chip. If you use FTProg to configure your chip to require an external oscillator, and no external oscillator exists, your chip will obviously no longer function. This is why the warning exists, and the solution is simply to not do this. I'd feel safe using FTProg as long as I paid close attention to ensure the oscillator settings were always valid.

    • @steevek
      @steevek 5 років тому

      Scott Harden thank you for your advice and the video

  • @HacksterIo
    @HacksterIo 6 років тому +2

    Great video, Scott!

  • @monaemhossaintipu9257
    @monaemhossaintipu9257 5 років тому

    Can i use FT232 to connet USB keyboard with my ArduinoMega.Board:
    FT232RL FT232 FTDI USB To TTL 3.3V 5.5V Serial Adapter Module Board

    • @swharden
      @swharden  5 років тому

      unfortunately no, the FTDI chip just provides a serial port to devices which can accept USB devices. Your ArduinoMega could act like a USB keyboard to a computer, but you cannot plug a USB keyboard into an Arduino. It looks like Arduino can read the output of older PS/2 style keyboards!

  • @taranagnew436
    @taranagnew436 5 років тому

    what are the differences between visual studio and visual studio code and witch one is better for coding also what does $" do?

    • @swharden
      @swharden  5 років тому

      visual studio code is a fancy text editor that can be used to write in any programming language (C, HTML, Python, etc). Visual studio is more commonly used to write applications using Microsoft languages (C#, F#, visual basic, etc).

    • @taranagnew436
      @taranagnew436 5 років тому

      @@swharden ok thanks

  • @yunusemresarac1079
    @yunusemresarac1079 2 роки тому +1

    this video is very understandable, you explained it very well, thank you very much, it is a very good content

  • @avonfonds2567
    @avonfonds2567 3 роки тому

    Hello is there any chance I can do this with java with jssc lib thanks?

    • @swharden
      @swharden  3 роки тому

      It seems likely, but I'm not familiar with the modern Java libraries that interact with FTDI devices. The FTDI website may have documentation on this topic

  • @theartofflying3108
    @theartofflying3108 4 роки тому

    How to use it to make programing for servomechanism ??

  • @goofypettiger
    @goofypettiger 3 роки тому

    Excellent video. Thank you for releasing this.

  • @ichabodsescape1885
    @ichabodsescape1885 3 роки тому

    Thank You so much for this very clear video, It solved 90 percent of my problems. I just need the additional c# code to read a pin with a button. I can't find a clear answer on the ftdi site or the internet. Is it as simple as ftdi.Read (dataBuffer, 8, ref bytesRead): //? When I do this the console just flashes without a reading. THX again.

  • @WalterGreenIII
    @WalterGreenIII 4 роки тому

    Using a FDTI FT-232 to send data data and clock seemed very easy, looks like if I send data to a single by writing to it means I could possibly send NEC protocols using just the FTDI device. Logical '0' - in the NEC Protocol would be a 562.5µs pulse burst followed by a 562.5µs space, with a total transmit time of 1.125ms modulated at 38.222khz. Logical '1' - in the NEC Protocol would be a 562.5µs pulse burst followed by a 1.6875ms space, with a total transmit time of 2.25ms again modulated at 38.222khz. This would connect to a IR photo-transistor and IR LED, then again I could instead use a VS1838B Infrared receiver and the signal received by this device already demodulated. Otherwise a better choice for me is to send and receive the NEC signal as pure TTL level data. You see my stereo has jacks in the back for sending and receiving the NEC Protocols through either an external sensor, or by daisy chaining the components and have one of them act as a receiver for the other stereo components. In fact, my dual deck cassette has no IR receiver built in and relies solely on the receivers IR receiver.

    • @WalterGreenIII
      @WalterGreenIII 4 роки тому

      P.S. I forgot to mention... The NEC protocol sends a leader, then sends 32bits of data. Control Byte followed by it's inverse, Data Byte followed by it's inverse. When I say inverse I should say 1's compliment. And I believe it sends the data lsb first for each byte, Anyway, sounds simple, I also need to decode that protocol too, should be just as easy...

  • @aggibson74
    @aggibson74 5 років тому +1

    Nice video. Can you also bit-bang inputs so that I could read a SPI ADC?

    • @swharden
      @swharden  5 років тому +2

      Yes, but since bit-bang reads are slow you must make sure your device is sending data pretty slowly

  • @halilguvenc1323
    @halilguvenc1323 Місяць тому

    what a video. thank you bro

  • @dinagarantamilselvam5116
    @dinagarantamilselvam5116 6 місяців тому

    Thank you stranger !

  • @monkfoobar
    @monkfoobar Рік тому

    Labeling got the subscription

  • @-indeed8285
    @-indeed8285 2 роки тому

    20:10
    FT232H -> has better time chip
    FT232R -> does not have that.

  • @pow9606
    @pow9606 4 роки тому

    Nice tutorial. Don't understand what your trying to say at 19:14. "Looks really bad" means nothing to me. Don't understand it.

    • @swharden
      @swharden  4 роки тому

      Hi POW, the issue is that due to a FTDI clock bug, it cannot output square pulses. The problem is further described and demonstrated here: swharden.com/blog/2018-06-03-bit-bang-ftdi-usb-to-serial-converters-to-drive-spi-devices/#beware-of-the-ft232r-bit-bang-bug

  • @blakenorthrup
    @blakenorthrup 4 роки тому

    Sub'd. The electronics/programming world is so interesting, and I am about to start a few projects.

  • @friendlybear5924
    @friendlybear5924 5 років тому +1

    17:18 That must be painful to watch xD.

  • @wirechair
    @wirechair 6 років тому +2

    u are a genius

  • @shreeyatyagi
    @shreeyatyagi 6 років тому

    OMG!! love your website!!

  • @mr.horror3858
    @mr.horror3858 6 років тому

    you remind me of a teenage fred gwynn

  • @troymcdonald
    @troymcdonald Рік тому

    While I appreciate this, most people are going to do a GUI since that’s what most people are use to…

  • @choudharyom1
    @choudharyom1 3 роки тому

    fuck i am from future......

  • @gkdotclass
    @gkdotclass 6 років тому

    If you're going to use Saleae clones in public at least have the decency to not rip-off their livelihood by using cracked versions of their logic analyser software. You can use the open source Sigrok or, you know, just buy their hardware in the first place...
    Btw is that a FTDI fake chip too?

    • @swharden
      @swharden  6 років тому +1

      JM thanks for your concern!
      The topic of cheap eBay analyzers vs official hardware was discussed in the video and on the website post (which promotes purchasing official Saleae hardware and includes links to their product page).
      I was unaware of the open source software Sigrok, thanks for suggesting it!
      The integrity of the FTDI chip is unknown, and was a sourcing choice of whoever produced the breakout board.

    • @swharden
      @swharden  6 років тому +5

      I got an email from someone saying that the timing problem described at 19:00 is only a bug in genuine FTDI chps. It seems the chips I use in this video are indeed genuine, otherwise the big-banging would be working better!