luligar 3 Posted March 18, 2015 Share Posted March 18, 2015 Hi, I'm getting to grips with a Launchpad ek-tmc123gxl board, and so far it looks amazing. However I have hit a snag which is pretty painful. Consider the following code: #include <stdbool.h> #include <stdint.h> #include "inc/hw_gpio.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/pin_map.h" #include "driverlib/rom.h" #include "driverlib/rom_map.h" #include "driverlib/sysctl.h" void setup(void); #define delay(x) SysCtlDelay((SysCtlClockGet() / 3000000) * x) uint8_t sequence_1[16] = { 0x4b, 0x4e, 0xcd, ... other 8-bit values }; uint8_t sequence_2[16] = { ... another list of 16 8-bit values like sequence_2 }; int index; int main() { int i, wait; setup(); index = 0; wait = 1000; while(1) { delay(wait); GPIOPinWrite(GPIO_PORTB_AHB_BASE, 0xFF, seq_m1[index]); GPIOPinWrite(GPIO_PORTD_AHB_BASE, 0xFF, seq_m2[index]); if(++index == 16) index = 0; } void setup(void) { // Set the clocking to run directly from the PLL at 80 MHz. SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOD); GPIOPinTypeGPIOOutput(GPIO_PORTB_AHB_BASE, 0xFF); GPIOPadConfigSet(GPIO_PORTB_AHB_BASE, 0xFF, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); GPIOPinTypeGPIOOutput(GPIO_PORTD_AHB_BASE, 0xFF); GPIOPadConfigSet(GPIO_PORTD_AHB_BASE, 0xFF, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); } I am seeing how pins D0 and D1 and B6 and B7 show the following scope trace: Where a normal binary squarish wave should be seen, I'm getting two high states, one at 1.85 V and another at the nominal 3.3 (!). I provide the facts below for context: The Launchpad board is brand-new. This behavior is also what I get when using an equivalent Energia sketch. None of the Port B or D pins are connected to anything. Just to the scope probes. This code is compiled on CCSv6 and arm-gcc. Same behavior. The usage of the AHB was just a "what if..." decision. The behavior is just as present when using the default APB. I suppose I'm missing a very big catch in dealing with the ports, but I thought the TivaWare drivers were written precisely to avoid this sort of unexpected and annoying behavior? As a more basic test, I made a program that toggles all bits of Ports B and D after a 2 ms delay. In that case, the scope showed a clean square wave. The ports configuration is identical to what I showed above. Thanks for the attention! Quote Link to post Share on other sites
mgh 11 Posted March 19, 2015 Share Posted March 19, 2015 It's a great little board, isn't it! :-) In the little flyer that came with the board, on the spread that shows the header pin functions, you'll find that PD0 and PB6 are connected together. Similarly, PD1 and PB7 are also connected together. It's my understanding that this was done for backward compatibility with the older 43oh booster boards (or something like that). So, we can't drive both pins of those pairs at the same time. The user guide for the board is spmu296.pdf, full title "Tiva C Series TM4C123G LaunchPad Evaluation Board User's Guide". The schematic is in the back, and shows those pins connected together. Valvano's site has a video showing the removal of the two zero-ohm resistors; it was easy to do. This is his video link page: http://users.ece.utexas.edu/%7Evalvano/Volume1/E-Book/VideoLinks.htm Here's one link http://youtu.be/MWIX7wgS9PM And the other: https://s3.amazonaws.com/edx-course-videos/ut-embedsys/UTXUT601T114-G018400_100.mp4 Have fun! luligar, bluehash and tripwire 3 Quote Link to post Share on other sites
luligar 3 Posted March 19, 2015 Author Share Posted March 19, 2015 Hi mgh, It is indeed an amazing board, specially for the price! Shortly before your reply, I was sifting through these forums and I saw a thread about the 0 Ohm resistors you mentioned. I went back to the flyer and they show the pin pairs that are shorted in the signals diagram, but the resistors themselves, as R9, R10, were not mentioned. Sure enough, I took them out and one of my boards had its PD1 pin taken out , I guess after I tried using the stronger current drivers . On my second board, to my surprise, all 4 pins were fine! I don't see how to close an issue, if that is even intented in this forum. But I consider it closed and solved. Thanks for your quick and kind reply! Regards, Luis mgh, bluehash and roadrunner84 3 Quote Link to post Share on other sites
roadrunner84 466 Posted March 20, 2015 Share Posted March 20, 2015 @@luligar Topics are not closed on here, you never know when someone has a meaningful remark to add Quote Link to post Share on other sites
bluehash 1,581 Posted March 20, 2015 Share Posted March 20, 2015 @@luligar @@roadrunner84 I really appreciate when the OP comes back and says that they solved the issue and how they did it instead of just leaving people who helped them in the dark with an"I solved it" reply. Quote Link to post Share on other sites
mgh 11 Posted March 23, 2015 Share Posted March 23, 2015 I agree. Thanks go to Luis for the detailed followup! Also... check the schematics again and see that some other PortB pins are used for the second USB connector on the side of the board... it's another place to get hosed. 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.