mplab

Kiss FFT on a dsPIC33

与世无争的帅哥 提交于 2019-12-11 16:34:56
问题 I have been trying to get KissFFT to work on a dsPIC, however after trying various different ways, the output is not what it should be. I was hoping to get some help to see if there are any configurations that I may be overlooking or if its just somthing i haven't thought of? I am using a dsPIC33EP256MC202 with the XC16 compiler within MPLABX. Declarations and memory assignment. int readings[3] = {0, 0, 0}; kiss_fft_scalar zero; memset(&zero,0,sizeof(zero)); int size = 128 * 2; float fin[256]

MpLab Link Error: Could Not Allocate Section (C30 Compiler)

↘锁芯ラ 提交于 2019-12-11 15:11:44
问题 I have put the two pieces of code together (originally described in This Question Here). I have now just experienced this error from MpLab (Microchip MPLAB C30) Link Error: Could not allocate section .nbss, size = 20004 bytes, attributes = bss near Strangest thing, I looked for that message, even sub-strings of that message, in the Compiler manual (Microchip publication DS51284F) and found nothing. I even looked for the single word allocate and found it only three or four times, never with an

I get error constant expression required

蹲街弑〆低调 提交于 2019-12-11 14:39:50
问题 I'm using this inside a Header File: typedef struct { int DefaultValue; }SetValues; extern volatile SetValues XronosTrofodosias; And this inside my Source file: volatile SetValues XronosTrofodosias; int *DefaultValuesWaterSubMenu[]={XronosTrofodosias.DefaultValue}; Why i get this error? How can i fix that? Here is my Real String int *DefaultValuesWaterSubMenu[]={XronosTrofodosias.DefaultValue,XronosAdranias.DefaultValue,XronosTrofodosiasHighTemp.DefaultValue,Xronos1hsRipsis.DefaultValue

Read 'N' bit from a byte

*爱你&永不变心* 提交于 2019-12-11 08:02:03
问题 I need to read a specific bit from a byte. The value i want to test is 0 or 1. unsigned char Buffer[0]=2; //or binary 0b00000010 How can i read n bit from buffer. If it's 0 or 1? Example if 7 bit from byte is 0 or 1 回答1: You must define precisely how you count the bits: starting at 0 or 1 from least significant to most significant or the other way? Assuming bit 0 is the least significant, you can get bit 7 with this expression: int bit7 = ((unsigned char)Buffer[0] >> 7) & 1; Here is a generic

Why won't this PIC code light up my LEDs?

て烟熏妆下的殇ゞ 提交于 2019-12-11 07:31:32
问题 The following code won't set any of the pins high on my PIC18F14K50, yet it couldn't be simpler! #include <pic18.h> #include <htc.h> void main(void) { // Set ALL pins to output: TRISA = 0; TRISB = 0; TRISC = 0; // Set ALL pins to high: LATA = 0b11111111; LATB = 0b11111111; LATC = 0b11111111; // Leave pins high and wait forever: while (1); } I'm using MPLAB v8.43 and the Hi-Tech ANSI C Compiler. A logic probe shows none of the pins high except the VUSB and the MCLR. Any ideas? 回答1: At least

Warning 359 when passing string to char*

主宰稳场 提交于 2019-12-11 07:19:51
问题 I'm trying to pass a string to a function: void PassString(unsigned char * value) { // ... } int main(void) { while(1) { PassString("TEST"); } } I'm getting warning: (359) illegal conversion between pointer types. 回答1: Short answer: String literals such as "TEST" are of type char[] in C. So change the function to accept char* . Or cast the argument to unsigned char* , even though that's a less clean solution. Some history behind char : The C type system is a bit dysfunctional when it comes to

Receiving “undefined symbols” error with XC8 concerning plib I2C functions

六眼飞鱼酱① 提交于 2019-12-10 18:26:06
问题 Hey there StackOverflow! My question concerns errors being reporting within the program pasted (far) below. The target device is the PIC12LF1552 , it has one serial peripheral on it that I assumed could be used in conjunction with the library supplied with Microchip's XC8 compiler. Some sources on the internet have said that only higher end devices in the PIC18 line would support the library functions, other sources have said the library functions work just fine. So I decided that I didn't

How to make data bank size more than 256 bytes [Linker File - MPLAB ]

放肆的年华 提交于 2019-12-10 18:03:57
问题 I have PIC18F87J11 FAMILY and I am using MPLAB C18 Compiler. What is the maximum bytes I can give the following variable. I know that I have to modify the linker file to achive more than 256 bytes. #pragma udata CONNECTION_TABLE This is my clean linker file. // File: 18f87j11_g.lkr // Generic linker script for the PIC18F87J11 processor #DEFINE _CODEEND _DEBUGCODESTART - 1 #DEFINE _CEND _CODEEND + _DEBUGCODELEN #DEFINE _DATAEND _DEBUGDATASTART - 1 #DEFINE _DEND _DATAEND + _DEBUGDATALEN LIBPATH

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 &

Set Output Port High Low C

一笑奈何 提交于 2019-12-04 19:34:48
I'm using MPLAB to compile a program in C using the CCS compiler. I want to set an output port as high or low using defined ports. #bit portOut1 = PORTC.0 So, I want to set my portOut1 high or low. I had used 3 ways to do it, but just one had worked. But I'm not satisfied with that. 1: (Doesn't work, why?) portOut1 = output5.value; 2: (Doesn't work, why?) output_bit(portOut1,value); 3: (Obviously work) output_bit(pin_c0, value); I don't understand why the first and second way doesn't work. And I don't want to use the third because I don't know what this pin do unless I comment, and I don't