microcontroller

NAND flash programming: granularity of writes?

ⅰ亾dé卋堺 提交于 2019-12-06 10:47:44
is someone in the kow about write accesses on nowadays large NAND flash chips? What is the minimal granularity for writes? I have a microcontroller flash here which requires at least 1 and at most 4 words (16-bit words that is) to be fed to the write statemachine at once. I think that the large (> 1 Gbit) flashes behave differently here for write performance reasons. slarti So to be clear, to write a 1 bit you have to clear a whole block of memory, to write a 0 bit you only have to write one memory location. Are you talking about a one time write (changing some of the bits from a 1 to a 0

How to interact with USB device using PyUSB

怎甘沉沦 提交于 2019-12-06 08:12:36
I have so far gotten to the stage of finding the device, now I am ready to talk to the USB using the devices protocol laid out in the specification on page 22. libusb is installed on my machine and so is PyUSB. import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x067b, idProduct=0x2303) # was it found? if dev is None: raise ValueError('Device not found') # b are bytes, w are words reqType = '' bReq = '' wVal = '' wIndex = '' dev.ctrl_transfer(reqType, bReq, wVal, wIndex, []) The above example is attempting to use a control transfer, which I assume is what the

HAL_RCC_OscConfig takes too long (appx 170 μS), I need it to be <50 μS when waking from STOP

我怕爱的太早我们不能终老 提交于 2019-12-06 05:24:46
问题 Development for STM32L053R8 on NUCLEO-L053R8 board. We have a system which "wakes" from sleep every 200 μS or so, does a small amount of work then goes back to sleep (Stop mode). Ideally I'd like to wake from STOP in under 50 μS. The HAL_RCC_OscConfig() function takes around 170 μS which renders this effort pointless. From what I can see the majority of time is spent with the PLL Configuration, in particular the while loop ("Wait till PLL is ready") which follows the re-enablement of the PLL

Reading state of input pins on a PIC18

房东的猫 提交于 2019-12-06 05:24:19
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); __CONFIG(2, PWRTEN_OFF & BOREN_OFF & WDTEN_OFF); __CONFIG(3, MCLRE_OFF); __CONFIG(4, STVREN_ON & LVP_OFF &

How to split hex byte of an ASCII character

一个人想着一个人 提交于 2019-12-06 05:19:17
What basically i want to do is For eg: 'a' hex equivalant is 0x61 , can i split 61 in to 6 and 1 and store them as '6' and '1' ? A buffer is receiving data like this: rx_dataframe.data[0] is H'00,'.'// H' is Hex equivalant and '' is ASCII value rx_dataframe.data[0] is H'31,'1' rx_dataframe.data[0] is H'32,'2' rx_dataframe.data[0] is H'33,'3' I need to to convert hex values 0x00,0x31,0x32,0x33 in to char value '0','0','3','1','3','2';'3','3' and to store them at the locations of tx_buff_data[]; I want my tx_buff_data look like this tx_buff_data[0] have H'30,'0' tx_buff_data[1] have H'30,'0' tx

What is the size of integer in 8-bit, 16-bit, 32-bit processors/microcontrollers?

廉价感情. 提交于 2019-12-06 02:15:54
What is the size of integer in 8-bit, 16-bit, 32-bit processors/microcontrollers ? I guess it depends on the internal accumulator/register size. But not sure. Thanks I'm only aware of one programming language that defines an integer data type, but it's seldom used for 8 and 16-bit architectures. C is the most widely used language for programming 8-bit, 16-bit, and 32-bit architectures, so I assume you are looking for an answer in the context of C. There are several "integer" data types in C: char , short , int , long , etc..., but I will assume what you really mean is the int data type. The

Why does GCC put calls to constructors of global instances into different sections (depending on the target)?

折月煮酒 提交于 2019-12-06 01:22:40
问题 I have some simple declarations of a global instances with non-empty constructors. These constructors are called during startup automatically. I am cross-compiling C++ on Linux to different microcontroller targets. As for arm-none-eabi-gcc-4.8.4 rx-elf-gcc-4.8-GNURX_v14.03 (GCC 4.8.3) calls to constructors are put into the .init_array section. The map file looks like this: .init_array 0x00007cb8 0x4 libmotor.o .init_array 0x00007cbc 0x4 libaudio.o As for mips-elf-gcc-4.8.2 avr-gcc-4.8.1

USB Driver Installation Issue for Microcontroller using Custom INF

℡╲_俬逩灬. 提交于 2019-12-06 01:13:01
I'm working with the NXP LPC1788 microcontroller and I'm trying to create a driver on the host computer to communicate with it via USB. I believe that I've managed to get the device handling standard USB requests properly (the PC is able to read the string descriptors properly). I'm having trouble writing a sample USB driver and installing it for the device, though. I'm working with Microsoft Visual Studio 2013. My steps were: Creating a WinUSB Application, which produces a "Driver" and "Driver Package" project. Modifying the generated INF file to use my device's VID and PID. Building the

Can I make a function that accepts both ram and rom pointers in Microchip C18?

不问归期 提交于 2019-12-05 18:22:47
问题 When I declare a function that accepts const char* and I pass a string literal, I get a Warning: [2066] type qualifier mismatch in assignment because string literals are rom const char* . It's the same the other way around. Though the PIC is Harvard architecture, the memory is mapped into one contiguous address space, so theoretically it should be possible to support both ram and rom pointers the same way. Probably I have to use rom pointers because they are 24 bit while ram pointers are 16

Moving data from memory to memory in micro controllers

北战南征 提交于 2019-12-05 15:28:51
Why can't we move data directly from a memory location into another memory location. Pardon me if I am asking a dumb question, but I think this is a true situation, at least for the ones I've encountered (8085,8086 n 80386) I am not really looking for a solution for moving the data (like for eg, using movs n all), but actually the reason for this anomaly. Most CPU varieties don't allow memory-to-memory moves. Normally the CPU can access only one memory location at at time, which means you need a temporary spot to store the value when moving it (a general purpose register, usually). If you