smb123w64gb 0 Posted April 20, 2014 Share Posted April 20, 2014 Tiva C TM4C123G EK-TM4C123GXL Energia 0101E0012 Windows 7 Ult 64-Bit I've been looking to see if their is any equivalent version of the Arduino DDRD,PORTD or some way to write pins on or off at the same time with Energia. I saw that the pins are labeled P!#(!=Letter A-F # 0-7) as port A B C D E F. I wanting to interact with something (YM2612) but it has a 8 bit data bus. Hope some one can inform me of any ways of port or ect. Quote Link to post Share on other sites
abecedarian 330 Posted April 20, 2014 Share Posted April 20, 2014 Energia provides abstraction but does not prevent direct access to ports, bytes and bits. So you could do simple OR'ing to turn ports on when you want, and keep ports on if they're already on much like one can do such in CCS or other IDE's. Nutshell is that Energia does not prevent you from going from the abstraction Energia provides to using C / C++ constructs and defines addressing the hardware directly. Or at least that's what I've gathered over time. Quote Link to post Share on other sites
energia 485 Posted April 20, 2014 Share Posted April 20, 2014 Accessing the port registers on TivaC can be a bit tricky. It's easier use the driverlib. You will get low level access without to much overhead. For example, the GPIOWrite function can be used to write directly to a GPIO register setting/clearing multiple bits at a time. For API details see ----------- GPIOPinWrite Writes a value to the specified pin(s). Prototype: void GPIOPinWrite(uint32_t ui32Port, uint8_t ui8Pins, uint8_t ui8Val) Parameters: ui32Port is the base address of the GPIO port. ui8Pins is the bit-packed representation of the pin(s). ui8Val is the value to write to the pin(s). Description: Writes the corresponding bit values to the output pin(s) specified by ui8Pins. Writing to a pin configured as an input pin has no effect. The pin(s) are specified using a bit-packed byte, where each bit that is set identifies the pin to be accessed, and where bit 0 of the byte represents GPIO port pin 0, bit 1 represents GPIO port pin 1, and so on. Returns: None. ----------- abecedarian 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted April 20, 2014 Share Posted April 20, 2014 Please refer to SOLVED - Writing and Reading the Values of an 8-bit Port with Energia on the sister forum Stellarisiti. Quote Link to post Share on other sites
KR1 1 Posted December 18, 2015 Share Posted December 18, 2015 Please refer to SOLVED - Writing and Reading the Values of an 8-bit Port with Energia on the sister forum Stellarisiti. This link does not work anymore Quote Link to post Share on other sites
abecedarian 330 Posted December 18, 2015 Share Posted December 18, 2015 @@KR1 - try http://forum.43oh.com/topic/7136-solved-writing-and-reading-the-values-of-an-8-bit-port-with-energia/ *edit- never mind. You found it. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.