Jump to content
43oh

[stellaris] Pb with GPIO Ports.


Recommended Posts

Hi Guy !

I trying to programming an emulator of UV-PROM with the Stellaris Launchpad.

and, i have a problem with use port.

I probably not understand the concept. please help me !

I use #define for "replacement" of lot of commands :

 

 

// like P2OUT on MSP430 ?
#define BUSDATA GPIO_PORTB_BASE  

//(like P2DIR =B00000000 ?)
#define BUSDATA_HIGHZ ROM_GPIOPinTypeGPIOInput(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 );

//(like P2DIR =B11111111 ?)
#define BUSDATA_OUTPUT ROM_GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7 );
 

 

I'd like write an octet on one step for the data bus (PORTB), and, after, i toggle this bus on high impedance (input state).

there is a another method for put port in input or output state ?

 

// Data bus in output state. 
BUSDATA_OUTPUT;


  // Send DATA While Output_Enable/Chip_Enable == 0
    BUSDATA = Eprom[addr];  // like P2OUT = Octet in MSP430....
                            // byte Eprom[size_of_eprom];
                            // int addr; //index in Eprom array. 

// after :   
// Data bus in HighZ (input state).
BUSDATA_HIGHZ;
 

i've an error of compilation in BUSDATA = Eprom[addr];  =>  "error: lvalue required as left operand of assignment"

and, i don't sure of my syntax for put PORTB in output/input...

 

can you help me please ? thank you !

 

JY.

 

ps:sorry for my english, it's bad, but i working for increase my level.

 

Link to post
Share on other sites

Thanks, i go read this another forum.

i'm looking for an another solution, or, if not, i must read a new time the datasheet...
but GPIO paragraph is not clear for me :( (my bad english, maybe...)

Energia is a wonderfull program, the hardware abstract level is very comfortable.
i was hoping use my stellaris with a minimum effort. but it's not totaly true. logic !

the magic commands don't exist maybe..hum. :(
Why there is no command (in arduino/energia) to toggle the state of a port at one time ? mystery ! ;)

thanks for reading,

best regards,
JY

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...