microcontroller

What is the difference between baud rate and bit rate?

本小妞迷上赌 提交于 2019-11-28 16:57:27
问题 I am really having hard time understanding the difference. Some say they are same, while others say there is a slight difference. What's the difference, exactly? I would like it if you explained with some analogy. 回答1: Bits per second is straightforward. It is exactly what it sounds like. If I have 1000 bits and am sending them at 1000 bps, it will take exactly one second to transmit them. Baud is symbols per second. If these symbols — the indivisible elements of your data encoding — are not

Initializing SD card in SPI issues

守給你的承諾、 提交于 2019-11-28 07:42:55
I've had a look at Stack Overflow question Initialization of a microSD card using an SPI interface and didn't see any answers that matched my issue (that is, things I haven't already tried). I have a similar issue where I'm trying to access a SD card through a microcontroller's SPI interface (specifically an HC908 ). I've tried following the flow charts in the Physical Layer Simplified Specification v2.00 and it seems to initialize correctly on Transcend 1 GB & 2 GB and an AE&C 1 GB card. But I'm having problems on three other random cards from my stash of old cards that I've used on my camera

Graphics library for embedded systems without Linux? [closed]

痞子三分冷 提交于 2019-11-27 21:50:21
问题 It seems that any kind of graphic library like DirectFB or MiniGui requires some sort of underlying operation system like Linux or uClinux. I am challenged with writing a software for a micro controller with just 512kb flash, an LCD display and a touchscreen to display and handle some pictures and GUI parts. Do you know any library which just need a pointer to the video memory that also can handle lines, images and fonts? 回答1: By the time you incorporate some third party solution you could

Allocating memory in Flash for user data (STM32F4 HAL)

有些话、适合烂在心里 提交于 2019-11-27 18:52:57
I'm trying to use the internal flash of an STM32F405 to store a bunch of user settable bytes that remain after rebooting. I'm using: uint8_t userConfig[64] __attribute__((at(0x0800C000))); to allocate memory for the data I want to store. When the program starts, I check to see if the first byte is set to 0x42 , if not, i set it using: HAL_FLASH_Unlock(); HAL_FLASH_Program(TYPEPROGRAM_BYTE, &userConfig[0], 0x42); HAL_FLASH_Lock(); After that I check the value in userConfig[0] and I see 0x42 ... Great! When I hit reset, however, and look at the location again, it's not 0x42 anymore... Any idea

Writing C# debug output to .txt file

戏子无情 提交于 2019-11-27 13:02:43
问题 I'm running code on a microcontroller with .NET Micro Framework, and I want my debug output to write to a text file. How does this work? 回答1: Use Trace. It is designed to do what you need. using System; using System.Diagnostics; class Test { static void Main() { Trace.Listeners.Add(new TextWriterTraceListener("yourlog.log")); Trace.AutoFlush = true; Trace.Indent(); Trace.WriteLine("Entering Main"); Console.WriteLine("Hello World."); Trace.WriteLine("Exiting Main"); Trace.Unindent(); Trace

What is a “packed” structure in C?

女生的网名这么多〃 提交于 2019-11-27 12:22:22
I am going though some C code written for the Microchip C30 compiler and I often see structs defined as follows: typedef struct __attribute__((__packed__)) { IP_ADDR MyIPAddr; // IP address IP_ADDR MyMask; // Subnet mask IP_ADDR MyGateway; // Default Gateway // etc... } APP_CONFIG; What does packed mean? When structures are defined, the compiler is allowed to add paddings (spaces without actual data) so that members fall in address boundaries that are easier to access for the CPU. For example, on a 32-bit CPU, 32-bit members should start at addresses that are multiple of 4 bytes in order to be

What are the available interactive languages that run in tiny memory? [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-27 10:01:06
I am looking for general purpose programming languages that have an interactive (live coding) prompt work in 32 KB of RAM by itself or 8 KB when the compiler is hosted on a separate machine run on a microcontroller with as little as 8-32 KB RAM total (without an MMU). Below is my list so far, what am I missing? Python : The PyMite VM needs 64K flash, 8K RAM. Targets LPC, SAM7 and ATmegas with 8K or more. Hosted. Lua : The eLua FAQ recommends 256K flash, 64K RAM. FORTH : amforth needs 8K flash, 150 bytes RAM, 30 bytes EEPROM on an ATmega. Scheme : armpit Scheme The smallest target is the

What is a “packed” structure in C?

纵然是瞬间 提交于 2019-11-26 15:58:58
问题 I am going though some C code written for the Microchip C30 compiler and I often see structs defined as follows: typedef struct __attribute__((__packed__)) { IP_ADDR MyIPAddr; // IP address IP_ADDR MyMask; // Subnet mask IP_ADDR MyGateway; // Default Gateway // etc... } APP_CONFIG; What does packed mean? 回答1: When structures are defined, the compiler is allowed to add paddings (spaces without actual data) so that members fall in address boundaries that are easier to access for the CPU. For

What are the available interactive languages that run in tiny memory? [closed]

大憨熊 提交于 2019-11-26 14:59:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I am looking for general purpose programming languages that have an interactive (live coding) prompt work in 32 KB of RAM by itself or 8 KB when the compiler is hosted on a separate machine run on a microcontroller with as little as 8-32 KB RAM total (without an MMU). Below is my

Power off an USB device in software on Windows

空扰寡人 提交于 2019-11-26 07:37:07
问题 I would like to power cycle an USB device through software on Windows. I am doing development on a small USB power microcontroller. This chip will revert to native behavior on a power cycle and allow a code download. Since my code will crash the device when things go wrong -- making it ignore all USB commands -- I have to physically unplug the device from the system. I want to do development remotely, and not have to be physically present. So far I have tried using \"devcon\" to disable