microcontroller

TraceBack (most recent call last), and GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) errors

你。 提交于 2019-12-01 04:36:21
问题 I have been struggling with a script that will turn a Pi's BCM pins 17, 27, and 10 on for 1 second then off for 1 second sequentially 100ish times. When I run the script LED1 will turn on and then it turns off and the program shuts down with this error: Traceback (most recent call last): File "LedBlink.py", line 47, in <module> LED2Blink() File "LedBlink.py", line 27, in LED2Blink GPIO.setup(LED2, GPIO.OUT) RuntimeError: Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO

Converting to ASCII in C

你。 提交于 2019-11-30 19:45:45
Using a microcontroller (PIC18F4580), I need to collect data and send it to an SD card for later analysis. The data it collects will have values between 0 and 1023, or 0x0 and 0x3FF. So what I need to do is convert 1023 into a base 10 string of literal ASCII values (0x31, 0x30, 0x32, 0x33, ...). My problem is that the only way I can think of to split the digits apart requires a lot of division. char temp[4]; temp[0] = 1023 % 10; temp[1] = (1023 % 100) / 10; temp[2] = (1023 % 1000) / 100; temp[3] = (1023 % 10000) / 1000; Using this method, finding the ASCII values of an n digit decimal number

Minimum hardware specification to run SQLITE in an Embedded System/Microcontroller

不羁的心 提交于 2019-11-30 16:22:57
I want to run sqlite in an embedded application. What's the bare minimum requirement to be able to run sqlite for maintaining a database? I'm looking at implementing the R*tree for spatial searches. It would be helpful if I could get an explanation justifying the requirements. Would a cortex M0/cortex M3 with with about 32kb of ram be enough? How much flash memory will i need? I'm looking at storing the database itself on an SD card. From About SQLite ...the size of the SQLite library can be reduced below 300KiB. SQLite can also be made to run in minimal stack space (4KiB) and very little heap

Minimum hardware specification to run SQLITE in an Embedded System/Microcontroller

試著忘記壹切 提交于 2019-11-30 16:11:10
问题 I want to run sqlite in an embedded application. What's the bare minimum requirement to be able to run sqlite for maintaining a database? I'm looking at implementing the R*tree for spatial searches. It would be helpful if I could get an explanation justifying the requirements. Would a cortex M0/cortex M3 with with about 32kb of ram be enough? How much flash memory will i need? I'm looking at storing the database itself on an SD card. 回答1: From About SQLite ...the size of the SQLite library

Embed JVM into micro-controller [closed]

狂风中的少年 提交于 2019-11-30 16:03:47
I am new in embedded world. May be I am wrong. But I want a relevant solution. I just want to embed java environment into a MCU for ease to develop application. The MCU vendor have provide the C library for lcd, sensor, spi, buttons, UART, DIO etc etc. Can I embed java into this ?? I mean, I want to use java on the MCU, uppon those device drivers. Can I use or make something like this?? I have seen the simple Real-Time-Java it's very tiny. Thank you. Take a look at NanoVM and Bajos . 来源: https://stackoverflow.com/questions/11940169/embed-jvm-into-micro-controller

starting a microcontroller simulator/emulator

醉酒当歌 提交于 2019-11-30 15:51:48
I would like to create/start a simulator for the following microcontroller board: http://www.sparkfun.com/commerce/product_info.php?products_id=707# The firmware is written in assembly so I'm looking for some pointers on how one would go about simulating the inputs that the hardware would receive and then the simulator would respond to the outputs from the firmware. (which would also require running the firmware in the simulated environment). Any pointers on how to start? Thanks Chris Alex Fort Writing a whole emulator is going to be a real challenge. I've attempted to write an ARM emulator

How to enforce the struct bit order with the GCC compiler?

坚强是说给别人听的谎言 提交于 2019-11-30 12:43:53
I was wondering if there is a GCC C Compiler directive that allows me to determine the bit order for packing of a structure? Something to the likes of: #pragma bit_order left The rationale for such a need is that I have the following structure: struct { union { unsigned char BYTE; struct { unsigned char B0: 1; unsigned char B1: 1; unsigned char B2: 1; unsigned char B3: 1; unsigned char B4: 4; }BIT; }ITEM; } myStruct; With this structure, I would like the compiler to pack it this way: Bit order: | 7 6 5 4 3 2 1 0 | Label: |B0 B1 B2 B3 B4 B5 B6 B7 | Rather than how GCC does it: Bit order: | 7 6

Efficient implementation of natural logarithm (ln) and exponentiation

瘦欲@ 提交于 2019-11-30 09:08:00
Basically, I'm looking for implementation of log() and exp() functions provided in C library <math.h> . I'm working with 8 bit microcontrollers (OKI 411 and 431). I need to calculate Mean Kinetic Temperature . The requirement is that we should be able to calculate MKT as fast as possible and with as little code memory as possible. The compiler comes with log() and exp() functions in <math.h> . But calling either function and linking with the library causes the code size to increase by 5 Kilobytes, which will not fit in one of the micro we work with (OKI 411), because our code already consumed

Alternative languages for embedded programming

偶尔善良 提交于 2019-11-30 08:19:37
I`m looking for alternatives programming languages (from assembly, C, C++ and basic) to embedded (microcontroller) programming. Is it possible for example, to program microcontrollers in C# or Java? Maybe Ruby or Python? If possible, please post development tools and hardware used. There's also Lua. See eLua . Ira Baxter FORTH has been popular in embedded systems for a long time. I have no specific experience with it but it is very cleverly designed to provide a lot of functionality in a small amount of space even on difficult micro controllers, using threaded code interpretation methods. It

CRC16 checksum: HCS08 vs. Kermit vs. XMODEM

空扰寡人 提交于 2019-11-30 07:09:57
I'm trying to add CRC16 error detection to a Motorola HCS08 microcontroller application. My checksums don't match, though. One online CRC calculator provides both the result I see in my PC program and the result I see on the micro. It calls the micro's result "XModem" and the PC's result "Kermit." What is the difference between the way those two ancient protocols specify the use of CRC16? you can implement 16 bit IBM, CCITT, XModem, Kermit, and CCITT 1D0F using the same basic code base. see http://www.acooke.org/cute/16bitCRCAl0.html which uses code from http://www.barrgroup.com/Embedded