I am using ESP8266 (NODEMCU 3.0 or something) to make a quadcopter. Ive connected ardu pro mini to RC receiver so I am reading PPM values from it. Pro mini sends data with tx to ESP8266. ESP reads it with software serial with 115200 baudrate. I am communicating with MPU9255 (Waveshire) via I2C either.
My problem is that I cant fully controll my brushless motors. When I was using arduino instead of ESP8266, servo library was the best and reliable. But ESP's servo library is different, since its not AVR, and problems occurs. First of the servo library didnt want to work on most frequencies. I mean default is 50Hz (20000uS) and in this state ESC of motors did armed but unfortunatelly when changes was fast and short (1250-> 1370 -> 1250) it did miss that change like nothing happnd... This makes my D value in PID controller useless...
Sometimes on 100Hz freq all was working fine, but sometimes not...
When Ive started to use analogWrite only 500Hz was working fine, rest of freq didnt want to arm ESCs.
PS. I am using 3.3V to 5V converter for PPM/PWM pins so I am sure that the signal is fine for ESCs.
PS2. I dont have any osciloscope unfortunately.
The ESP82266 present on your module is a RF transceiver integrated circuit that can handle WiFi communication, both configured as a slave to a microcontroller such as the ones present on various Arduino boards, or as a standalone chip by having it's on-board Tensilica L106 32-bit processor programmed via an external SPI flash memory. If used as a slave, the communication between, for example, an Arduino an the ESP82266 can be done using different protocols such as SPI / SDIO or I2C / UART interfaces. Googling a comprehensive Tensilica L106 user guide on the internet doesn't seem an easy task, and it looks as if some people have already failed to find it. If you're seeking to add Wi-Fi capabilities to your quadcopter the solution I suggest is having the Arduino take control over the servos, motors, etc. and hand off messages via SPI to your ESP82266 module. If this isn't the answer you are looking for, please try to be clearer about it, maybe find someone to do as an English translator for you.
However, if this is what you're concerned about, and you would like to use the ESP82266 module as as standalone solution, please link its built-in processor datasheet and the relevant parts of the quadcopters code that might need debugging.
Related
I have designed a custom board using atmega32u4 with a few other components (Such as RTC, memory and etc) but left them empty to test if the microcontroller can be programmed. After just hand soldering the microcontroller and the necessary capacitors and resistors, ATMEL Studio can't read device signature.I'm using AVRISP MKII. This board was inspired by ARDUINO ProMicro in design. The things I tried to solve it:
Measure all 3.3 volt supply lines and all of the grounds. (They all correspond with PCB and schematic)
Checked SPI lines to see if microcontroller receives commands from the programmer by using oscilloscope.
I tried removing the 16MHZ crystal, still the same.
I reflowed the microcontroller since it is a QFN type (atmega32-MU package) and I have a few via holes under the micro for flux to come out.
I have properly washed the board after reflow.
I have AREF grounded with a 0.1uF capacitor and !HWB pin (PE7) is left empty. I didn't ground it.
I tested the programmer with an actual promicro board and it programs fine.
I think I'm missing something but I don't know what... I'd be grateful if you guys could help me. Attached is the schematic of the circuit.
The micro controller RESET is indicated by MICRO RST on pin 13. That RESET on PB4 is for another device which is not populated yet and left empty, I checked Pin 13 with Oscilloscope and it seemed working fine and going to zero at the first moment of programming. Also MISO and MOSI and SCK were sending signals to the relevant pins.
Thanks
If you are programming the board with ISP you have to connect RESET to the programmer. otherwise the controller could not be programmed!
Image from microcontroller.net
It seems that your RESET is on PB4 but for programming it should be connected to RESET of uC.
So, I realized the problem after almost a month! I had removed the 16MHz crystal from the circuit and this caused the problem with programming. Now, after placing the crystal the program is successfully uploaded to the ATMEGA32U4.
I am building a device and need to use a USB Nordic ID rfid reader. I have a Spark-fun USB host card (V9947), and now need the firmware to allow be bi directional chat in a 'rs232' style serial... just as if it were a hardware or software serial port on the Arduino.
Nordic support have reassured me that their library and examples for the Arduino are normally used with readers with RS232 ports, however the same code will work with their smaller USB device if I can overcome the USB/serial barrier.
I have the library and examples for the USB host board, but cannot determine which example code resembles my requirement requirement, I have looked through the library and found no answer there either.
This could be down to personal stupidity/ignorance... however never been this stumped before. the internet does not seem to have an answer, documentation and support for this board are at best meager.
I hope someone here has managed to solve what should be a simple mission, and I can get on with this project.
Thanks Ian
As not knowing what you already have done, I'll make a walk through the complete setup. Please check(do) each point evenif you think its done already:
Soldering and hardware have no shorts
pin headers of the shield are soldered with no shorts
USB Jack of Arduino is isolated on the top to prevent shorts
With the SparkFun board, it seems like you MUST supply external power on Vin or the barrel jack. 5V from the USB cable will not work reliable.
You must also run a jumper from pin D7 to RESET.
For the board (SparkFun DEV-09947) set up – these are mandatory pre-requirements.Now the software
The code/drivers you need to use for this board are on this GitHub page.
There is a diagnostic test which is extremely useful for checking wether your board is working correctly. Do as follows:
Upload this sketch to your Arduino, then open the Serial Monitor to see the diagnostic info.
To see the output set your Serial Monitor terminal speed to 115200
Plug in your hardware into the USB of the shield
Reset the Arduino to start the diagnostic
Step 1 – you’ll see it recognize the board and start a transfer test
Step 2 – you’ll see it attempt to test the GPIO pins – you’ll get “GPIO test failed” message. Type something in the box at the top of the Serial Monitor, then hit “Send” button and the diagnostic test will continue.
Step 3 – you should see it cycle through a bunch of resets, then it will attempt to detect an USB device – as we have a device plugged into the USB port on the shield you should then see some summary info with a final message of “All tests passed”
So NOW we know the hardware is working and basic software is running.
Next step driver installation/test program for the Nordic
Get the library from here
Import NurMicroApi_arduino.zip to IDE. From menu: Sketch->Include library->Add .ZIP library...
Open example. From menu: File->Examples->NurMicroApi->NurExample
Change baudrates and sw serial pins to match your arduino HW In this example NUR module is connected to arduino via software serial pin 10 (RX) and pin 11 (TX) with baudrate 38400. HW serial is used as print output.
You may have to change this to the USB card connections (see diag-SW)
As an easier option you can use the HID parser to check if your NUR is recognized If that works take a working exmple like:
Working HID example and try to read a tag then start coding with the NUR example from above if values are not correct interpreted
If you want to use the "pure" at-Terminal (RS-232) style you have to get rid of the usb shields functions (lib) and write your own Arduino firmware based (=overcome the USB/serial barrier) on the nordic-api (well documented) Hope this gets you started
I would like to use the Arduino sensor in raspberry pi.
Since the sample file for the sensor is dedicated to the Arduino, the example header file is also dedicated to Arduino.
The example code uses the spi.h file. Can I download the header file and use it in Raspberry Pi?
That wouldn't make sense for various reasons and it wouldn't work for various reasons.
SPI is a serial interface. You don't need Arudino code to communicate via SPI on Raspberry PI. There are many examples on how to do that on Raspberry PI.
The sensor doesn't need an arduino. All it needs is power and someone to talk to.
The fact that you ask this question shows that you should invest time into learning C/C++ and get some basic knowledge about microcontrollers and serial interfaces.
If you're lost in an unknown jungle it won't help you to bring a map from another unknown jungle... So what do you have to do? Learn about jungles in general and some day you'll be able to survive in most of them.
I have successfully running push buttons and analog sticks working on a board of mine through the serial connection via the Arduino IDE. How do I get that data to work with Xinput?
I have my own emulation software that works in Xinput beyond that. I just need to get the gamepad device xinput support. What are the neccessary steps to get this working with a driver and how I can get this up in running in the least amount of timing possible without having to edit someone else's driver too much?
You can turning an Arduino Leonardo into a joystick, use a teensy board and the teensy joystick library, use a HID-compatible bluetooth chip (such as RN-42 HID or something similar) with a joystick/gamepad profile or just remove a controller's existing joystick parts and replace with your components.
I am developing a project to monitor solar voltage and battery voltage by displaying them on an LCD. I programmed an Atmega8 with an arduino. When I attached the LCD with the board it worked pretty well. So I detached it from board and made a breadboard circuit as described on this page.
It didn't work this time. I checked all the connections many times but could not get to any point. Kindly guide me how to make a standalone atmega8 circuit to display something on an LCD.
Start slowly. There are some pitfalls when migrating to your own design (and yes, there's another forum for that). If you're using an external crystal oscillator, make sure that you've programmed the Atmel chip to use it by programming the appropriate fuse bits. After that, look to see if you can toggle a single output of the device. Ideally with a single LED connected, so you can see if the output port is changing state.
Some LCD controllers can require relatively precise timings, so if you have a logic analyser you can examine the waveforms. Otherwise, check your clock timing by turning on and off an LED every ten seconds (or so) and use a stopwatch to count ten or twenty of the LED flashes. You can see what your clock speed is working out to be, and verify that it's the right clock, etc.
You need to program the fuses correectly for standalone operation when no crystal is attached (Arduino has an external crystal) Hence, for running an Atmel using the internal clock, the clock fuse needs to be programmed correctly. In the datasheet you will find the description.