Code: #include <hidef.h> /* for EnableInterrupts ma...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Code: #include <hidef.h> /* for EnableInterrupts ma...

5,337 Views
gbaars
Contributor I
Code:
#include <hidef.h> /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */dword a;void main(void) {  /* Disable Watchdog */  SOPT1 &= 0b00111111;     /* set FLL division */  MCGC4 &= 0b11011100;  MCGC4 |= 0b00100001;        RGPIO_ENB = 0xffff;  RGPIO_DIR = 0xffff;        while (1){      for (a=0;a<10000;a++) {    }    RGPIO_TOG = 0xffff;      } }

 
With this on an RGPIO pin only 7.5 ms per loop is measured.
The for loop translates into 7 asm.inst. The average speed
is 10 MIPS only. How can it go faster??
Labels (1)
0 Kudos
Reply
3 Replies

1,388 Views
gbaars
Contributor I
After trying the processor expert
it seems not available for the 51JM128 (only for QE).
 
All MGC settings to default (it should
run at 32..40 MHz) (internal refclk x 1024).
 
After starting the debugger (via BDM to external target)
a message appears (in the command window):
 
 
 
 
 
Reset command file correctly executed.
FP: FLASH parameters loaded for MCF51JM128_V0_4 from C:\Program Files\Freescale\CodeWarrior for Microcontrollers V6.1\prog\FPP\mcu7003.fpp
      MCU clock speed: 4541000 Hz
Block Module Name      Address Range   Status
   0  FLASH                0 -  FFFF   Programmed - Unselected
 
 
 
 
 
This sets the MCU clk to 4.5 Mhz, why does it do that??
(the goal is to achieve 50 Mhz mcuclk and 25 mhz busclk).
 
 
 
0 Kudos
Reply

1,388 Views
gbaars
Contributor I
err. Topic of message is "maximum MIPS on MCF51JM128"
0 Kudos
Reply

1,388 Views
JimDon
Senior Contributor III

My advise is to use processor expert to be sure you have set the clock to the maximum.
Chances are you do not have the clock set as high as it will go.



0 Kudos
Reply