Is there a way to keep the serial port open but turn off charging on Arduino IDE? - arduino-ide

I have a project I'm working on where I want to see how my program responds as the battery voltage drops. But when plugged into the serial port, the usb charges my battery making it tough to get decreasing battery values. Is there a way to turn off the charging feature while still keeping the serial monitor open?

Related

STM32F4 exit from STOP on Usart receive interrupt

STM32F429 discovery board:
It's not possible to exit from STOP mode on Uart receive interrupt, because all the clocks are stopped? As far as I read any EXTI Line configured in Interrupt mode can wake up the microcontroller.EXTI0 - EXTI15 .
Please, I'd appreciate any advice on how to start with it.
I tried the following with STM32 cube Mx:
PA0 as GPIO_EXT0 and generated the code
how to link the uart receive pin to GPIO_EXT0
While you are correct about the EXTI0 - EXTI15 pins being configurable for a wake up, unfortunately, this particular series of microcontroller (STM32F4) cannot have the USART clock active when stop mode is on. This means that the peripheral cannot see any data. You can; however, use an external watchdog, RTC, etc... this will allow for that with your current microcontroller. There are workarounds for this.
You could use sleep mode, which just the Cortex M4 Clock and the CPU would be stopped while all the peripherals are left running. However, with all the peripheral clocks enabled you will draw more current.
If you are interested in USART clock functionality in stop mode, check out the STM32L0, or STM32L4. Both of these have that feature and it works phenomenally well and I would highly recommend these two series for a low-power application as this is what they are designed for.
It can be done in software, but not with STM32CubeMX
GPIO inputs and EXTI (if configured) are active even if the pin is configured as alternate function. Configure the UART RX pin as you would for UART receive, then select that pin as EXTI source in the appropriate SYSCFG->EXTICR* register, and configure EXTI registers accordingly. You'll probably want interrupt on falling edge, as the line idle state is high.
Keep in mind that it takes some time for the MCU to resume operations, therefore some data received on the UART port will be inevitably lost.
PA0 cannot be configured as a UART RX pin, use the EXTI line corresponding to the RX pin of the used UART.

OBDII Based Lock/Unlock and Engine Start/Stop

I want to know what it takes to build a device that can Lock/Unlock door and Engine Start/Stop for vehicles using OBDII. Is it possible? The idea is to make them app connected using Bluetooth Low Energy/ or 3G that connects with he car.
If not possible via ODBII, then what is the best way to do it?
I did some search to see if there is an device that can do such a thing of the shelf which can be controlled using APIs/SDKs but all were propriety and not open for integration. Any suggestions?
Keep in mind that the OBD II only supports the emission related data of a vehicle. But since the CAN BUS is a serial network so you might get all the data using OBD II port and not the OBD!
Lock/Unlock system is usually part of LIN system and not OBD which is a cheaper version of OBD (I think!).
CAN BUS has no encryption therefore it is possible to read all the CAN BUS traffic but the meaning of each ECU data packet is not known and manufacturers keeps them under heavy control due to the security. So if you want to have a start/stop you probably should hack the system or anyhow find the translation of each ECU data packet.
At the End if you are not a hacker with some network and vehicle knowledge, the probability is not too much for you to write an App that you expected!

Wirelessly Change XBee Channel In Noisy Environment

I have a XBee Radio on a device that we are trying to get to communicate with another XBee Radio 5' away (attached to PC). However, there is a lot of noise on the channel and the XBee is receiving a lot of gibberish only on that particular channel. My question: Is it possible to program the channel of the Xbee not attached to the computer using the one from the computer?? Will the noise make this impossible to do over wireless and will I need a hardwired connection to the second Xbee?
I think you may have misdiagnosed your problem. A noisy channel would result in delays of sending data, but won't result in random data. The coordinator typically checks all available channels and selects the one with the least noise when establishing a network.
It's more likely that another device joined the network and is sending data. Noise will limit the XBee modules' ability to send, but won't corrupt the data sent wirelessly.
Is it possible you have the XBee module in API mode when you're expecting Transparent Serial mode (also called AT mode)? In Transparent Serial, data on the module's serial port is passed directly to a destination device (specified in ATDH and ATDL).
If you're still interested in changing channels, you can control channel selection using ATSC (Scan Channels). It's a bitmask of channels the coordinator considers when establishing a network, and channels a router or end device will use when looking for a network to join. If you needed to avoid a specific channel, you could send a remote ATSC command removing the current channel from the bitmask, then possibly an ATNR (Network Reset) command. Then do the same on the coordinator so it creates a new network on a new channel.
If you've done everything correctly, the remote device will join the newly created network on the new channel. You might need to send an ATWR (Write) command to the remote device at that point, so it stores the new ATAC setting.

Background agent is scheduled but not launched by OS

I have an issue with background agent execution in Windows Phone 8.
After a successful agent registration it wasn't executed by OS.
I waited 5-10 days - no effect.
The issue is reproduced ONLY on two test devices (lumia 920 and htc x8).
All other devices shows normal agent execution log (about 5 other devices).
You can find the sample by the following link:
https://dl.dropboxusercontent.com/u/19503836/2013-12-19%20TestApp_Release_AnyCPU_v1.2.xap
XAP:
https://dl.dropboxusercontent.com/u/19503836/SimpleAgentApp.zip
App registers clean agent and tracks agent launches
App user interface displays that log
no extra logic
no time/memory consumable operations, it is almost clean project
device battery level is over 50% all the time
battery saver mode is disabled
device has Cellular and Wifi access all the time
device is used frequently
it seems that other background agents are also not executed by OS
What could be wrong with background execution in system?
How can I diagnose the issue?
I'm trying to find the issue for several months without any luck.
It turned out that those devices had some OS issues.
One test device was fixed by a hard reset and another one by a firmware update.

How to find running process details?

i need to get the running process on windows phone 8. and also the details of each process like.
Memory usage
CPU usage
Running time
and what if i want to kill any process by user action
and also total used and free memory and CPU usage status
help required
regards
On Windows Phone, applications are sandboxed. You can get the amount of memory your own application uses, but that's about it. You can't get any kind of information about the other applications. Of course, it also means you can't kill them.
If you ever wondered why there isn't any task manager app on the marketplace, now you know.