Modbus rtu slave is not responding to modbus rtu master - c

https://code.google.com/p/stm32modbus/source/browse/#svn%2Ftrunk%2F%20stm32modbus%20--username%20ickingdom%40gmail.com%253Fstate%253Dclosed
I am using this program.I debug and compile it successfully no error i got then i burn it into my prototype slave which has stm32f103c6 microcontroller. Then with help of docklight software i send request to my salve but its not responding. What should i do?
I set baud rate of master and slave same so that is not the issue.
I was thinking like may be program has some error but i didn't get it. So please help me to find any missing thing in this program which i have downloaded from google code which link i have shown above.Is there any alternative that you want to suggest then please suggest me.

Try to remove the CRC request on input data and then try communicating via docklight, please be sure that the CRC module of the code is working properly.

Related

Sending AT commands over UART

My problem is sending AT commands over UART. I am working with STM32 IDE. I have the hardware: STM32L476 with a sensor shield together with the ESP01 Wifi module.
I got the hardware to work and can already send the first AT command over Uart to ESP01. When I try other commands AT+RST or AT+GMR I don't get any response back.
I use this code to send over UART to ESP01.
void ATsend (char out[]){
HAL_UART_Transmit(&huart4, (uint8_t *)out, strlen(out), 1000);
}
The code below works fine
ATsend("AT");
I get the response OK.
When I try this I get no response.
ATsend("AT+RST")
Any tips?
If you are sure that your UART receiver, or your DCE in RS-232 notation, supports the commands you're sending, this guide might be helpful:
https://docs.espressif.com/projects/esp-at/en/latest/esp32/faq.html#when-the-host-mcu-sends-an-at-command-to-the-esp32-device-there-is-no-response-what-is-the-reason.
The guide indicates as a possible solution also for the ESP8266 products the following: <<When the host MCU sends an AT command to the ESP32 device, there is no response. What is the reason?
A terminator (“ATrn”) must be added after an AT command when the host MCU sending AT commands to an ESP32 device. Please see Check Whether AT Works.>>
There's also this link: https://docs.espressif.com/projects/esp-at/en/latest/esp32/Get_Started/Downloading_guide.html#check-whether-at-works.
I hope these suggestions can solve your problem. At least they can indicate to you if the device is working.
There might be other causes of malfunction, but in this case I need more information to help you solve them and I suggest that you write to my company for professional support.
Yours sincerely,
V.D.

Saleae Logic Analyser not working with SPI Receive

I am using the STM32F5 Discovery board to connect with an accelerometer using a breadboard. I connect the Saleae Logic Analyser to the bread board to the MISO, MOSI, CS, VCC, CLK and ground of the sensor.
First I try monitoring the SPI Transmit function only. It is successful and I am able to see the response. Now when I add a new line of code of SPI Receive to the existing code, I am unable to see anything on the logic analyser. I tried checking the status of the SPI Received variable in the KEIL watch window, and nothing is appearing.
Now when I disconnect the Logic Analyser and if I observe the data from the watch window, it is working fine.
I think there is some interfence between the logic analyser hardware and the Discovery Board/Sensor Hardware.
Has anyone else faced a similar situation earlier? Please let me know the solution to this.
Thanks in advance.

How to solve this issue "chip enable program error"

We are using progisp software to program a microcontroller AT89S52. We are struggeling with an issue saying
chip enable program error
Please help us to tackle this issue? What does it mean?
According to https://alselectro.wordpress.com/2019/03/30/usbasp-solution-to-chip-enable-error-firmware-upgrade/ it might just be a physical connectivity issue (or the wrong chip:
CHIP ENABLE error occurs if the IC is not placed correctly on ZIF socket of development board or if the wrong Chip is selected.
Did you checked all the things which are described in this documentation https://www.academia.edu/8278452/How_to_solve_chip_enable_program_error_in_progisp?
Check if the
USBasp
driver is properly installed (update it from settings).
Recheck the jumpers. Change them if they are weakly connected.
Try to change the port, sometimes some ports can malfunction (ex. from port 1 to port 0).
Press reset button for 10 seconds.
Try to erase current program from
progisp
compiler, and load flash of hex file again
Or here: http://www.mbeddedc.com/2015/03/how-to-solve-chip-enable-error-in.html
Reason for Chip enable error in progisp:
1) Main reason for this error could be wrong connections.
This can be solved by checking the connection between Serial ISP Programmer and Micro-controller. Many times Gnd,Vcc,Sck,MISO,MOSI,RST connection does not match with each other. This should be given properly by Gnd-Gnd, Vcc-Vcc, Sck-Sck, MISO-MISO, MOSI-MOSI, RST-RST.
2) Check whether the power to the ISP Programmer and micro-controller are correctly supplied.
It pretends to solve the issue.

Problem while uploading code in arduino atmega2560

I have arduino atmega2560 when i upload blink code than it shows error
avrdude: stk500v2_ReceiveMessage(): timeout.
I have checked the COM port is correct also that the driver is correctly installed.
Why would I be receiving a timeout error?
The possible reasons:
Faulty communication cable
Wrong com port selected
Wrong device model selected
Baud rate settings
Driver related issues
I think your arduino got bricked. But first try to reconnect it and upload your program.
Second try to disconnect any rx or tx pin connected. Third if your arduino is bricked, try to check this article for full solution of bricked arduino. Programmer is not responding arduino

How to write Linux kernel module for serial communication to arduino?

I have got Arduino MEGA 2560. What I would like to do is to send a signal to Arduino via serial port to light specified LED up. However, I cannot find any documentation about this. What steps should I follow?
I think first, I need to compile the driver of Arduino and add it to Linux kernel. Second, I have to find some header files to use them in module. Then, I have to find functions to start serial communication and to light LEDs up. However, these are just my thoughts.
Any advice will be appreciated.
The arduino-mega (the one with ATmega2560) documentation is here:
https://www.arduino.cc/en/Main/ArduinoBoardMega2560#documentation
The serial communication via UART:
https://www.arduino.cc/en/Reference/SoftwareSerial
Since there are other ways for serial communication with the ATmega please read the documentation [above] and compare that to your exercise sheet.
I think such a kernel module is already available - and used by the arduino-ide.

Resources