Kurt's Arduino Mega Shield

Look real good.
Not a lot of mistake :slight_smile:

Thanks, maybe a fewā€¦

On the buttons, I probably should add a PU resistor to them as chipkit does not have them on all pins. The buttons are on 39, 41, 43. I believe 39 and 41 have one which I could use, but probably better to add simple one on the board itselfā€¦

Have tried some servo tests and I am not getting any signal on some of the IO pins (24, 26, 27, 32, 34). Trying to debug now to see if connection issue or???

Kurt

If you add PU resistors, do you have jumpers on the switches (so the resistors can be removed from the circuit)?

Alan KM6VV

Nope, not yet. But then these IO pins are hard coded on the shield, IE the only access to them is the buttons, and of course the stack-able headers.

Have been doing some more investigation of why 5 IO pins are not working. It turns out 3 are sort-of by design (24, 26, 27). These are input only pins associated with the on chip USB, so a bad choice to use on my shieldā€¦ 32 and 34 should work, but for some reason they are acting like they stackable header pins on the shield are making good contact with the socket on the main board. For now will simply punt and use other pinsā€¦

Kurt

P.S. - as for making any changes to the boardā€¦ Not sure if I will or not as this may work good enough for me as isā€¦

Not that you need a change, if theyā€™re already dedicated to PBs. I hadnā€™t heard that, at least not on the UNO.

Alan KM6VV

I should be more specific here, the IO pins are dedicated to pushbuttons/Leds/Speaker on my board, not specifically by Digilent or Pic32MXā€¦ :smiley:

If I were to make a Rev 2, I should also double verify that some of my uses donā€™t screw up other uses, like connections for SPIā€¦ Also need to try it out with Arduino Max32. May also add in a Jumper to disable the XBee portions. That is the connection from +5V to the Voltage regulator going to XBee and the like. No use using the power if you are not doing something. But still need to do a lot more testing (playing) to see what else I would think of changingā€¦

Kurt

ā€œDisableā€ jumpers are a wise idea. Watch out for the motor driver boards, I expect some conflict thereā€¦

blushingboy.net/p/motorShieldV3/

comes to mind.

Alan KM6VV

Now that I wish to get back to testing my changes to the Arduino Code, I thought it would be nice if I finally built the 2nd of my Shields, such that I would have one mounted on an Arduino Mega and the 2nd on an Chipkit Max32. I finished soldering up the 2nd one today and now I am starting to put it through itā€™s paces.


Found another thing I would change if I were to build a new batch. The buttons are over the top of the large USB connector. I put some electrical tape over the connector to hopefully keep it from shorting. So far testing is going OK. I have Buttons, Leds, Speaker, PS2, I2C EEPROMā€¦

Soon will steal back my CHR-3 from testing standard Arduino code with SSc-32, to testing out the code with the servos connected to this shield.

Kurt

Hi Kurt,

Iā€™m curious if you manage to demonstrate the difference of performance between the Arduino Mega and the PIC32 MAX.
Agree that the buttons should be placed differently. I donā€™t understand why they use the large USB connector instead of the mini-USB.

Hi Zenta,

I have not done as much of that yet as I want to. It would probably be pretty easy to do with an SSC-32 controlling the servo, but harder to do with the Micro-controllers, because I believe the Servo implementations on the Arduinos has been pretty well tuned, whereas the Chipkit versions could use some helpā€¦

There is an interesting implementation, that someone did for the chipkit for allowing for a software PWM and servo control on all pins that hangs off of the system clock and does not require additional interrupts. The code tries to minimize the time in the interrupt, by using a linked list of objects in time order, such that during this interrupt callback handling, you simply walk the list, process all of the ones during your current time value and simple to find the next time unitā€¦ BUT: This implementation has some issues for me. First it is a memory Hog. That is it keeps two full copy of the servo structures.
On a Max32 there are 86 pin and for each of these it keeps 8 long values. So it is using: 86322=5504 bytes of data. Luckily the Max32 comparatively has lots of memory, but each time you are going to make a change to a servo, the code copies the current servo list to a working list, all 2752 bytes of it, has to touch up the pointersā€¦ This part can be somewhat minimized when you for example only copy the parts of the structures that change (things like pointers to IOPorts, Pin numberā€¦ donā€™t). Then when you make a change, it unlinks the one from the list, and then relinks it back in the right placeā€¦ Note: if you are lucky you may be able to get several of your changed done in one servo loop (20ms) and it will only do the copy onceā€¦
This approach may work fine for some simple programs that only move a few servos every so often. But I want to integrate in my Timed move code that will potentially update the list every servo cycleā€¦ So I have some work to doā€¦

Kurt

