How to connect TX and RX on the ESP8266 to USB pins D- and D+ on the NXP LPC1769? - esp8266

I have a board (with NXP LPC1769) hosting an application and connected to the PC via USB cable. I use an application running on my PC and communication is pretty straightforward (some ASCII commands are exchanging) and working as it should be.
So, what I would like to achieve is to connect my favorite WIFI module ESP8266 using its TX/RX pins to the USB connector (D- and D+) of the NXP LPC1769 instead of my PC.
You may ask why you don't use any UART pins of the LPC1769. And my answer, I would love to. But it requires pretty much code modification which is not pleasant at this stage for me.
Pins P0.29 and P0.30 used from LPC1769 connected to USB connector.
Here is the existing schematic;
I would like to ask if this is even possible, and if possible, what are the options?
(I am inexperienced with NXP MCUs, still a work in progress, please bear with me).
Thank you.

NO my friend, it is simply not possible to connect USB serial to Rx/Tx pins of the ESP8266. First there is the hardware limitation, only asynchronous serial communication is possible with the ESP8266. That device has no USB host in it that can be programmed so there no way to do what you ask simply with that circuit. Nevertheless i would suggest implementing a simply board with a FTDI device of your choice (FT232R for example) and do the conversion from USB to asynchronous serial communication (Rx/Tx) directly.

Related

How to capture and send packets via Macbook

I want to capture and send some packets to the access point for testing purposes. I have the packet captures made via wireshark but I do not know how to proceed to be able to send these packets from my macbook.
I tried things like scapy, colasoft etc, but they do not seem to work as they require an external wifi adapter to be able to relay these packets outwards.
Two main questions:
Is it possible to send custom packets from macbook to a required access point. (Without using external network adapter).
If yes, what are some tooling/Scripting options that I can look at ? Any recommendations?
I am networking novice so please pardon me if the question is trivial. Thank you!
Your builtin Wifi adapter likely does not support Wifi injection.
You can check this by googling the Wifi chip that is within your computer (there are various methods to get that info depending on your OS) whether it supports Wifi injection or not.
So yeah, you'll likely need an external card (check the specs before buying it)

ESP8266 flush program after power lost

I program my ESP8266 with a Arduino Uno and this guidance: Programming the ESP8266 With the Arduino IDE in 3 Simple Steps
Wifi connect, Mqtt connect (subscribe, publish, callback) everything works fine and totally like expected.
But after I disconnect the power from the Arduino Board and reconnect to a another V3.3 power source, the ESP8266 behavior is like a complete clean flushed device and nothing happens.
For programming I use this settings (Arduino IDE 1.8.12):
What I am doing wrong here?
EDIT
1.) I try two different ESP8266, and 3 different scretches (1. proved working in the past, 2. simple blink sketch, 3. sketch with my code I need)
2.) the program stops immediately after disconnecting CH_PD from 3.3V
3.) I update the esp8266 board package to the newest version 2.6.3
The main issue here is my bad documentation. After a long time, I found the solution again here: Easiest ESP8266 Tutorial (Using arduino). Like the first time two years ago. In conclusion, I forgot to disconnect GPIO0 from GND after programming.
The correct way after programming is:
disconnect arduino
disconnect gpio0 from gnd
connect power to esp8266
Thanks to LiveSparks creating and uploading this great video.

how to connect nexys2 FPGA with camera? Driver issue

My project is to capture images and process them to move a wheelchair accordingly. I am using Nexys2 FPGA board for this purpose. Nexys2 has a usb port and the camera is also a usb camera. but i dont have the drivers in verilog which will make nexys2 and the camera communicate with each other. Please help me ill be very grateful.
Well, if you manage to write a driver for a USB camera in VErilog, you can sell that for a lot of money :)
Well, sarcasm aside, there is NO WAY you can access a USB camera in Verilog, unless you have a USB host implemented in your FPGA and have a CPU controlling it and have a SW driver for that camera.
There are alternatives to this, you can buy a camera which has an FPGA "friendly" connector like this one:
5 Mega Pixel Digital Camera Package
Which comes with the Verilog code that you can use in your project.
Sadly, the USB port on the Digilent Nexus 2 board does not have host capabilities, it can only act as a USB slave. The USB connection on the board is used for powering the board and configuring the FPGA and other onboard peripherals.
The newer Nexus 3 board has a second USB port however it has the same issue in that it can only act in slave mode. Also due to the configuration can only be used for mouse and keyboard input.

