Main Site Documentation

Issue with dl40-IO and taylorza firmware


#1

Hi,
I am a french engineering student currently using gadgeteer with cerberus v4.2.6.1. For a project purpose I have to use dl40 in order to count pulses from an encoder. However I can’t manage to make the taylorza firmware to work properly.

I am using his test samples (TestCounter.cs). I have connected the 3.3v and the P0.2 to a touch-sensitive device and when I expect the program to count the number of time I short circuit the two pins it always displays on the debug output the same line :

Last Count : 18446744073709551615

which I believe is 2^64 - 1.

I have tried to update the firmware and to wire differently but I can’t figure out the solution.

Here is the code sample I am using :

class TestCounter
    {
        static DLIOModule Module;
        static IPulseCounterPin Counter;

        public static void Run(DLIOModule module)
        {
            Module = module;

            Counter = module.CreateCounterPin(0, 2,
              Microsoft.SPOT.Hardware.Port.ResistorMode.PullDown,
              Microsoft.SPOT.Hardware.Port.InterruptMode.InterruptEdgeHigh, true);

            Gadgeteer.Timer timer = new Gadgeteer.Timer(1000);
            timer.Tick += new Gadgeteer.Timer.TickEventHandler(timer_Tick);
            timer.Start();
        }

        static void timer_Tick(Gadgeteer.Timer timer)
        {
            // Read the counter value
            ulong reading = Counter.ReadCounter();

            Debug.Print("Last Count : " + reading);
        }
    }

Thanks,
Joshua


#2

Are you sure you update DL40 firmware correctly? It is not enough that you just use dll or C# source from Taylorza.


#3

Oh how could I do that ? I have download the lastest DL40.bin file but I’m now quite sur on how to use it in order to update the firmware


#4

No problem. You need to use this utility:
https://www.ghielectronics.com/community/codeshare/entry/641
Don’t forget to replace DL40.bin in resources directory and to plug DL40 on * side.

If there will be some other problems just let me know and I will try to help you.

Welcome to the community.


#5

Thanks it did work and my counter works. However I had a message when flashing the module like if the cerberus didn’t have enough memory to do something.

The message was something like

Failed allocation for 198 blocks, 2376 bytes

during the download part of the flashing.