This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

problem in UART5 tm4c123 it will not tx only and also not rx

#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif

//*****************************************************************************
//
// The UART interrupt handler.
//
//*****************************************************************************
unsigned char ch;
void
UART5IntHandler(void)
{
uint32_t ui32Status;
unsigned char ch;


//
// Get the interrrupt status.
//
ui32Status = ROM_UARTIntStatus(UART5_BASE ,true);

//
// Clear the asserted interrupts.
//
ROM_UARTIntClear(UART5_BASE, ui32Status);

//
// Loop while there are characters in the receive FIFO.
//
while(ROM_UARTCharsAvail(UART5_BASE))
{
//
// Read the next character from the UART and write it back to the UART.
ch=ROM_UARTCharGetNonBlocking(UART5_BASE);
ROM_UARTCharPutNonBlocking(UART5_BASE,ch);

}
}

//*****************************************************************************
//
// Send a string to the UART.
//
//*****************************************************************************
void
UART5Send(const uint8_t *pui8Buffer)
{
int i;
//
// Loop while there are more characters to send.
//
while(*pui8Buffer)
{
//
// Write the next character to the UART.
//
ROM_UARTCharPutNonBlocking(UART5_BASE,*pui8Buffer++);
for(i=0;i<1200;i++)
{
}
}
}

//*****************************************************************************
//
// This example demonstrates how to send a string of data to the UART.
//
//*****************************************************************************
int
main(void)
{
//

//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_12MHZ);

// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART5);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
ROM_UARTClockSourceSet(UART5_BASE,UART_CLOCK_PIOSC);

//
// Enable processor interrupts.
//
ROM_IntMasterEnable();

//
// Set GPIO A0 and A1 as UART pins.
//
ROM_GPIOPinConfigure(GPIO_PE4_U5RX);
ROM_GPIOPinConfigure(GPIO_PE5_U5TX);
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_4 | GPIO_PIN_5);

//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART5_BASE,ROM_SysCtlClockGet(),115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));

//
// Enable the UART interrupt.
//
ROM_IntEnable(INT_UART5);
ROM_UARTIntEnable(UART5_BASE, UART_INT_RX | UART_INT_RT);

// //
// // Prompt for text to be entered.
// //
// UART5Send((uint8_t *)"Enter text:welcome to india ");

