"

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

pmod output

edited December 2017 in General
I want to use extra leds in my project but I have troubles. I am using emsk em5d.
My problem is "How to make a pin in pmod 'high' or 'low' "
I can control LED 0~8 by following code :gpioRegs[SWPORTB_DR] = (unsigned int );
Can I just do what I do above to control the output of pmod ?
I think I should connect portA or portC to some pmods with mux and then control the output by "gpioRegs[SWPORTA_DR]" and "gpioRegs[SWPORTC_DR]"
but I 'm not sure if it is correct.

I am using metaware as my IDE.

thanks

Comments

  • I want to use extra leds in my project but I have troubles. I am using emsk em5d.
    My problem is "How to make a pin in pmod 'high' or 'low' "
    I can control LED 0~8 by following code :gpioRegs[SWPORTB_DR] = (unsigned int );
    Can I just do what I do above to control the output of pmod ?
    I think I should connect portA or portC to some pmods with mux and then control the output by "gpioRegs[SWPORTA_DR]" and "gpioRegs[SWPORTC_DR]"
    but I 'm not sure if it is correct.

    I am using metaware as my IDE.

    thanks

    Hi Neko,
    yes, to control output of GPIO you need two steps: a) set up the PMOD mux register to determine how the PMOD ports are used, if they going to be used for I2C/SPI or GPIO or UART. 2) Once the pmods are correctly connected to GPIO port, use the GPIO access APIs provided in embarc to control its directions(input or output), and output levels.
    You could follow the way how LEDs are used in examples, MUX initializaion and setup could find in files under \embARC\board\emsk\drivers\mux.
    Hope this answers your question,thanks.
    -Elliot
  • edited December 2017
    @elliotc

    Thanks
    There is still a problem.I don't have those example files.
    Now I know how to do ,so I'll keep going on.
    Fight!!
    Thanks for your help :smile:

    Neko
  • hi Neko,
    You could download embarc packages, now everything is available on github:
    https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp/releases
    Please take a look at this post as well.
    https://forums.embarc.org/discussion/125/new-2017-03-release-of-the-embarc-open-software-platform-osp-is-now-available-for-download#latest
    If your EMSK is kind of old, you could download previous embarc packages https://forums.embarc.org/categories/downloads, as early as 2015.
    Actually you could read/play with some simple examples from the 2015 packages which are removed in later packages. They are simple but IMHO it's useful to get familiar with embarc software framework.
    HTH and good luck.
    -Elliot
  • @elliotc

    Hi elliotc
    I.....I did it !!
    Wanna cry :blush:
    Thank you so much

    Neko
  • Well done:)
Sign In or Register to comment.