microcontroller

Simultaneous write to multiple files

笑着哭i 提交于 2019-12-12 01:38:09
问题 I'm working on a project involving using a Beaglebone to read from multiple sensors and then pass that data into a text file.I'm monitoring six different muscles, so I have the files correspond to each. Right now, there are 6 sensors feeding into the Beaglebone Black's ADC pins and my code instructs the Beaglebone to create 1 separate file for each pin. Whenever I run the below code, I only get the one file (the first function runs). Previously I had not included the "while True:" statements

Unable to send continuous data on Thingspeak using SIM800L

天涯浪子 提交于 2019-12-11 19:37:02
问题 I am trying to send data on thingspeak using TCP/IP connection with SIM800L and PIC16F1936. But it is not sending data to thingspeak meanwhile the ADC value is getting changed with change in analog input. I am unable to find what I am missing. #include "mcc_generated_files/mcc.h" #include <string.h> #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #define _XTAL_FREQ 16000000 #define RS RB0 #define RW RB1 #define EN RB2 char buff[80], a; char data[80]; int flag, b, i = 0; int adc

STM32 app not running sometimes, remains in DFU

↘锁芯ラ 提交于 2019-12-11 15:14:59
问题 Update : Problem with a STM32L4 board that sometimes won't run after DFU update, jump to Edit 2 for short story & example code. I'm working on a project using a custom board based on a STM32L4. I've been having issues when formatting strings before sending them over USB. The issue happens when updating the mcu using DFU over USB, everything works fine in debug mode (using STLink). When passing more than 3 arguments to sprintf , the mcu leaves DFU mode but the app never starts (no init steps,

Restore grinded off markings of STM32 MCU via JTAG

本小妞迷上赌 提交于 2019-12-11 14:04:50
问题 I have a board with presumably an STM32 mcu. I want to make custom firmware for that board as the stock one is very buggy. Unfortunately the board manufacturers were kind enough to grind off all the markings. Is there any way to get the device/family id via jtag and cross reference it to a model number? Everything I could find was about getting the unique id of the chip, which is NOT what I need. 回答1: You can get down to a family of STM32 through the JTAG IDCODE of the device, but getting to

Reinstate Virtual Com Port after using libftdi on FT232RL

ε祈祈猫儿з 提交于 2019-12-11 13:58:55
问题 I'm trying to use libftdi to toggle some pins on an ft232rl, then use the regular Virtual Com Port (/dev/ttyUSB0). I've got a microcontroller (LPC1114) connected to an FT232RL for programming. To get it into ISP mode, it has to be reset with one line held low, and to execute code after programming, it has to be reset. I'm trying to automate this with the ft232. I've got libftdi working, and toggling pins correctly, but once the program finishes, the VCP has disappeared from /dev. Even using

Erasing external FLASH

為{幸葍}努か 提交于 2019-12-11 11:58:53
问题 I'm working with a MCF51EM256 Freescale microcontroller and I've some problems to store data in the external flash memory to make it persistent. I need to store this struct: typedef struct { ui64_s Ea_ps; ui64_s Ea_ng; ui64_s Er_q1; ui64_s Er_q2; ui64_s Er_q3; ui64_s Er_q4; uint16 F_ea; uint16 F_er; }Ws_EnergyAcc64; Where: typedef union{ uint64 v; uint32 p[2]; } ui64_s; and: typedef unsigned long long int uint64; typedef unsigned long int uint32; typedef unsigned short int uint16; In order to

PIC Microcontrollers: Scan inputs on a 4x4 Keypad, using only Port C RC0-RC3 in C

淺唱寂寞╮ 提交于 2019-12-11 11:06:10
问题 I'm new to PIC Microcontrollers & C programming and I've been set the task of creating my own Keypad scanning method that works exclusively on Port C (16F877A Microcontroller). Specifically, the program that uses this method only uses digits 1, 2, 4 and 5- so to be efficient, the scanner method is to only use RC0, RC1, RC2 and RC3 as the designated input/ outputs (I'm not allowed to use RC4-RC7). This essentially turns the 4x4 keypad into a 2x2 keypad. I understand that the concept on

Binary reading and writing in C++

不问归期 提交于 2019-12-11 10:28:04
问题 I am making an data logger project. In my data logger, I have 5 sensors like: temperature, humidity, accelerometer, light and barometer. Here, I am storing the data in to SD card in binary format. I'm storing accelerometer @3200HZ and all other sensors at 1HZ. While writing, I'm adding a special character to each measurements like below. if(DRDY) { fwrite(&accdata,sizeof(char),1,logFile); // accelerometer special char accelerometer.getOutput(readings); int16_t store[3] = {(int16_t)readings[0]

dsPic33E : RS485 Communication issue

断了今生、忘了曾经 提交于 2019-12-11 08:02:00
问题 I am facing issue while communicating serially over RS485 port. I am using dsPic33E microcontroller with Max485. using breakpoint i analyzed that Whenever I send "0x00" to controller, "0xFF" is received. Then I sent "0x01" , "0xFD" is received on controller.and so on. Also i tried to use loop-back logic, means sending back the received character, but every time I receive "0x00" for any value sent. I am unable to get the issue. below is the snapshot of the code I am using : // RS485 TRISBbits

How to use Inline Assembly with MPLAB C18?

元气小坏坏 提交于 2019-12-11 05:47:34
问题 I am using MPLAB C18 which provides an internal assembler to enable calling assembly functions from a C project. I am following the rules on how to use Inline Assembly and I suspect something about ' Full text mnemonics must be used for table reads/writes ' is causing a syntax error message upon building my project. The internal assembler differs from the MPASM assembler as follows: No directive support Comments must be C or C++ notation Full text mnemonics must be used for table reads/writes