nRF24L01: Serial monitor responds on interchanging CE and CSN - arduino

I connected the nRF24L01 pins with CE=pin 7 and CSN=Pin 8, exactly the way NRF Library documentation mentions.
On connecting to 3.3V, the serial monitor does not display any 'print' data command, but surprisingly it starts responding on interchanging 7 and 8 pins.
When I remove both CE and CSN connections from Arduino, the serial monitor shows some sends and receives.
I am confused why this happens, and why there is no response on serial monitor when I connect exactly the way documentation says.
please let me know if you need additional information.

there is lack of talent on this site. the answers are not upto the point, people post conflicting responses. I always have to post to other forums to confirm it. I have stopped using this forum.
half knowledge is dangerous thing.

Related

Arduino & ESP8266 - strange characters in response

I'm working on an Arduino Uno + ESP8266 project.
I try to use them as a web server on Wi-Fi network to control a motor that connects to Arduino - basically a trigger system that receives signals via Wi-Fi. Currently, I've successfully connected ESP8266 to my access point by sending AT commands from Arduino. Another client on the same network can statically access ESP8266's assigned IP address.
However, when I try to catch some HTTP queries (I want to use them as conditions to control the motor) I occasionally encountered the non-ASCII characters in HTTP request. I use serial comm to debug, please look at the screenshot in the link below:
Arduino - Computer serial communication for debugging
The line ",519:POST ..." should contain a complete number following "/?", but there's some strange characters instead. So I cannot determine the input data to control motor. Once in a blue moon, the expected format of request shows up as follows:
The correct data received
There's no issue with the HTTP response part, even though I got the uninterpretable request, I can still send the JSON error message back to client.
Attempt Note:
The Arduino uses different serial ports to talk to computer and ESP8266. Since the connection can be established, and the data being sent, I believe that the baud rate is simply correct on both side. (115200 for ESP8266, 9600 for computer - also tried 115200 for both and got the same result)
I use V3.3 from Arduino as power source for ESP8266. But I also use voltage regulator to smooth out the current as many people suggest that. The problem still remains.
I'm struggled with this issue for a few days, just want to know if anybody had the similar experience, or could give some clue for the next step.
After a considerable effort to stabilize the circuit, I switched to NodeMCU and got the system working perfectly. I assume that ESP8266 alone is somehow not robust enough without other components, which I unfortunately have no knowledge on.
So I'd like to close this thread with a short recommendation for anybody struggling with the same issue to switch to NodeMCU (which would replace both Arduino and ESP8266); if that could support the requirement.

Raspberry Pi and Arduino Mega 2560 UART behaviour difference

I've been trying to establish serial (UART) communication between a Raspberry Pi Model B Revision 2.0 (checked the model like described on this page) and Arduino Mega 2560. I made a service on the Pi that writes to UART and then expects a message and a coworker programmed the Arduino with an echo program. While they were communicating, I had trouble receiving data, meaning that it was clustered in 8 byte pieces and I had to introduce a timeout for waiting between them (I was actually as much as available and calling select()for the next cluster but it turned to be 8bytes a cluster, except for maybe the last one. As explained in a question I found on this site, the programmer is the one to take care of the protocol and can not rely that the whole message will be ready to read at once (that is logical).
However, when I just connected Pi's TXD and RXD pins, no matter how much bytes I tried sending, it sends them in one go (I've gone up to a bit more than 256, that's more than enough for my purposes). I also have around 50 milliseconds of duration difference, measured directly from within the program, using gettimeofday() function.
So, could anybody clear things for me:
Why is this happening?
Is this difference in behaviour expected?
Is there a potential problem in either of the devices (if that can even be concluded from the given information).
Of course, any additional information is welcome, in case I forgot asking something that is deemed important.
Why is this happening?
I tried some time back communicating Arduino-Arduino and Arduino-Pi. I faced some problems with UART communication. However, you might want to keep same Baud rate on both the devices. With Pi, you might need to trigger an event if you receive data from Arduino. On the other side, if you code runs longer, then you might lose some data i.e. your Arduino code is running something else while Pi sends data over UART.
Is this difference in behaviour expected?
Yes. Arduino is a microcontroller based device while Pi is microprocessor based (runs on OS)
Is there a potential problem in either of the devices (if that can even be concluded from the given information).
I don't think there could be any hardware problem unless it is not functioning at all.
Also, because of this issues, I switched from UART communication to SPI communication. This solved my problem completely.

ESP8266 Point to Point communication with 2 arduinos

