ALTERA UART communication - uart

I would like to use the Altera DE1_soc board to make serial communications from my PC to teratem.
JTAG uart intel FPGA IP seems to be available only on internal NIOS console instead of terterm.
I do not know which JTAG and UART to choose from the platform designer.
I would like to get help if you know.

Related

Emulate CP210x USB-FTDI chip using SAMD21

The dev boards for the ESP32 family of MCU use CP210x (or similar) "FTDI" chips to communicate with the MCU when flashing. CP210x presents a COM port to the host computer which runs esptool.py, a script which implements the Esressif communication protocol. Rather then use a CP210x, I would like to utilize a SAMD21 in its place.
I have managed to receive logs from my ESP32, to a serial monitor on my computer, via the SAMD21, over USB. The SAMD21 connects to the ESP32 via UART, with the standard ESP configuration of 115200 8N1. I can manually enter bootloader mode by holding the correct pins low at boot, and I get the log back confirming the correct bootloader mode.
When I run esptool.py, however, the connection fails, and I get a timeout. Likewise the esptool "monitor" fails to acknowledge the same logs which my terminal emulator easily detects.
What is the communication protocol between the host computer running esptool.py, the CP210x FTDI chip, and the ESP32, and how can I emulate the CP210x with a SAMD21? The definition of "FTDI", "TTL" and "RS232" are all a bit fuzzy, as far as I can determine with research online, so if anyone has experience in this arena, I would be very curious to hear your advice.
The code I have on my SAMD21 is just:
#include <Arduino.h>
void setup()
{
Serial.begin(115200);
Serial1.begin(115200);
}
void loop()
{
if(Serial.available())
{
Serial1.write(Serial.read());
}
if(Serial1.available())
{
Serial.write(Serial1.read());
}
}
Where Serial1 is the UART and Serial is the USB Serial connection.
esptool.py expects a serial port (known as COM port on Windows) to communicate with the ESP32. It doesn't care if the computer has an old-style serial port, is using a USB-to-serial bridge with a proprietary protocol (FTDI, CP210x and the like) or is using the standardized UBS protocol for serial communication (USB CDC ACM). This is left to the operating system and the installed drivers.
However, esptool.py modifies the baud rate and uses the RTS and DTR signals to reset the ESP32. It is also rather susceptible to timing issues with regards to the reset. If you set the ESP32 in boot mode manually, you should be able to get away without these.
However, the most likely cause is that the Arduino CDC implementation does not implement flow control. If esptool.py sends more data than fit into the internal buffer, it is likely discarded, instead of sending a NAK back so the host computer can retry later.
I don't fully understand the SAMD21 Arduino core to verify it. If so, I don't see how you can make it work with an Arduino program. You would need to resort to some other framework for programming the SAMD21.
Update
After more tests, it turns out the USB CDC implementation of the SAMD21 Arduino core correctly implements flow control. So no data will be lost.
In fact, I was able to successfully upload code to an ESP32 module. The setup was:
Arduino code built with PlatformIO. Instead of Serial, I've used SerialUSB as I'm unsure how to control the project settings available in the regular Arduino IDE.
For the ESP32, I've used a ESP32-WROOM-32 module on a minimal board (reset and boot button, 2 pull-up resistors).
I've connected the board via GND, 3.3V, TX, RX directly to the SAMD21 dev board.
I've verified that I can see the ESP32 log output in normal run mode and the "waiting for download" prompt in bootloader mode (after pressing BOOT and RESET).
Arduino has multiple boards where the esp32 is on-board as WiFi adapter. To flash the esp32, there is a tool sketch called SerialNINAPassthrough in examples of the WiFi library, which should be uploaded into the main MCU of the board (SAMD21 on two of the official boards).
The SerialNINAPassthrough sketch handles the DTR and RTS signals sent by the esptool to reset the board into the flashing mode.

what is nRF UART and what all I need to implement an nrf UART app on NRF52 DK?

I have an nrf52 board I was able to connect to board via USB. I downloaded a hardware profile to check the functionality and the device acted like a BLE and I was able to communicate with it. But someone said to implement UART on the device now i am clueless about what this is?
there is this nordic toolbox which has UART example but my board won't connect to this why is that?
I wish this NRFtoolbox UART connects to my board how is that achievable?
it will not connect using standard configuration because in this mode it uses pin 5/6 for tx/rx as i remember, and these pins are connected to internal modem, you can not exchange data on these pins. I would suggest to use pins 2/3 for tx/rx.

Connecting multiple usb peripherals to a FPGA

I want to connect a USB peripherals to a FPGA. Basically FPGA should act like an USB host. Is there a FPGA board support a USB hub so that one could connect multiple(upto 4) USB peripherals at a time.
I have a Digilent Nexys3 fpga which is based on Spartan 6. It supports only one USB device (keyboard or mouse). It doesn't support a hub. I have found Cypress host controllers, but I am not sure how to use it in a FPGA.
You need to have a USB host controller inside your FPGA, such IP is not freely available, one alternative is to use a Zynq based (for Xilinx) or Cyclone V based (for Altera) board. Those have integrated USB controllers connected to their dual ARM core.
You can find more info about those at:
Altera Cyclone V
Xilinx Zynq
You maybe able to use an external host controller but then you have to connect it to your FPGA and that is usually requires a lot of IOs and those modules are more expensive than buying a Zed board ($395) or Cyclone V board ($450).

Arduino: Application communication over built in USB?

The Arduino Nano (and other models) has a USB Connector on the pcb.
Can a Arduino Application (Code inside the loop() Function) communicate to a PC/Mac over the built in USB Channel?
The board at the link you posted uses an FTDI USB to UART chip; the ATMega168 itself has no USB controller. The UART side of the FTDI chip is attached to the ATMega168's RXD/TXD UART pins. So from the point of view of the Arduino code, you are just communicating with a UART driven serial port.
From the PC end, the FTDI chip uses the USBSER.SYS driver to emulate a legacy UART serial port (A Virtual COM Port or VCP). You will be able to see this and which COM port it has been assigned to in Device Manager.
So in essence all you need to know is how to do serial port programming on both the PC and the Arduino and you are good to go.
This is how I have done it. You also need to write a program to your computer - for POSIX-compilant OSes, this one could help you out.

Controlling MSP430 with computer (USB?)

I'm looking to control a bunch of LEDs from my computer, with a TI MSP430 or similar.
My computer is a Macbook Air, and so it looks like the only port I can communicate with is USB. The MSP430 has a USB port, but I can't find any information about using the USB port for anything besides programming the chip. Is there a way around this, to use USB to communicate with the board?
Thanks!
If you are using one of the processors with built in USB hardware then you should look at this Texas Instruments Page which describes the capabilities of the MSP USB. It includes links to the USB software stack that you will need to implement an HID class device.
I see two more options here. You can also use:
a) USB <-> LPT adapter to control the LEDs directly — in this case the schematics are extremely simple. See how it's done;
b) USB <-> COM or USB <-> RS232 adapter to communicate with the controller via RS232 — in this case you'll have to implement some simple protocol for communication with the controller, but the whole solution would still be much simpler than the one with USB.
The MSP430 Series 5 and Series 6 micro controllers (i.e. MSP430x6xx and MSP430x5xx) have built in USB modules that allow communication from PC and could be used to control the MSP430 via USB. Download the MSP430 USB Developers package here: http://www.ti.com/tool/msp430usbdevpack and use the USB CDC or HID API stacks to develop an application as per your requirements. In case you are using CDC(COM port) you may use a Terminal program to send the commands to control LEDs or if you use the HID stack, you may use the hidDemo PC software included in the Developers package to send/receive commands.