FEZ Cerberus use external power

Hello everyone

I’ve just spent some time to look for this question on the internet or here in the forum, but i havn’t found an answer… so i try to ask it here, i hope you understand my english, i’m swiss :wink:

I’m using the FEZ Cerberus and i was programming an application, where i start some I2C-Communications at the beginning. I load the programm over the USB-Client to the Cerberus and pressed “Start”. the programm was running, and it was working. but now, i want to put my Cerberus into the box, where the other i2c-devices are connected and i don’t want to power the board over the usb cable. So i did an adapter which puts me 3.3V to pin1, 5V to pin2 and GND to pin 10 on the socket X8.
At the beginning of my program, i wrote the line Thread.Sleep(10000), to wait 10 seconds. i think it would be better to wait some time, till every device has sure startet up, befor i start some i2c-communications.

The Power-Led on the Cerberus is glowing, but i think the program isn’t running… the i2c communication doesnt work… i can press the reset-button, but nothing happens.

i tried to toggle one outputpin at the beginning of my program, downloaded it and used the external power and it worked. i think the problem is the serial-communication, but i dont know how to solve that problem…

I hope, someone’s able to help me, thanks ;D

Can you show your code, please?

@ Architect - My code is very large, i’ve got more than 10 classes…

public partial class Program
{
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
Thread.Sleep(10000);

        TestController testController = new TestController();
    }
}

this is my Program-Class. The main is at TestController();

@ rfr - Can you describe your application in more details? What kind of I2C device how do you connect everything, etc.

You have mentioned problem in “serial-communication”. Can you please give more details on that?

@ Architect - okay, i’ll try to give more details :wink:

On the I2C bus, there are about 10 different i2c-slaves… for example a Display, some LEDs (which are driven by a i2c-LED-driver) a.s.o…

In my program, i’ve got the I2C-Master-Class, which extendsthe I2CDevice.
Every slave has got his own class, which includes his I2CDevice.Configuration and his initialisation. My I2C_Master-Class instances all the slaves.

If i want to write a byte for example to my display, i set the I2C-Configuration of my Master-Program to the Configuration of the display and start the write-transaction. so, the configuration is the thing which changes due to my i2c-slave.

But as i said, all of these is working, while i’m debugging and using the usb-power. as soon as i push the reset-button, the programm is logicaly stopping, but doesnt start again. The beginning of my program is a 10-second sleep, and after that, i’m instancing the i2c-master, which instances all my slaves. this includes the initialisation of all my slaves, what means, i’m already using the i2c-bus there. But this is the point, where i see, that my program doesnt work or is hanging. it’s really strange.

My idea was then, the problem could be up to that i’m powering all the different i2c-slaves and de FEZ Cerberus at the same time, but as i pushed the reset-button (when the whole system was started up), it doesnt work eighter.

I hope you understood my “english” ::slight_smile:

Did you measure your 3V3 supply that it is stable? Can you just as an experiment try using the USB power supply option to see if it works with that? And if that still does not work, start with just one I2C device, then add the second etc. It might be that one of your I2C devices is pulling the I2C lines low or high.

@ KiwiSaner - Hi KiwiSaner

Yes, my 3.3V voltage is constant.
With the USB-Power, my program is working.

1.) i power my Cerberus over USB, download the code to the board and push Run (Debugging) and it works. when i push reset, it doenst start again

2.) i power my Cerberus external and the program was load before, the program doesnt work. i push reset, and it doesnt work eighter.

3.) i load the programm to Cerberus, power over USB and press Run, the program runs. i pull out the usb cable and put it in again, the board is now powerd over USB and it doesnt work anymore

so, i think the problem is something with the timing of the i2c… i really don’t know what i should do next…

Hi @ rfr,

I know you’re pretty new here, but how new are you to netmf ?

I wonder if we’re struggling to understand two things - first whether you just mean that your app doesn’t reconnect to the debugging (particularly in your points 1 and 3 where you reset the device or re-power the device). The second thing I wonder about is what exactly leads you to know the application doesn’t work - do you have some visual cue that tells you when it runs ?

When I am faced with an issue like this I’ll try simplifying things. With a single I2C device, can I get my app to run in all the scenarios I need - on USB power and when debugging, as well as when on USB power (from say a phone charger that has no debugging) and when powered through your external power source you intend to use longer term. Then add in more devices and see what happens - and as @ kiwisaner says, watch your voltage levels on power up for voltage sag (are you watching that with an oscilloscope ?)

Is there anything special about your app - do you rely on anything USB related or otherwise connected to the outside world ?

@ Brett - Hi Brett, thanks for your detailed reply.

first, as soon as i turn my fez-cerb in the debugging mode (when i download the code again to my board), it works. I can stop and continue (at visual studio) and it also works.

but when i’m not in debugging mode, so as soon as i repower the board, i can reload the code, but that isn’t what i want. simply repowering the board after downloading the code, doesnt start my application. And yes, secondly, i’ve got a display, which shows me after that 10seconds waiting-time the home-screen ( for example some strings) and then im in the menue where i can choose different functions (with an i2c keyboard)… But the display doesn’t show something, its empty.

yes, i’ve already tried to solve the problem step by step, i startet with a very simple project: i always set an output-pin to high and to low. i watched it with an oscilloscope (what answers your question :wink: ) and i saw there, that it’s alway high, low, high, low… then, i pushed the reset-button, and after some time (1 or 2 seconds) it started again and it worked. it worked with external power too, and that’s what i want.
BUT: as soon as i use I2C, it doesnt work anymore. perhaps its only the i2c what doenst works, but i can do what i want, it only works while i’m in debugging mode.

What i also tried is, i built a delay-circuit, which resets the FEZ cerberus after 2 seconds. so, when i start the whole system, all i2c-devices have time to start up and after 2 seconds the fez will be resetted. but that failed too, because as i said, after a reset, it doesnt start.

and the display was the only i2c-slave which was connected when i was trying that.

No, i think there’s nothing special. i only have a power-board which regulates 5V and 3.3V, (which are constant) and the i2c-slaves and the fez cerberus.

and as i understood, 5V, 3.3V and GND are the only three pins which i have to connect, arent they?

@ rfr - I think what KiwiSaner was asking is to try just powering the board using USB cable from your PC USB port without running VisualStudio in debug or release mode. Once the application is loaded with VisualStudio it is there, you don’t need to reload it.

Does your external power supply provide enough current? Do you use threading in your application?

the thing I would try is powering it via USB from a high current capacity wall phone charger.

I would also have a visual cue that doesn’t rely on I2C, specifically I would use something simple like a blinking LED in a timer that you know will report correctly and should continue to function. If you get real advanced, you could set a blink rate at startup and vary that once you’ve initialised your I2C device - to see if the I2C code is actually blocking your app from running.

But I always go back to the fundamentals here - when I hear a problem like this I think GND issues…