@ Fradav - That is the correct documentation for the chip used on the DL40 (LPC1113/301)
You are correct, the UART TX/RX pins are exposed on the downstream socket. These pins are used to program the firmware using the UART, but they also connect to the I2C pins so I suspect that the DL40 cannot use the UART peripheral at runtime as there will be a conflict with the I2C and UART data.
It is a real pity, but I guess any other approach would have required the DL40 to have an additional socket, increasing the cost of the module. Of course the advantage would be that there would be a serial socket available for general use, which would be nice.
Another option is to do bit-banging like there is no tomorrow on the chip, as it is reasonably safe to assume it wonât do anything else on the cpu. But I donât know if it has sufficient cpu power to bit-bang at 250kbauds like Iâm trying to do, for example.
@ Fradav - Since the register ID is a byte wide this would limit you to less than 255 elements (the first 8 registers are reserved for the DL protocol). Luckily, you can treat a register as a compound value, so a single register would hold the entire array of data, and one of the other registers would have the count of items for example. This also has the advantage that you are transferring data more efficiently, because once the register is selected you can âstreamâ the value to the register.
You can see how I have done exactly this in the implementation of this module driver/firmware, registers are have more complex value structures to build up commands that are sent to the module to configure the ports etc.
1/ I have to use different edge detections for interrupts 3_1 and 3_2 otherwise 3_2 is never detected,; are they multiplexed from the same interrupt channel ? I got the impression that channels are multiplexed across ports not pins from the same port, correct ?
2/ what is the meaning of the interruptCount ? it is usually a very high number, completely irrelated to the real interrupts (typically a few per seconds)
3/ Sometimes, but especially when debugging, after a mainboard reset, the DL40 module doesnât respond anymore, and I had to unplug/plug it to get it back. This is making debug sessions very unpleasant.
@ fradav - It is a little late here, I will try run this through the debugger tomorrow.
With regard to the need to recycle the DL40, the core firmware seems to have a problem with resetting I have actually started implementing the DaisyLink protocol from the ground up so that I can see if I can resolve this and other issues from the standard DaisyLink implementation available with the DL40 and which was used as the starting point for this firmware. It is also building with GCC rather than requiring MDK.
@ fradav - Are you sure you want to use the edge level interrupts? That means that the interrupt will continuously be generated for the entire time that the pin is at that level. This would explain the crazy interrupt counts you are seeing, if your pin is at the interrupt level the interrupts will be generated and counted continuously for that period at a very high rate.
If you only want an interrupt when the state transitions then you should, for example, be using âInterruptMode.InterruptEdgeHighâ which will only trigger an interrupt at the point that the pin goes high.
The code below has both pin 3.1 and 3.2 configured to interrupt when the pin goes high and from the tests I did here I get both interrupts. Could you possibly test this and see if it works for you?
@ taylorza - of course, I should have used InterruptEdgeHigh for counting simple circuit switch, I misread the doc, my bad⌠A quick question though, the interruptcount argument of the event delegate will be always 1 in this case or we shouldnât assume this ?
@ fradav - There is some latency between the interrupts on the module and them being raised on the mainboard so it is possible if the interrupts are being generated at a high rate that more than one interrupt occurred by the time the mainboard actually gets to handle the interrupt, in this case you would get a count of the number of interrupts seen by the module at the time the interrupt is raised on the mainboard.
@ taylorza - ok, so I have to increment my counter with this then to have the exact count of interrupt over a time. Thanks you very much for your explanation.
Hi Taylorza. Nice to meet another Afrikaans person here. Iâm very impressed with what youâve done with the DL40. I ordered two modules to play with as I can see how useful they be. But I can also see there is still a lot for me to learn. For now I just have a few basic questions:
What is the resolution of the A/Dâs on the DL40 boards?
Is there some instructions somewhere how to compile the source code for you I/O code?
I presume latest code is found on CodePlex and not here on CodeShare?
Anyway, thanks again for making all this available to us.
you need to install free version of Keil uVision. I have version 4.54.0.0 (too lazy to update), but the latest version is here: Keil Software Update Request
Download latest source form codeplex.
Open DL40.uvproj with Keil
Build (F7)
Start debug session (Ctrl + F5). I donât know if you need to download first or it is downloaded automatically.
@ jernejk - Thank you very much for the detailed info. Iâm definitely going to give it a go.
I suppose that if you do not yet own a JTAG emulator, then you can still use Taylorzaâs Cerberus DL40 Programmer ( (https://www.ghielectronics.com/community/codeshare/entry/641) to program the DL40. The only drawback will be that cannot debug your code. I would just like to try first to simply compile your source code myself and then program it to the DL40, before I invest in a JTAG emulator as well.
Oh, and by the way that link that you supplied to get the free Keil tool did not allow me to download with having a license code. But I think I found the free download here: MDK-ARM Version 5.38a Evaluation Software Request
I think I know of an ideal application for the DL40⌠It is an HPIB bus controller to talk to Agilent Instruments etc. It will allow you use your Gadgeteer board to control test instruments like multimeters and power supplies in automated test equipment. There are some commercial USB HPIB bus controllers available at a cost of about $150. But controlling it via a Gadgeteer board opens up so much more possibilities.
I had a look at what a HPIB controller does and it is really not complex. But it requires a lot of I/O pins and speed. Both things that the DL40 board offers plenty of.
Sorry for not replying sooner, I literally just got back home from a trip to the States. You got excellent advice from @ jernejk, in fact he is the expert on the ADC side of the firmware as that was implemented by him.
There are a few chaps here from SA, it is a pity .NETMF/Gadgeteer does not get more visibility out there.
Thank you and credit goes to @ jernejk for his contributions and fixes as well. It is my favorite module to work with I even use it as a more general purpose chip and ignore the daisylink aspect. I keep trying to convince someone to build us a DL40 with the pins broken out to Gadgeteer sockets but alasâŚ
Your idea on the HPIB bus sounds interesting, now I have to go learn what a HBIP bus is
[quote=âtaylorzaâ] I even use it as a more general purpose chip and ignore the daisylink aspect.
[/quote]
Thanks, this is great to hear because confirms what I hoped for. That it can make a very nice low cost standalone CPU board. It would be very cool to get something like a Bluetooth or RFpipe interface going on it. Then it can still wirelessly talk to a Gadgeteer mainboard but can work completely independently as well.
Actually I incorrectly called it HPIB but what I should have said was GPIB (General Purpose Interface Bus). It used to be called HPIB a long time ago when HP was still the driving force behind it. A lot of automation instrumentation still use GPIB although these days some instruments provide more modern interfaces. Basically it was loosely based on the old Centronics printer interface and they chose a parallel interface rather than a serial interface. (My guess is that the fast interfaces like we get today was unheard of when this was designed).
You can sometimes buy very nice GPIB capable instruments cheaply second hand on places like Ebay. I recently bought myself two Agilent power supplies on which you can control and measure current and voltage very precisely.
Just one last bit of feedback⌠everything worked. I used the free version of the Keil compiler to re-compile your source code and program my DL40 boards using the Cerberus DL40 codeshare project and finally tested that I could read some A/D values coming from the DL40 board. Iâm surprized there is not a lot more people using the DL40 module as it makes all this extra I/O capability available and only uses a single socket.