I am using 2 esp8266 wireless modules to establish bidirectional wireless communication between 2 arduino boards (one mega and one uno) without the use of any earth based technologies (i.e. radio frequencies, wifi which relies on earth sattelites, etc.). My solution was to use the esp8266 to establish a private area network with both esp's acting as a station and an access point (AT+CIPMODE=3). Unfortunately, this solution has proven to be more of a hassle than it was worth.
To start, I have the esp's each wired according to this diagram
When I first started out, the red LED was on and the blue LED was off. During this time, I was able to send AT commands, establish the server, and achieve the communication I required by entering commands directly to the serial monitor. After this, I started writing a library using the SoftwareSerial library to allow me to issue commands directly through the program to set up the esp as needed upon start up of my script. Before doing this, I changed the baudrate to make sure it was running at 9600, and entered the AT commands in the serial monitor to make sure everything was working properly and it still worked.
After I began writing the library, before uploading the code with a test of the library I noticed the blue LED was lit solid now. Noticing this, I reuploaded the barebones script (I haven't uploaded the library code to the arduino yet) and the esp was no longer receiving the AT commands.
Does this indicate an issue with the board which I can fix or does this mean the board is done?
With my deadlines approaching fast in about 3 weeks it is crucial I get this wireless communication working so if this is an issue with the board, I'm going to have to scrap the esp's and use a different way of communicating. So my second question is, if this is the case, what are other viable options for establishing this communication? I have used xbee's before and while that would be ideal, they fall out of the budget I have been alotted so I need to keep it under $50 for this. If bidirectional communication is not possible for that price I can live with one way because I just need to get this system working. Basically I just need to transmit a single byte of data.
I realize this response is a little belated, and I hope you got it sorted: I've started working with the ESP8266 myself in the last few weeks, and hence why I was looking around for tutorials on direct communication between 2 units, when I found your post.
From what I've been able to ascertain, the AT commands are a part of the 'firmware' which ships with some modules. The Arduino code however starts loading onto the chips at memory address 0x0000, which is the same address that the firmware update tools use.
In other words, I believe that with the Arduino-coded program running on there, you lose the AT command functionality.
If you find a firmware update tool for the ESP8266 (plenty online) you'll get back the AT commands.
I suppose though the real question is why would you want to? It seems that the AT commands are just a way to treat the ESP as a dumb WiFi antenna. With the Arduino code, you're actually treating it as a micro-controller in its own right.

Serial Output to Arduino LED Display

I recently completed this project with my Arduino (a fairly new hobby for me):
http://www.instructables.com/id/Make-a-24X6-LED-matrix/?ALLSTEPS
I can change the code to make whatever messages I want scroll accross the matrix but I thought it might be cool to have live information, like stock quotes, scroll accross. I think I could figure out how to do that except I would like to use it at work where there are lots of firewalls in place and I doubt Arduino software is on the approved list of programs. Is it possible to send messages to the Arduino through a USB without installing any drivers?
No it is impossible because data in Arduino is sent via serial command, the USB is only for convenience, but arduino work with FTD driver that emulate a serial connection. You should choose another type of connection bluetooth or wifi.
Hope this help you.

Error message in AVR studio4

I have recently purchased an AVR USB programmer from robokits.co.in, was trying to program atmeg8 using AVR studio4 and I get the following when I click on the program options:
a problem occurred when executing the command. make sure u are using
the correct programming method. current mode is ISP verify that the
device is placed in the correct socket, and that the ISP cable is
connected properly.check that the programming frequency specified in
the main page is well below 1/4th of the clock frequency of the
device.
I have tried all that I could think of, I have checked the connections and the freq is below 1/4th of the device.
But that doesn't solve this problem.
I have made the circuit for blinking LEDs program.
See the image for details
Double check that the jumpers on the programming board that you are using (if you are) are set correctly.
Well this is hardly the venue to trouble shoot different hardware issues.
So if you think there is an issue with the programmer, contact www.robokits.com.
I would start with contacting robokits.
Since you can't even enter the programming mode, you can ignore your source code.
You should be able to verify fuses/lock bits w/o programming any code into the Mega8.
To give you a head start before you contact robokits:
1. Verify the programmer is properly installed on your computer following robokits instructions.
2. Verify the +5Vdc on Pins 20 & 7 of the Mega8
3. Verify Pins 22 & 8 are grounded properly.
4. Verify that Pin 1 is pulled up to +5Vdc (when the programmer is not connected)
Pin 1 should be pulled down by the programmer when it attempts to connect to the Mega8
5. Double check all the connections between the programmer to your target. Since the programmer is a 10 pin IDC and the test circuit has an in-line style connector you must have an IDC cable that has been broken out, stripped and connected to the test circuit.
Is the Target "fresh"? i.e. Never been programmed? Regardless: have you tried more than one?
Do you have any power being applied to the ISP header (target) prior to connecting the programmer?
You may also want to verify there are no shorts on your Target pulling the ISP Supply down, see the pinout link below.
If your jumper settings are USB-HID and Slow SCK == open && ISP Supply == short then you shouldn't supply and power to the ISP connection from the target.
If you are not supplying and voltage to the ISP header, maybe you should try that. Remove the ISP Supply jumper and apply 5V from your target application's supply to the ISP interface:
AVR ISP Pinout
Pin 2 on the ISP interface should be +5Vdc in reference to Pin 10 (gnd)
When I got a similar message while programming other Atmel integrated circuits I enabled the "Use external reset" setting that exists in the GUI of AVR Studio 4 (was removed in 5 and returned in Atmel Studio 6).
I am not sure if that option exists or does anything with your programmer since I have never used it.

Resources