Automatic screenshot when circuit is broken in 26 pin connector - api

There is a Digital I/O Board in the back of my computer:
Digital I/O plug-in
The 26w HD Dsub connector has been configured with a wire loop connecting pins 9 and 10, and 2 wires connected separately to pins 11 and 19:
26w HD Dsub connections schematic
Physical connector set up
Most of the time the wires from pins 11 and 19 will be in contact forming a closed circuit. When the wires are disconnected, the circuit will break. In this instance, I would like a screenshot of the screen to be taken, and the photo to be saved in a specified file directory.
If anyone can help with this it would be much appreciated!!
Many thanks,
Taylor
I have never coded before so i have not attempted anything yet.
I'm expecting a screenshot to be taken of the screen when the wires from pins 11 and 19 no longer form a closed circuit.

Related

Not able to program STM32 MCU using JTAG interface

MCU : STM32L496
JFlash version: v6.32i
We are facing the "Connection to target under reset failed" issue, when we try to program the board with STM32 MCU.
We were programming the board before with no issues. This error started appearing suddenly and now we are not able to program the board. When we scoped the reset pin of the MCU, the reset pin is going low when we click the connect button in the JFlash and clearly the board is resetting (We can see the firmware functionality restarting).
We tried the following:
Tied the BOOT0 pin to VDD and tried booting to the system memory and then tried programming. But this doesn't made any difference.
Tried always pulling down the reset pin to GND while trying to flash.
We have ensured that there are no issues with the track leading to the JTAG interface of the MCU.
Could you please help to resolve this situation?
Is there any possibility that the firmware currently running in the MCU could prevent the flashing and lock the device?
STM32L4 has a feature called Read-out Protection (RDP). See section 1.1 of AN4758. If your firmware application sets (intentionally or accidentally) the RDP level to 1 or 2 in the "option bytes" memory area then the SWD/JTAG port is disabled from accessing flash memory (read, write, and erase).
If the RDP is level 0 or 1 then you should be able to read the option byte memory area. If RDP is level 1 then you should be able to set it back to level 0. The flash memory will be erased when setting RDP back to level 0 but the SWD/JTAG port will get re-enabled. If the RDP level is 2 then I believe there is no way to reset it.
This is a common problem with STM32 SWD interface. For successful programming you should not power your custom board/ other hardware with the ST link power, instead you should make the GND connection common and supply from external source. And if you are using ST link only for programming and not for debugging then you should use the STM32 bootloader(easier).

How to install Feitian R502 driver on Windows 10 IoT

I have Raspberry Pi 2 B with Windows 10 IoT. I try to run Universal Windows Platform which use SmartCardReader. When I connect Feitian R502 Dual reader it's not found as CardReader. I found indicator description:
USB data transfer – red color
No explanation Status
1 USB enumerating 1Hz flashing
2 USB enumerated Turn on
3 Firmware checksum failure 4Hz flashing
Contact card – Blue color
No explanation Status
1 No card Turn off
2 Card inserted Turn on
3 Data transfer flashing
Contactless card-Green color
No explanation Status
1 No card Turn off
2 Card inserted Turn on
3 Data transfer flashing
I have red indicator flashing with freq 1Hz. Others indicators flash properly. Can anyone help mi with configuration/installation? I found how to install drivers: link and link but i have't sources of proper drivers.
I wrote some messages with Feitian Support. We came to conclusion that Microsoft didn't deliver usb ccid drivers for Windows 10 IoT core. Finally communication with SmartCardReader connected to Windows 10 IoT core device is possible using HID reader (W10 IoT has driver). It's possible but it's not support classes from Windows.Device.Smartcard namespace.

Omron Servo throwing error 0x84 while test running

Update and answer The mistake i've made is keeping the Servo on PIN 34 ON while trying to test run the servo on CX-Drive. after making Servo ON pin OFF and the problem Solved.
I'm using CP1H-XA PLC and Omron G series Servo. I've connected the servo from CX-Drive and initialized the drive and auto-tuned with load connected with low rigidity settings.It was smooth until I've encoutered an error. CX-Drive showing me an error
Drive1:An error occured while preparing Test Run. (0x84). Please check: communications speed; Servo is ready; Servo is not used by others; and Parameters Torque limit input setting and Drive prohibited are not changed from their default values.
I've changed Torque limit and drive prohibited values to 2:Forward use Pn5e and Reverse use Pn5f
Pn5E and Pn5F values are 300 and 100 respectively.
Servo is in Ready condition and Pin 34 of CN1 is On.
Servo is not being used by any other process, i'm pretty sure of that 'cause servo is in ready and not giving servo busy input.
Communication speed(baud rate) is set to 9600 and I've tested it with 2400 bps to 57600 bps but no luck.
Can anyone know why it is giving such an error? Please let me know if have solution for that.
For PC Communication I've connected R88A-CCG002P2 Omron original cable and for PLC communication I've connected with same cable but used 9 pin D-type female to male connector. Servo Model is R88D-GT04H. and using RS232 Communication and on PLC connected with CP1W-CIF01.

Wire two USB devices to one PC port

I have an old hub that sucks, so I converted it to a USB-tripler by soldering all of the input 4 wires to the corresponding wires on the output connectors. I had to do this because modern devices require 2.0 or 2.8 volts on d+, and refuse to charge if d+ is shortened or not connected. It works well charging three devices from a 1a wall adapter.
But if someone accidentally connects this to a PC port, what will happen? Well if there is only one device, it would be detected no problem. But if two devices are wired to the same port, how dangerous is that?
I would prefer the first connected device to be identified in the system, while the second connected devices just get the power.
One of the first steps in USB enumeration is to send a reset signal by driving D+ and D- low. All the devices plugged in will see the reset and think it was intended for them. After the reset they will each think they have address 0 and respond to requests to that address. The result will be multiple devices trying to drive the bus at the same time, for a brief period before the host gives up.
I think it wouldn't damage anything, but you will be causing a short circuit for a few microseconds which is bad.

Is there a hardware buffer in SPI module?

I am using a SAM4E-EK board, and the processor is SAM4E. The board is equiped with a ADS7843 touch controller, contected from the processor through a SPI channel.
The chapter of SPI in datasheet of SAM4E said that
While the data in the Shift Register is shifted on the MOSI line, the MISO line is sampled and shifted in the Shift Register. Receiving data cannot occur without transmitting data.
But in an example for ADS7843 from ASF, it just sends data(8 bits) three times at first, and then it can receives data(8 bits) three times! I have test it, and it work fine.
So I think there is a hardware FIFO buffer in SPI receiver. But I can not find any related information in the datasheet and internet.
Am I right? or is there others mechanism making the example runs correctly?
The SAM4E manual says that SPI Receive Data Register has the size of 2 bytes
The ADS7843 manual says:
One complete conversion can be accomplished with three serial
communications, for a total of 24 clock cycles on the DCLK input
The figure 5 shows that byte0 is a request to ADS7843 and bytes1-2 are response.
You should send 1 byte of command and 2 dump bytes to provide SPI clocking while the ADS7843 is responsing (the manual says
Receiving data cannot occur without transmitting data
And when you reading 3 bytes, you get the 2 bytes of answer, stored in the SPI Receiver register