Programming Eth Mainboard

Its still the same as before minus the Thread.Sleep. I thought that it might be because i was referring to port 75 which is the onboard LED which is only available from plain vanilla and not gadgeteer. So i changed it to 79 which should be pin 9 on socket 1 which i have another LED plugged into.

namespace GadgeteerApp2
{
public partial class Program
{
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
OutputPort LED;
LED = new OutputPort((Cpu.Pin)79, true);
Debug.Print(“Program Started”);
}
}
}

Paste in the full code including the using statements and wrap it with the code tag the binary icon

there are several unused usings just fyi.


using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Hardware;

using Gadgeteer.Interfaces;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace GadgeteerApp2
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            OutputPort LED;
            LED = new OutputPort((Cpu.Pin)79, true);
            Debug.Print("Program Started");
        }
    }
}

Hi Architect, thanks for those links i’m surprised that GHI doesn’t have them listed under Support Tab for the Product… Gus???
i was just there looking for the latest update for the Mountaineer Ethernet and couldn’t find any links.

looking forward to getting my new board up and running yay since the spider decided to take a FORCED vacation…

try this - (untested)

using Gadgeteer.Interfaces;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;

namespace GadgeteerApp4
{
    public partial class Program
    {
        private GT.Timer _timer;
        private GT.Interfaces.DigitalOutput pin;
        void ProgramStarted()
        {
          pin = new DigitalOutput(GT.Socket.GetSocket(1,true,null,string.Empty),GT.Socket.Pin.Nine,true,null);
            _timer = new GT.Timer(500);
            _timer.Tick += new GT.Timer.TickEventHandler(TimerTick);
        }
        void TimerTick(GT.Timer timer)
        {
            pin.Write(!pin.Read());
        }
    }
}

FWIW (assuming I am reading this correctly) from this doc: http://www.mountaineer.org/app/download/6084112575/MountaineerETH_sch.pdf?t=1339693217

It looks like socket 1 pin 9 = GPIO 15; which looks to be Cpu pin 46 (image 1 is Socket 1, image 2 is the corresponding CPU pin for 46)

Pin 79 is SPI3_MISO, which looks to correspond to socket 5 pin 8. (image 3 is Socket 5 and image 4 is the corresponding CPU pin for 79)

That said, Justin’s approach is the preferred way.

The links are at the bottom of the each product description.

79 is correct for Pin 9 on Socket 1. At least according to this document:

http://www.mountaineer.org/app/download/6083577075/Mainboard+Mainboard+Sockets+V20120530.png?t=1338403683

It is also easy to calculate (A+B+C+D)*16+15

Hmm … what am I interpreting incorrectly from the images I posted (I’m still trying to learn)?

This is how I (obviously incorrectly) read it:

image 1 shows socket 1. Pin 9 shows GPIO 15.
image 2 shows processor pins - GPIO 15 is on pin 46

What did I miss?

Sorry - I don’t get the (A+B+C+D) * 16 + 15 formula.

Also, the Mtn Ethernet board only has 8 sockets - 3 on each side and 2 opposite the Eth port. But the document you showed has 9 sockets. The USB board has 9 sockets.

All GPIO pins are grouped into ports. There are 9 ports labeled A,B,C,D,E,F,G,H,I
Each port has 16 pins (PA0-PA15, PB0-PB15, etc). Internally each pin has a number PA0=0, PA1=1 …, PB0=16, PB1=17, … etc.
46 is the physical pin number on the chip for GPIO PE15 which is 15th pin in Port E. Before E there are 4 ports (A,B,C,D) so the actual number is 4*16+15=79

1 Like

I have just tested your code on my Mountaineer USB and it works just fine. Make sure your led is good and polarity is correct. Also don’t forget to use a resistor with the led.

@ Architect: sorry to piggy back on this post but i was wondering if you can tell me, when you open your MFDeploy and VS2010 does your Mountaineer’s name show up with the extra characters as displayed in the picture on my post here: http://www.tinyclr.com/forum/topic?id=8560
thanks.

@ Jay Jay - Yep, same thing here.

but i imaging you can ping it in MFDeploy correct?
i promise i won’t hijack this post anymore after this answer…

thanks.

Thanks for the explanation! I can take the rest of the day off … I’ve already learned my something new for today :smiley:

If you would … what about the images I posted yesterday? Since I’m reading those incorrectly, how should they be read to get the pin #? (I’ve re-attached them here)

Both are from the Mountaineer page:
Image 1 is Socket 1
Image 2 is (what I believed to be) the CPU pins.

Socket 1 Pin 9 == GPIO 15
GPIO 15 is (what I thought to be) pin 46

If 46 isn’t CPU pin 46, then what is 46 representing?

@ Jay Jay - Yes, MFDeploy pings fine. I had one small hick-up with the board after switching to WinUSB driver, but after using different usb port everything is back to normal.

@ mhectorgato - 46 is important when you do routing. It is the physical pin/ball/pad of the IC that is soldered on the PCB. The same IC can come in different packages so that number can be different between different different packages, but the internal pin number (PE15=79) will not change.

1 Like

My incorrect assumption that this was the CPU pin #.

Thanks!

Did you run it with an LED/resistors connected or did you just debug it. Because i have a 100 ohm resistor hooked up to the green pin on the LED and it debugs fine but the LED doesn’t light up.

@ UofLTCI - Yes everything was connected and LED lit up.

Did you verify that LED is ok?