Hi Kurte, whatā€™s the status of Your arduino mega shield? Iā€™m interested howā€™s the testing.

I have been hacking on the Shield recently to make it work with an Arduino DUE. I had 5 boards fabricated at PCBFabexpress and assembled one of them for a Due that I recently purchased. I am in the process of doing some testing on it in the thread: viewtopic.php?f=26&t=8563

I am currently having some issues with the buttons not working on the shield. I now believe it is an issue of the back row of Stackable headers not making good contact with the headers on the DUE boardā€¦ Someone up on the Arduino forum suggested trying to stuff some tinfoil down those contacts to help make contact.

I am hacking some more on my shield design to do a few things like: have the board come in slightly on the side with the power connector such that the shield is within the lip of the power plug on the DUE and can be pressed in farther. Also added pins for the two extra pins on the top row which on DUE are for a 2nd I2C. Also added pin for unused pin the header that bring voltages from Arduino to sheild, so I can use a 1x8 connector which exist versus cutting one down to a 1x7. Also addes 2nd VS1=VS2 connection like SSC-32/ARC32ā€¦ to allow more amperage to go betweenā€¦

Not sure yet if I will make this new one. Probably after I do some more testing. May try the Sparkfun slow cheap serviceā€¦

Kurt

a DUE board?

Is your shield compatible with the UNO and Mega boards?

Alan KM6VV

In theory, the shield is compatible with Arduino Megas, Chipkit Max32 and Arduino DUE. As for Arduino Uno. They donā€™t have all of the same connectionsā€¦ Besides that would make a Botboarduino!

Kurt

Note: before I send off to fabricate a new batch of these boards, I may also try to squeeze a little more stuff on the board. In particular, I donā€™t have any 5v to 3.3v conversion except for the XBee and in the case of the DUE donā€™t need for XBee. However wondering if I need to do something about the RX for the serial ports, such that if I try to plug this into an SSC-32 I donā€™t harm it with the signal coming back from SSC-32 being 5v.

Being 5v compatible would be useful.

Alan KM6VV

Yep, I agree. Probably need to put in resister divider circuits for a couple of the RX lines. Like Serial1 and Serial2. Serial3 is setup for XBee which is 3.3vā€¦

Kurt

Actually I have been hacking on the shield design some more and will probably order myself a few more boards to populateā€¦

Currently the board design looks like:


The main differences in this version include:
a) bottom left of board is cut out some, such that the lip of power connector on the Due and probably new megas will be outside the board, which will allow the board to get lower. Hopefully help some with stackable header issues.
b) I Removed 4 IO pins and their power connections from the board to make roomā€¦ Figured I have plenty.
c) Fixed power connection. That is I screwed up and the VIOREF pin was not connected to the circuit that needed it.
d) Changed Power stackable header to 8 pins, so I donā€™t have to cut one down to 7.
e) Added 2 more pins on the digital pins header, such that I picked up (at least for jumpers) the IO pins associated with 2nd I2C on Due
f (probably most important) ) Changed how I did voltage conversion for XBee and other Serial ports. I added an 74HC244A chip to do voltage conversion. Same chip that is used in the Parallax XBee adapter. It has 2 groups of 4 pin buffer/conversion. So I used this for the 4 TX/RX lines. So I believe that this should allow me to plug in XBEE to either 3.3v or 5v system. Likewise I now should be able to plug in SSC-32 connector to TTL and have it handle the voltage conversionsā€¦ I am passing 3.3v to VDD on the chip, so I believe the RX and TX will be high on 3.3v on either voltages which I donā€™t think will create a problem.

g) ISP connector - I had this on earlier boards, but if you use it with the male pins sticking up, it would interfere with plugging in an xbee. So I plan to use standard breakable header pins sticking down from board into ISP connecor on main board. I then put in a 4 pin connector near where I have the USART connections. Note on Due this connector is not work as an ISP but is only used for SPI.

Thatā€™s all for now.
Kurt

Sounds like youā€™ve been busy!

Iā€™d suggest a header for a SparkFun BlueSMiRF, Iā€™d use that instead of an XBee.

Alan KM6VV

Yep been playing around. Actually for BT you can try something like: sparkfun.com/products/11601
Which fits in an XBee slot. However it is longer in the front and wonā€™t currently fit in my XBee location. I could easily move the XBee in a ways, but then a pro would not fit. I am thinking I may be able to move one of the power jumpers and maybe gain enough roomā€¦

Kurt

I guess that would work. No external antenna? I like the little 2.4 GHz sticks, I can use them several places. The BlueSMiRF needs 6 .025" pins. Near an edge is best, then two orientations are possible.

Alan KM6VV