Asked
Resolved Resolved by DJ Sures!

USB Connection To EZB V4

OK guys I have another question for everyone can you use the UART on the EZB V4 to connect to a USB rather than the camera port?

I want to hardwire my EZB's to my onboard PC but I also want to use my ez-robot camera with one of my EZB V4.


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

#17  

Ok I have created the cables and been able to make them work on my EZB V4's with my LattePanda using the USB/TTL's but my IoTiny will not work. When I connect to it over wifi and go to its web config page there is no option for USB connectivity like there is with the EZB4's. Is this normal?

PRO
Synthiam
#18   — Edited

The IoTiny does not have USB capability. I believe it's because the TX pin on the IoTiny's micro is used for communicating with the audio DAC converter.

You could use an Arduino micro if you need a small form factor - and they're only a few dollars each and have USB connectivity.

#19  

OK Thanks for clearing that up for me my I just wanted to make sure I was not doing anything wrong.  I was planning to use the IoTiny's in the arms of my Inmoov projected but I guess that is not going to help.  I am open to any recommendations you may have on that.

PRO
Canada
#20  

I had a thought about the camera being connected to a UART to TTL USB adapter. The camera communicates at 3.3Mbaud, most USB-TTL chips don’t run that fast. The FTDI chip is the fastest at 3.1Mbaud.

I also wanted to mention that when using a UART-TTL adapter with the camera you’ll still need 3.3V to power the camera.

The camera needs 60-80mA for power and while the FTDI chip does supply 3.3V with its internal regulator, it’s limited to providing only 50mA. So a external 3.3V regulator would likely need to be connected to the USB 5V.

I purchased some FTDI FT232RL based USB-TTL adapters and received them today. I’ll do my best to test them out with a camera today/tonight.

#21  

Quote:

I purchased some FTDI FT232RL based USB-TTL adapters and received them today. I’ll do my best to test them out with a camera today/tonight.
Jeremie,  please let me know if you get this working.  If you do get it working please provide all the details because I really need this solution.  I know when you are hooking up the EZB4 to the USB/TTL you to set the baud rate to like 230400 or something I don't know if that would need to be the same for the camera.

PRO
Synthiam
#22   — Edited

The camera RTS and CTS pins are...

Quote:

SetIODirection(GPIOA, GPIO_Pin_11, GPIO_Mode_AF, GPIO_PuPd_DOWN); // CTS GPIO_A11 SetIODirection(GPIOA, GPIO_Pin_12, GPIO_Mode_AF, GPIO_PuPd_DOWN); // RTS GPIO_A12

The IoTiny EZB RTS pin is 

Quote:

[UART_2_RTS] = { GPIOA, 1 }, // CAMERA software RTS GPIO_A1

The EZB RTS pin is

Quote:

[UART_2_RTS] = { GPIOA, 1 }, // software RTS GPIO_A1

When the EZB/IoTiny lowers RTS, the camera can send. That means you'll have to hold either RTS low or use the flow control on the UART USB adapter. I would hold it low because there's enough buffer on the PC that it won't matter.

You can see how the EZB lowers and raises the RTS gate for data...


    MicoGpioOutputLow(UART_2_RTS); // open the gate
        
    uint8_t cntr = 0;
    while ((UART_CAMERA_BUFFER_LENGTH - DMA_GetCurrDataCounter(DMA1_Stream5)) < context->flashContentInRam.micoSystemConfig.ezb_cameraOnePacketSize) {
    
      mico_thread_msleep(10);
      
      cntr++;

      if (cntr > 50)
        goto EXIT;
    }

    MicoGpioOutputHigh(UART_2_RTS); // close the gate


#23  

DJ,  I am sorry but I am not following your comment.  Are you saying you can use a UART on the IoTiny to connect the camera to?   Because I this time I am just looking for a way to connect it to the LattePanda USB port and make it work.  I still have not been able to make that work.  My TTL's seem to work with the SCB and EZB4's but when I hook the camera up like you a pointed out it does not seem to work the Device Manage says everything is work ARC sees the com port but the camera skill does not work with it.  Maybe I am doing something wrong.

PRO
Synthiam
#24   — Edited

You can connect any of the EZ-Robot cameras to the iotiny. There's a camera port on the IoTiny to connect their cameras. If that's all you need, connect the camera to the IoTiny. The information I provided above is to help identify the RTS lines to ensure that isn't trouble during your and Jeremie's hack attempts with the EZ-Robot camera.

But you're also asking about connecting the camera to UART on a PC.  To clarify... Do you want the camera connected to the IoTiny or the PC directly? Because EZ-Robot cameras were made to directly connect to their EZBs (IoTiny and EZB v4). If that's all that is needed, then it's good to go.

If the camera needs to be connected to the PC USB and not the IoTiny, the information I provided above will help. Realistically, since the challenge is not being able to hack something outside of its intended purpose, I'd buy a $10 USB camera from Amazon and call it a day, lol.:)