//
// Loop forever echoing data through the UART.
//
while(1)
{


}
}

  • Hi manjunath,

    First why all the info in the title (which is not far from simply "this does not work").
    Second the code has the comments wrong, if you aren't gonna put any explanation of what you are trying to do at least keep those correct. You could be trying to so many things.

    So basically: provide more info! Even if English isn't your first language, that can be copped with :)
    What are you trying to achieve?
    How did you test your UART? It's connected to a scope, computer, other IC?
    Simply nothing is sent/receive or is there some garbage values?
    Have you been able to achieve communication with whatever you are trying with simple methods that don't involve the complication of an interrupt?

    More questions:
    What board are you using? Is it custom? If it's the launchpad I am pretty sure that the external crystal is 16Mhz and not 12Mhz.


    I can at least think of 2 more questions to ask and there's probably more...

    If you truly want to get help you need to actually contribute to the resolution of the problem and not make the users that could help do all the work
  • Bravo Luis - poster guidelines - and (some) enforcement - so needed...

    Let the record show that (again) a "Luis post" receives "multiple Likes" (how rare & fine - that!) - one even from "G" of MSP land.
  • Looks like my good old thread about forum usage in the MSP430 forum would be useful here too :)
  • I agree Jens!

    But how many would actually read it?
  • Luis Afonso said:
    But how many would actually read it?

    That's quite easily handled, Luis - if the posts do not follow official forum guidelines - they remain "silent."   (i.e. post may be read - but "Post" button is disabled!)

    By enabling the forum to run as the, "Wild West" - undisciplined, poorly considered/composed posts arrive daily - wasting both space & time.

    Jens has long presented such a guideline - as have I - both "duly considered" yet deemed, "too hard" and the wild west rides on - guns blazing!

    *** Luis - to be so honored by Jens is quite terrific - 4 "Likes" (1 from Jens) - that's momentus!!!   (perhaps only Jens & Amit have achieved that...)

  • "Jens has long presented such a guideline - as have I - both "duly considered" yet deemed, "too hard""

    I just learned that my thread is still being referenced or taken as guideline reference by some 'officials' in other forums. Yes, the proposed rules might be a bit hard, but then, for a noob, restrictions should be tighter than for an experienced member. So harmless violations, even regularly, can be tolerated by someone who is around for a larger time and has done a number of posts, while someone who does his first posts and doesn't have any experience, those rules should be applied more strictly.
    After all, many people, even educated ones, roam the Internet without even really knowing what they do and what the (even long-time) implications are.

    P.S.: I usually don't give likes. I don't like the liking system at all. Maybe it reminds me too much of Facebook, and I have a Facebook-phobia. But sometimes, I give a like rather than replying with a 'I agree' post, even if I will not get the 10 points for a post that way (well, I have enough points already) :)
  • Breaking News!   JMG: "Time to say goodbye - I don't have the time anymore to read and answer forum posts."

    Oh my!   A singular legend departs - forum will not be the same!

    Your posts were notable not just for their volume - but for their depth, breadth & caring - as well.

    Jens - please note that your work here was very much appreciated - and continues (w/posts "frozen in time") to the benefit of many, many others.

    While not strictly "work-centric" the argument can be made that the variety & regularity of your "tech assists" surely "spun-off" to your, "day job!"

    You'll be sorely missed my friend.   Great thanks for your many years of hard work in the assistance of others!

  • 'While not strictly "work-centric" the argument can be made that the variety & regularity of your "tech assists" surely "spun-off" to your, "day job!"'

    Well, you'd be surprised, but ion all those years, I never did a private project with microcontrollers. It was enough working with them at work. I also only did a few private coding projects (actually, only two riddle-solvers for an online game).
    So my appearance here was only due to work, and while I enjoyed the time here, my job was the main reason why I stayed. Of course I got a lot input from here and my job profited much from the insights I collected from problems others described before I hit them myself.
    It would be much harder to leave (well, as you see, I'm not completely gone) if I still had some private interest on staying here (on the tech side, that is). It still feels like parting from family.
  • Hello JMG,

    I have read your forum post on "Guidelines" and I in my full honesty would agree with it. The trouble has been steering new-comers (and it shall remain)

    Regards
    Amit
  • Amit Ashara said:
    The trouble has been steering new-comers (and it shall remain)

    Pardon - but like the ostrich - burying it's head in the sand in face of the charging lion - the problem does not have to remain!   (ostrich can choose to run - the forum can "include JMGs (& perhaps) other, newer points" as "Guidelines" - embedded w/in each new post.)   Such completely eliminates poster's "search" for (most needed) forum guidance - and if not followed - a simple, "post does not comply w/forum guidelines" vendor response - has been proven to quickly/easily correct!"

    "It shall remain" indeed "remains" ... but (likely) as an, "NIH" suppressing device - not for any logical (or effective) forum improving reason!

  • Hello cb1,

    In the current context of the forum. The requirement to have a Window-1: Troubleshoot followed by Window-2: Search followed by Window-3: None of the 1-2 helped so post, would be the ideal case. Also auto filling the post header with similar post headers(bugzilla does it way good) would be mandated.

    Regards
    Amit
  • Pardon Amit - but I cannot (begin) to parse your recent writing. (and that's highly unusual)

    Forum Guidelines - as I years past demonstrated & proved (right here) can be easily embedded w/in each/every "New Post" - thus cannot be missed!

    Your use now of Window 1, Window 2, Window 3 reminds of (another's) posts here - in which the central issue is avoided by a bombardment of "other issues." (it is always wise to watch the magician's "off hand.")

    When HQ decides and ordains that "only they know best" we are left w/the situation as it now stands - but nothing (proven ineffectual) here (really) must remain!  (instead it is (rather clearly) mandated to remain - is it not?)

  • Hello cb1,

    I did suggest the "embedded w/in each/every New Post". HQ remains reluctant as other forums "don't" need it. This was with the alternative of Window-1,2,3 approach as well. Only with another Major upgrade on the forum can something be done for either approach and I have made sure every feedback of mine to the Forum Mgmt Team goes as "how to not post when someone has an issue to report/debug and instead get the answer(s) while posting"
    Regards
    Amit
  • Amit Ashara said:
    HQ remains reluctant as other forums "don't" need it.

    Many here would love to read/see the "comprehensive study & review" which confirmed that (other) forums "don't" need Poster Guidance!   I very much doubt that.

    As a pilot - and having friends who are commercial pilots - there is ALWAYS a, "pre-flight craft & personnel checklist!"   And these are for (clearly) well experienced and highly skilled individuals.   Yet HQ - in their assumed deep wisdom - declares such checklist/guidance as, "Not needed!"   Really?   (on what planet?)

    Might it be that very, "Don't need it" (attitude) is clearly responsible (causal nexus) for the many (& ongoing) posts proclaiming, "Does not work!"

  • I think this discussion is highly off-topic now. And we, as advocates of forum guidelines should give a good example.

    However, some ideas to the previous comments:
    When a new user (less than x posts) hits the 'reply' button, he should see a popup window asking him whether he really wants to directly reply to the previous post or rather start a new thread. Also a popup for even not-so-new users when the thread is quite old.
    When starting a new thread, the new user should be advised to search the FAQ, the forum or the Wiki first. And to read the posting guidelines. Visiting the guidelines page should be mandatory for users with 0 posts.

    However, the forum software is not written by TI but rather an external company. And changes are apparently difficult to communicate and slow to implement (considering all the 'loose ends' still in the current version)

    p.s.: 'reality' is what the majority _believes_ to be real. The minorities who think different are called lunatics (or put into asylum).
  • There is another possibility that has proved effective in large groups.

    Generally called first post moderation.  New users are subject to approval by moderator(s) until they've shown the ability to write meaningfully.

    The downsides are

    • it does require moderator attention although as long as post from new users are small it's not a lot
    • new user will see a delay, especially over holidays, before their post is visible.

    BTW, Amit, on the question of other forums not needing it; keep in mind that volume plays a big role. What is an easily ignorable item when there is a post or two a day becomes an overbearing irritant when the volume of posts rise even when the percentage of irritating posts remains constant.

    Robert

    I also suspect the ARM space is attracting more newcomers than the more established lines.

  • Moderation is sometimes a good thing. But considering how impatient some people are, posting 'push' messages when they don't get an answer within 1/2 hour (posting from a country where there is day when the rest of the world is sleeping), guess what will happen if they don't see their post appear at all within half an hour? They will flood the poor moderator with identical posts. :(
  • Hello Robert

    I agree with JMG. Moderation is far much more difficult than responding. And I have seen users putting a new post for even replies on this forum.

    Regards
    Amit
  • Well that case in particular is at least easy to deal with.

    I do get your point though.

    I mention because I have seen it used in similar (although larger) technical groups with a part time moderator. It didn't appear to be a burden but then I wasn't sitting at their shoulder. We only have a few posts at most from newcomers each day here.

    OTOH, I run against the grain on this. I don't think we've got a problem.

    Robert