microcontroller

Change properties in device manager

ぐ巨炮叔叔 提交于 2020-01-17 08:16:13
问题 i am working with serial device, i want to communicate my computer with microcontroller. In my C# program, i can set the baud rate, stop bits, data bits etc. These just in my C# program. For example, i set the baud rate 115200 in microcontroller and my C# program, But when i see the properties of my device in device manager, the baud rate is still using default, 9600 bps. I don't know if it is good or no for communication, my C# program and microcontroller using 115200bps, and in the

STM32F103 microcontroller CAN messages

痞子三分冷 提交于 2020-01-13 20:31:50
问题 I am wondering if anyone is familiar with any STM32f10x micro-controllers? If so, I am having some problems configuring a CAN driver. I can run the demo code, which is set to a loop_Back mode, but I cannot get Normal_Mode to work. I read through all the data sheets, and everything is configured correctly except the INAK in the CAN_MSR register never resets to 0. I can provide more detail if needed, but first I need to know if there is someone who has worked with a STM32F103 microcontroller

How to access variables in external SDRAM

落花浮王杯 提交于 2020-01-07 07:38:19
问题 I am working on TM4C1294 + ccs 6.0.1 + TI 5.1.9(Compiler). Reading/Writing variables in 8MB external sdram worked fine for example g_pui16EPISdram = (uint16_t *)0x60000000; g_pui16EPISdram[SDRAM_END_ADDRESS ] = 0xdcba; However, as I use "attribute directive" for accessing to external sdram like below: int abab[20]__attribute__ ((section (".external"))); , the program is not even executed. ".external" is defined .cmd : SDRAM (RWX) : origin = 0x60000000, length = 0x00800000 SECTIONS { .intvecs:

Access to two variables safely when an interrupt might occur between them

最后都变了- 提交于 2020-01-06 03:01:08
问题 First of all I'd welcome edits to the title of this question, I couldn't think how to word it better but I'm not too happy with what I came up with. This is a question about concurrency, my application is on a microcontroller in C but I don't think that matters a great deal. I have an interrupt routine which can change the values of two global variables. I have some main code which can read those variables. But it must get get consistent values from both which means I can't read one and then

Access to two variables safely when an interrupt might occur between them

我与影子孤独终老i 提交于 2020-01-06 03:01:04
问题 First of all I'd welcome edits to the title of this question, I couldn't think how to word it better but I'm not too happy with what I came up with. This is a question about concurrency, my application is on a microcontroller in C but I don't think that matters a great deal. I have an interrupt routine which can change the values of two global variables. I have some main code which can read those variables. But it must get get consistent values from both which means I can't read one and then

basic requirements to be called RTOS for 8051

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 13:06:22
问题 I want to make an RTOS for 8051 and very confused as what minimum requirements should be followed to make an OS in 8051 as 8051 has very limitted resources in case of RAM and ROM. It is just and assignment type problem but i am really confused as we make softwares for 8051 are they not an OS? which features differenciate a normal regular coding of micro controller from RTOS? please help thanks 回答1: An typical RTOS provides at least the following: Deterministic task scheduling Task

basic requirements to be called RTOS for 8051

核能气质少年 提交于 2020-01-04 13:06:15
问题 I want to make an RTOS for 8051 and very confused as what minimum requirements should be followed to make an OS in 8051 as 8051 has very limitted resources in case of RAM and ROM. It is just and assignment type problem but i am really confused as we make softwares for 8051 are they not an OS? which features differenciate a normal regular coding of micro controller from RTOS? please help thanks 回答1: An typical RTOS provides at least the following: Deterministic task scheduling Task

C: typedef union

独自空忆成欢 提交于 2020-01-03 10:42:48
问题 didn't find anything in related questions. Most probably it's super noob, but I'll ask anyway/ I've got the following in my .h file: typedef union _API_Packet_0x90{ uint8_t packet[26]; struct _pack_struct { uint8_t start; uint8_t length[2]; uint8_t addr64[8]; uint8_t addr16[2]; uint8_t options; uint8_t rfData[4]; uint8_t chksum; }; } API_Packet_0x90; API_Packet_0x90 ap90; This is code for a microcontroller, I'm using xc8 toolchain (former Hi Tech C). The compiler says: xbee_api.h:19: warning:

PIC Backend: 16-bit registers / return type

此生再无相见时 提交于 2020-01-03 02:59:08
问题 I started writing an LLVM Backend for 16-bit PIC microcontrollers (PIC24, dsPIC30/33). After copying and renaming stuff from Lanai, removing much, adding some and making the backend known to clang I can translate short foo(void) { return 6*7; } to mov #0x2A, W0 ret which is precisely what I wanted. The DataLayout is set to "e-m:e-p:16:16-i16:16-a:0:16-n16-S16" and the registers are defined as def GPR : RegisterClass<"PIC", [i16], 16, (sequence "W%u", 0, 15)>; and added as addRegisterClass(MVT

Reading state of input pins on a PIC18

我怕爱的太早我们不能终老 提交于 2020-01-02 09:44:47
问题 I have been able to get outputs working on my PIC and can make a bunch of LEDs dance on and off as I set various output latches high/low. However, I'm having a lot o difficulty reading in the state of a pin. See the code below. I set up my config, and define the TRISC as input and TRISB as output. In an infinite loop, I check to see whether RC6 is high or low, and set the entire B latch high or low depending on the result. #include <htc.h> __CONFIG(1, FOSC_IRC & FCMEN_OFF & IESO_OFF); _