Need help using Arduino R3 as serial-to-usb converter (to program something)

I have researched (and learnt quite a bit), but I have little experience in programming and only really understand basic sketches so far. I would like to use the Arduino R3 (more specifically, the usb to serial converter chip) to program a full-size hobby radio.
I have connected my radio to the Arduino appropriately (5V, Rx, Tx, Gnd) and put the Arduino into Tristate mode (apparently you have to do this..), but I seem to be lacking appropriate drivers. I basically want my Arduino R3 to function exactly like this: CP2102 . Please note that I am not being super cheap. To get something like that where I live would take at the very least a month. Some people also say that I should remove the Atmega chip. The ultimate goal is that I have a device, with drivers, on a com port and not just an "unknown device".
So, my questions are: leave the Atmega on, or remove it? and which drivers do I need?
Thanks!
EDIT: I found almost exactly what I need just after I posted. For some reason I couldn't get it to work, but maybe you could help me understand? Here's the link LINK If anyone is keen to help me out!
Just to make it clear: it has been done before, but I get the feeling people leave out things which they think are obvious, but to the not-yet-professional tinkerer like me aren't :/
Thanks so much!
It seems like the links you reference are for older Arduinos with an FTDI chip. The Arduino Uno doesn't use that. Here's a link for using the Uno
So! All of the older Arduinos (NG, Diecimila and Duemilanove) have
used an FTDI chip (the FT232RL) to convert the TTL serial from the
Arduino chip (Atmel ATmega). This allows for printable debugging,
connecting to software like PureData/Max, Processing, Python, etc.
etc. It also allows updating the firmware via the serial bootloader.
The good news about the FT232RL has royalty-free drivers and pretty
much just works. The bad news is that it can -only- act as a
USB/Serial port. It can't act like a keyboard, mouse, disk drive, MIDI
device, etc.
and
The Arduino Uno has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega328
provides UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels
this serial communication over USB and appears as a virtual com port
to software on the computer. The '16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a
.inf file is required. The Arduino software includes a serial monitor
which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1).
Basically the LINK you provided, shows the user HACKING the Arduino. Using the USB/Serial(TTL) converter(what ever chip that is on your Arduino) to link to the Radio's Mini Din connector, in place of connecting to the Arduino's CPU.
As stated in other answer the Arduino uses a CHIP (of some flavor) to bridge the USB(Virtual Serial Port) to the Serial Port of the ATmega328 micro. These pins are available on the Shields connector 0(RX) and 1(TX). Hence you see the picture wiring those pins to the Radio's DIN connector.
Where I would expect in addition the RESET of the Arduino's CPU would be held to GND, this would force the pins into Hi. Simply with an extra wire jump the RESET pin to a GND.
It's working! Somewhere along the line the drivers for my arduino seem to have been deleted, so I reinstalled them, did what you said, and learnt something.
So to clarify for others: pretty much plug and play (as the link I posted suggests), but make sure to install the arduino drivers properly.
Thanks a lot for the help!

Writing Device Drivers for a Microcontroller(any)

I am very enthusiastic in writing device drivers for a microcontroller(like PIC, Atmel etc).
Since I am a newbie in this controller-coding-area I just want to know whether writing device drivers for controller is same as we write for linux( or any other OS) ?
Also can anyone suggest some online device driver building tutorial for the same ..?
Thanks,
If you are thinking about developing the device drivers to interface your device with a host computer (probably using USB), then most of the microcontrollers nowadays implement default classes that rely on native drivers.
A concrete example:
If you use a PIC18F4555, you can use the regular HID (human interface device) windows driver to communicate with your microcontroller (given you implemented it correctly). No need to develop any driver.
Writing a device driver for an MCU is a pretty far cry from writing it for a OS. Most MCUs won't have an OS running on them at all. You'll generally end up writing some low level Interrupt Service Routines (ISRs) and filling up buffers, that your application software will end up emptying. You don't have to fit into any device driver paradigm that an O/S has defined. You basically have to read the datasheet for the device you are wanting to interface with and read and write to its memory over whatever interface it might use (e.g. SPI, I2C, UART, etc.). Ultimately the device driver ought to provide intuitive function calls to the application software.
If you are using AVR MCU like atmega then you can use vusb (https://www.obdev.at/products/vusb/index.html) for those MCU that don't have any HID and handles the interrupts by connecting D+ and D- pins of the USB to digital I/O ports of the MCU.
The atmegaU2 packages have their own USB communication ports and HID.

Resources