Avoiding GPIO pin mode conflicts

Discussion in 'General Programming Discussion' started by MatsPojken, Mar 20, 2014.

  1. MatsPojken

    MatsPojken New Member

    Joined:
    Dec 2, 2013
    Messages:
    7
    Likes Received:
    1
    Reading "UDOO Starting manual (beta) Version 0.4" chapter 5.3 makes me nervous. Do I have to manually compensate and match the pin modes of the GPIOs as seen from the two processors concerned?
    An example:
    Before I upload and start a sketch to the SAM, with GPIO pins set to different modes, do I manually have to set the correct mode of the pins as seen from the i.MX6 in order to avoid the conflicts depicted in page 30 (Chapter 5.4)?
    If the answer is yes, I'll become very disappointed to find the two processors of UDOO so very tightly coupled that they cannot act independently of each other. Like starting a sketch in the SAM and then go on doing something else interactively with the i.MX6 without risking the GPIO conflicts described on page 30.
    Please, make me calm again!
     
  2. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    If you are using the SAM part only , just program like you would do normally.

    What they are saying is , DON`T run the blink sketch which uses pin 13 , if you are using an code on the multi core part which is used for output on gpio 40 .
    So if you are running any code on the multi-core part make sure it`s set to input on the SAM part first.

    By default both CPUs have their direction set to input ( safety mode ) , so program away , just remember that both sides should not be output at the same time.

    I`m using the SAM part all the time without fear , because I know I`m not using any of the pin on the multi-core part.

    If you are using just normal gpio pins and not the special pins like SPI and I2C , try saying the SAM get the side pin and multi core gets the back ones.
     
  3. MatsPojken

    MatsPojken New Member

    Joined:
    Dec 2, 2013
    Messages:
    7
    Likes Received:
    1
    OK, thanks peter247, so with my own words:
    Upon boot (or reset?) all pins are in input mode (didn't know that) as seen from both "sides". SAM gets a sketch uploaded and almost always takes the initiative to set the mode of the pin. And as long as I don't load or drive the pin in the wrong way and take care that "somebody" doesn't set the pin mode to out in the i.MX6 (multi core, with your words) everything is OK?
     
  4. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Page 34 of the manual :-

    External pins are set in input mode, in order to prevent problems with SAM3x8E
    signals.

    Not sure you could say that is true , each side set it own pins , they are just connected together !!!!
    So if both side are set to output , side A low and side B high , current flow through one driving the other ( BANG ),
     
  5. MatsPojken

    MatsPojken New Member

    Joined:
    Dec 2, 2013
    Messages:
    7
    Likes Received:
    1
    Thank you. Now I'm calm again and know how to work with my UDOO.
     

Share This Page