Hi,
we are working on a fez panda II dev board for a university project, and having some problems running the board. The actual goal of the project is to do some image computation, so we definitely need the 72 Mhz clock of the Panda. We will also use RLP for that.
We tested the board with the C# code provided to blink a led in the tutorial and we barely reach 5.6kHz.
This is the code we used :
using System;
using Microsoft.SPOT;
using System.Threading;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Native;
namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
OutputPort LED;
LED = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, true);
while (true)
{
LED.Write(!LED.Read());
}
}
}
}
Then we tried to modify the registers of the CPU because we assumed the PLL was not activated, and the different multipliers. We have some problems with that, and the dev board is bugging as soon as we uncomment the 2 last lines :
Register CLKSRCSEL = new Register(0xE01FC10C); //met l'oscillateur sur le quartz
Register PLLCON = new Register(0xE01FC080);
Register PLLCFG = new Register(0xE01FC084); //contient NSEL et MSEL
Register PLLSTAT = new Register(0xE01FC088);
Register PLLFEED = new Register(0xE01FC08C);
Register CCLKCFG = new Register(0xE01FC104);
Register USBCLKCFG = new Register(0xE01FC108);
Register PCLKSEL0 = new Register(0xE01FC1A8);
Register PCLKSEL1 = new Register(0xE01FC1AC);
Register SCS = new Register(0xE01FC1A0);
if ((PLLSTAT.Read() & (1 << 25)) != 0)
{
PLLCON.SetBits(0x01); /* Enable PLL, disconnected */
PLLFEED.SetBits(0xaa);
PLLFEED.SetBits(0x55);
}
PLLCON.SetBits(0); /* Disable PLL, disconnected */
PLLFEED.SetBits(0xaa);
PLLFEED.SetBits(0x55);
SCS.SetBits(SCS.Read() | 0x00000020);
while ((SCS.Read() & 0x40) == 0) ;
CLKSRCSEL.SetBits(0x1); /* select main OSC, 12MHz, as the PLL clock source */
PLLCFG.Write(0x00000003); //valeur stockée N-1 et M-1 //FCCO = (2 × M × FIN) / N -> M=12, N=1
// PLLFEED.SetBits(0xaa);
//PLLFEED.SetBits(0x55);;
Could you please tell us what’s supposed to be the native frequency ?
The other problem is that as soon as something is not working in the program, the dev board is stucked, and we have to flash the firmware, which is really annoying, is there any solution to avoid that ?
The last thing is we don’t really get how RLP is working. We made a code to blink a LED with a C file launched with RLP which is working, and we worked on the C# file. As soon as the C# code has a problem, we don’t get the Debug.Print any more in the output window, but the LED keeps blinking, even if the code blinking the LED (invoking the C function) is after the Debug.print. How can that be ? Isn’t it supposed to be executed sequentially ?
Thank you very much for your answers, we really need help on that