Pic benchmark, clock config

This commit is contained in:
Takashi Kojo
2014-05-05 16:41:07 +09:00
parent 20f12af8ec
commit 6ac7b056ee
5 changed files with 34 additions and 9 deletions

11
mplabx/MZ-configBits.h Normal file
View File

@ -0,0 +1,11 @@
/* Config bits for PI32MZ, Starter Kit */
#pragma config FPLLIDIV = DIV_1 // System PLL Input Divider (1x Divider)
#pragma config FPLLRNG = RANGE_5_10_MHZ
#pragma config FPLLICLK = PLL_FRC // System PLL Input Clock Selection (FRC is input to the System PLL)
#pragma config FPLLMULT = MUL_50 // System PLL Multiplier (PLL Multiply by 50)
#pragma config FPLLODIV = DIV_2
// DEVCFG1
#pragma config FNOSC = SPLL // Oscillator Selection (System PLL)
#pragma config ICESEL = ICS_PGx2
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */

View File

@ -7,12 +7,12 @@ static void init_serial() {
SYSKEY = 0x00000000;
SYSKEY = 0xAA996655;
SYSKEY = 0x556699AA;
PB2DIV = 0x00008018;
PB2DIV = 0x00008808;
SYSKEY = 0x33333333;
/* UART2 Init */
// U2BRG = 0x0C;
U2BRG = 0x7;
U2BRG = 0x047;
ANSELBCLR = 0x4000;
ANSELGCLR = 0x0040;
RPB14R = 0x02;

View File

@ -33,6 +33,8 @@ Included Project Files
3. CTaoCrypt Benchmark App (ctaocrypt_benchmark.X)
This project builds the CTaoCrypt benchmark application.
For the benchmark timer, adjust CLOCK value under
"#elif defined MICROCHIP_PIC32" in ctaocrypt/benchmark/benchmark.c
PIC32MX/PIC32MZ
---------------

View File

@ -27,8 +27,9 @@
#if defined(CYASSL_MICROCHIP_PIC32MZ)
#define MICROCHIP_PIC32
#include <xc.h>
#pragma config ICESEL = ICS_PGx2
/* ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) */
#include "MZ-configBits.h"
#include "PIC32MZ-serial.h"
#define SYSTEMConfigPerformance /* void out SYSTEMConfigPerformance(); */
#else
@ -66,11 +67,18 @@ void bench_eccKeyAgree(void);
int main(int argc, char** argv) {
volatile int i ;
int j ;
PRECONbits.PFMWS = 2;
PRECONbits.PREFEN = 0b11;
init_serial() ; /* initialize PIC32MZ serial I/O */
SYSTEMConfigPerformance(80000000);
DBINIT();
for(j=0; j<100; j++) {
for(i=0; i<10000000; i++);
printf("time=%f\n", current_time(0)) ;
}
printf("wolfCrypt Benchmark:\n");
#ifndef NO_AES