Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Plib libery - whot do i need to include to use defined macro

Status
Not open for further replies.

Ivan-Holm

Member level 5
Joined
Jun 3, 2010
Messages
84
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Location
Denmark
Activity points
1,894
Code:
#include<p32xxxx.h>
#include<stdio.h>
#include <plib.h>

#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2

#define SYS_FREQ (80000000L)


#define CORE_TIMER_PERIOD       SYS_FREQ

int Toggle_count;
int main()
{
TRISD =0x00000000;
PORTDbits.RD0 = 1;

while(1)
{
};
};


void __ISR(INT_EXTERNAL_0_VECTOR, 3) CoreTimerHandler(void)
{
   //  .. things to do
	if (Toggle_count == 1) mPORTDToggleBits(BIT_0);
	if (Toggle_count == 2) mPORTDToggleBits(BIT_1);
	if (Toggle_count == 3) mPORTDToggleBits(BIT_2);
	Toggle_count ++;
	if (Toggle_count == 4) Toggle_count = 1;


	// .. Toggle the LED
    mPORTDToggleBits(BIT_0);

    // update the period
    UpdateCoreTimer(CORE_TICK_RATE);

    // clear the interrupt flag
    mCTClearIntFlag();
}


---------- Post added at 11:30 ---------- Previous post was at 11:27 ----------

I got this error:
maintimer.c:27: error: Vector number must be an integer between 0 and 63
maintimer.c:27: error: Interrupt priority must be specified as RIPL, SINGLE, IPLnAUTO, IPLnSOFT, or IPLnSRS, where n is in the range of 0..7, inclusive.
maintimer.c: In function `CoreTimerHandler':
maintimer.c:40: error: `CORE_TICK_RATE' undeclared (first use in this function)
maintimer.c:40: error: (Each undeclared identifier is reported only once
maintimer.c:40: error: for each function it appears in.)
maintimer.c:44:2: warning: no newline at end of file

I have try to write the config funktion they have in the Plib macro
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top