I think I need to figure out how to get it added to the toolbox. I’m getting a checksum error, so I think it is either that it doesn’t like the ethernet FW on the Cerberus, or it doesn’t like the io60p16 driver I got from Github because I am missing the steps to get it into the toolbox. I found the WiX toolkit, but when I build I get errors about candle.exe and I am trying to work through those at the moment.
Error 1 Unable to load tool from path file:///C:\Source Code\IO60P16\candle.exe. Consider setting the ToolPath parameter to $(WixToolPath). C:\Source Code\IO60P16\IO60P16.csproj 111 5 IO60P16
Ok, I switched it to being declared in code instead of having one on the designer, but I am still stuck getting the checksum error. I swapped to my board that has the non-Ethernet firmware and still get the error. I’ve re-flashed the firmware, and I have erased the device with MFDeploy. I’ve also removed the io6016p device from code and I still get the error. So, I don’t think I will be working on the io60p16 until I fix whatever is going on with my boards. I will be back when I fix the error below though.
Locating source for ‘C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs’. Checksum: MD5 {a8 a2 70 8 27 c1 18 b5 fc bf 68 e5 12 ca 5c f8}
Determining whether the checksum matches for the following locations:
1: C:\Source Code\Program.cs Checksum: MD5 {5d 81 a9 bc ce a4 3 82 c2 5e 9e 4b f4 68 97 ea} Checksum doesn’t match.
The file ‘C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs’ does not exist.
Looking in script documents for ‘C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs’…
Looking in the projects for ‘C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs’.
The file was found in a project: ‘C:\Source Code\Program.cs’.
Determining whether the checksum matches for the following locations:
1: C:\Source Code\Program.cs Checksum: MD5 {5d 81 a9 bc ce a4 3 82 c2 5e 9e 4b f4 68 97 ea} Checksum doesn’t match.
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl’…
Looking in directory ‘C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include’…
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs.
The debugger could not locate the source file ‘C:\Gadgeteer\NETMF_42\GadgeteerCore\Gadgeteer42\Program.cs’.
Make sure don’t still have the reference in your project to the .dll from the designer. Try creating a new project. Also, make sure that the IO60P16 driver project isn’t set as the startup project. This error doesn’t make a lot of sense.
It doesn’t get to my Program.cs file, so I can’t just post simple code, I would have to post the entire solution, and the attachments in the forums can only be images (as far as I can see).
Ok, clean project deploys, so I am just scrapping that project, it didn’t have any good code in it anyway. I still do not get interrupts using your new driver though.
I’m using a Cerberus with the io60p16 plugged into port 4, and my code is below. I threw a timer in and the Debug.Prints from the timer show the values change, so it is still isolated to an interrupt problem. I am seeing value changes on other ports (at least port 2). Port 2 apparently has “pins” 4, 5, 6, 7 tied into the same value as 3, which I guess doesn’t really matter since those pins don’t physically exist anyway, I was just a bit surprised to see it.
Ok, so interrupts are improving. The single-pin works, but oddly I found that it also fires the board level interrupt, but the board level interrupt does not fire for any pin that does not have a single-pin interrupt defined, so I get 2 or zero interrupts. Below is the code I get, so the main difference I see between full-board and single-pin is that on the full board interrupt there is no way to specify FallingEdge. When I change a pin I see it in the tmr_Tick, and if it is port 2 pin 3 I see both ip0_OnInterrupt and io60p16_Interrupt.
You really should never need to use the board level interrupt with my driver. You need to understand how this module works. The chip on the module raises an interrupt when any pin state changes. When it’s raised, it then expects you to examine which ports have interrupt enabled pins and which changed. I’m doing all this work for you in the module level interrupt handler and then throwing new events for each InterruptPort instance that was created using CreateInterruptPort(). That’s why you should use this function to create your pins and then only create event handlers from these instances. I expose the module level OnInterrupt event but by handling it yourself you will have to do a lot more work and should only be necessary in very special circumstances. See my event handler in IO60P16Module.cs.
My appologies, I was actually talking about the private event handler, IO60P16Module.OnInterrupt(), and had forgotten that I actually do expose a more intelligent event at the module level. However, if you look at InterruptPort.OnParentInterrupt() you will see that the InterruptMode logic is located there. The interrupt mode of individual pins is not currently known by the module directly. Considering that people may want to use it as you are, I may need to do a little more refactoring and store the interrupt modes with the module instead of with the pin. Of course, if you’re using 60 interrupt pins then you are certainly dropping into that special case that I warned of. In fact, I will be amazed if this module will even function if you’re using that many pins and they are all firing events simultaneously. I’ve managed to lock up the module on many occasions by trying to do too much at once. It will just quit sending interrupts until you do a reset when this happens.
I won’t have that many firing. Currently I only need 27, though I do have plans for a few more, but even then it would be a rare event to have 2 fire within a few milliseconds of each other. I would expect most events to come in pairs (one high, one low), with at least 500ms between, sometimes much more, and I would expect an even greater time between the pairs of events (seconds, minutes, hours).
I don’t think you’ll have any problems. Although I’m curious to hear your results. I’ve not done any tests yet using anywhere near that many interrupt pins. I have a test planned that will use lots of pins and fire them at an ever increasing rate of fire but it will probably be a while before I have time to get that all setup.
Right now the only interrupt that is working is port 2 pin 3 since I haven’t written all the others. However, I did get everything connected and ran some tests and reviewed my timer debug.print and saw the states change appropriately. Now I just want to get the interrupt piece figured out, then I move onto trying to figure out the ENC28 on the Cerberus.
I am now creating my pins in a loop as I wanted to attach a name to them too, and I am creating the interrupt port for each in the loop and they all target the same method, and they all seem to be firing on the board. This may not work though as I had to replace a stringbuilder with a string because I was hitting the memory limit for the Cerberus when I did ToString on the string builder, and it wasn’t that big of a string. I am getting a Hydra because I need another A and X.