microchip

Yocto Bitbake Glibc build fails

那年仲夏 提交于 2021-01-29 10:08:01
问题 I'm trying to build a Yocto image but the build fails when compiling glibc. If I run just bitbake glibc -c compile I get a compilation error as follows: /usr/src/debug/glibc/2.27-r0/git/nptl/pthread_atfork.c:51: undefined reference to `__dso_handle' | /media/g/01D476BE2E4F26B0/AT91/SAMA5D27_SOM1/yocto/poky/build-microchip/tmp/work/cortexa5hf-neon-poky-linux-gnueabi/glibc/2.27-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/../../libexec/arm-poky-linux-gnueabi.gcc

How can I exit my lookup table instruction with the desired value on PIC16F1829

不想你离开。 提交于 2021-01-29 08:19:34
问题 How can I get my code to work correctly when I include ADC conversion in it? I have a working code that displays two digits on 2 LED displays using a p16f1829. However, a problem arises when I try to include a code block that collects the results of an ADC conversion to display on the LED display (see below). A2D: ; Start the ADC NOP ; Requried ADC delay of 8uS => (1/(Fosc/4)) = (1/(500KHz/4)) = 8uS BANKSEL ADCON0 ; Selects memory bank containing ADCON0 register BSF ADCON0, GO ; Start the ADC

Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

為{幸葍}努か 提交于 2020-03-21 17:52:42
问题 I have an array each of whose elements could be either uint16_t or a pair of uint8_t. Its elements are defined as a union of a uint16_t and a sub-array of 2 uint8_t. Unfortunately, the compiler (MicroChip XC16) allocates twice as much memory as it should for the array. typedef union { uint16_t u16; // As uint16_t uint8_t u8[2]; // As uint8_t } my_array_t; my_array_t my_array[1]; // 1 word array, for testing my_array[0].u8[0] = 1; my_array[0].u8[1] = 2; uint8_t byte_0 = my_array[0].u8[0]; //

Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

半腔热情 提交于 2020-03-21 17:51:38
问题 I have an array each of whose elements could be either uint16_t or a pair of uint8_t. Its elements are defined as a union of a uint16_t and a sub-array of 2 uint8_t. Unfortunately, the compiler (MicroChip XC16) allocates twice as much memory as it should for the array. typedef union { uint16_t u16; // As uint16_t uint8_t u8[2]; // As uint8_t } my_array_t; my_array_t my_array[1]; // 1 word array, for testing my_array[0].u8[0] = 1; my_array[0].u8[1] = 2; uint8_t byte_0 = my_array[0].u8[0]; //

Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

淺唱寂寞╮ 提交于 2020-03-21 17:51:03
问题 I have an array each of whose elements could be either uint16_t or a pair of uint8_t. Its elements are defined as a union of a uint16_t and a sub-array of 2 uint8_t. Unfortunately, the compiler (MicroChip XC16) allocates twice as much memory as it should for the array. typedef union { uint16_t u16; // As uint16_t uint8_t u8[2]; // As uint8_t } my_array_t; my_array_t my_array[1]; // 1 word array, for testing my_array[0].u8[0] = 1; my_array[0].u8[1] = 2; uint8_t byte_0 = my_array[0].u8[0]; //

How to Use I2C with XC16 Using MCC - Microchip

走远了吗. 提交于 2020-03-05 04:58:49
问题 This is the first time I've attempted to use I2C for my design so bear with me. I've used the MCC to set up I2C and I have I2C.c and I2C.h. I'm trying to read a pressure sensor value. The value is 15 bits long. Do I need to write to the slave before I read or can I just read the value straight away? I've put part of my code below. You can see that I'm only trying to read a pressure value. Can anyone point me in the right direction of how to achieve this? Thanks guys. NOTE: Using a

How to make Timer1 more accurate as a real time clock?

不想你离开。 提交于 2020-01-24 19:03:27
问题 I have PIC18F87J11 with 8 MHz oscillator and I am using timer1 as real time clock. At this moment I have it toggle an LED every 1 minute. I noticed it does work perfect fine the first few times but slowly it starts toggling the LED every 59 seconds. Then every few minutes it keeps going down to 58, 57, etc. I don't know if its impossible to get an accurate clock using internal oscillator or if I need external oscillator. My settings look right for timer1, I just hope I can resolve this issue

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:

Questions about displaying 0x00 to 0xFF with two seven segment Lights

随声附和 提交于 2019-12-25 18:48:16
问题 Can someone please help me with this? I have been researching and trying to get this working, but I'm out of luck. All the codes I found online were not working... The output, for now, is 00, 11, 22, 33, ... FF and lop back to 00. How do I separate the first and second digit displays? Like I want it to display from 0 to 255 (00, 01, 02...FF)? Requirements: When the circuit is first energized, the seven-segment LEDs will start counting at 0x00. The duel segment LEDs will count up to 0xFF,

How to erase just some bytes of Flash Memory?

a 夏天 提交于 2019-12-24 05:42:06
问题 My PIC18F87J11 only erases 1024 bytes at a time. Is there away to force it to only erase 2 bytes or more at a time? I am making a Bootloader and sometimes only one line of the HEX file (16 bytes) changes for the application program, so I want to replace that line in memory with the new 16 bytes only . If I try to erase those 16 bytes, automatically 1024 bytes get erased too. Then I am forced to re-write them which takes some time and reduce the speed of the Bootloader. Is there an alternative