• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » UART interrupt
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

UART interrupt

This question is answered
michael burke79518
Posted by michael burke79518
on Sep 14 2011 15:32 PM
Intellectual400 points

I am using the C6678.  I want to use SYSBIOS to set up a HWI with the UART receive event, which in the Data Manual says has an event # 149.  When I try to use this event Id in the SYSBios, I get the error "eventId (149) must be less than 128".   What am I doing wrong? 

Mike

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • michael burke79518
    Posted by michael burke79518
    on Jun 19 2012 13:15 PM
    Intellectual400 points

    CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, myrxint, 148, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();

     

    This is wahat I did for a uart receive interrupt.  Worked pretty well.  Close to what you have though, so I'm not sure whats wrong.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Jonathan Sixt
    Posted by Jonathan Sixt
    on Jun 19 2012 16:02 PM
    Prodigy170 points

    Hey Michael,

    Yep that is where I got it from.  I was not getting the interrupt to fire, and I was not getting any help anywhere else so I thought I would post what I have here and see if I got any bites...   I am sure I am missing something...  And I have no idea what it is...  I will recompile with your code.  Can you post the myrxint method that you have maybe there is something in there, although when I set the breakpoint I never get to it..??

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • D C
    Posted by D C
    on Jul 25 2012 17:08 PM
    Verified Answer
    Verified by David Friedland
    Prodigy30 points

    I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly.  Gotta love TI Support.  

    The actual answer:  You have to do the above to connect the peripheral interrupt via SysBios to the Callback routines (6 separate function calls?  Really? I thought this was supposed to make development easier!).  However, that is not enough.  You also need to use CSL to set up the peripheral itself to generate interrupts.  The SysBios setup does absolutely nothing to the peripheral.

        // Force the Transmitter and Receiver into reset mode before init
        hUartRegs->PWREMU_MGMT = CSL_UART_PWREMU_MGMT_RESETVAL;

        platform_uart_init();
        platform_uart_set_baudrate(115200);

        //FCR- Fifo control reg - Enable fifos, disable DMA, Set Fifo trigger to 8 chars
        CSL_FINS (hUartRegs->FCR, UART_FCR_FIFOEN,   CSL_UART_FCR_FIFOEN_ENABLE);
        CSL_FINS (hUartRegs->FCR, UART_FCR_TXCLR,    CSL_UART_FCR_TXCLR_CLR);
        CSL_FINS (hUartRegs->FCR, UART_FCR_RXCLR,    CSL_UART_FCR_RXCLR_CLR);
        CSL_FINS (hUartRegs->FCR, UART_FCR_DMAMODE1, CSL_UART_FCR_DMAMODE1_DISABLE);
        CSL_FINS (hUartRegs->FCR, UART_FCR_RXFIFTL,  CSL_UART_FCR_RXFIFTL_CHAR8);

        // UART.IER Interrupt Enable Register
        // ERBI for Data Ready and Fifo trigger including timeout
        // ELSI for overrun, parity, framing errs
        // ETBEI for Transmitter empty interrupt
        hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK);
        //hUartRegs->IER = (CSL_UART_IER_ERBI_MASK + CSL_UART_IER_ELSI_MASK + CSL_UART_IER_ETBEI_MASK);

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Alan DeMars
    Posted by Alan DeMars
    on Jul 25 2012 18:35 PM
    Genius14105 points

    I'm glad you were able to add to this thread.

    Regarding this comment: "I love the way this is marked as "Answered" while the last two posts are questions where the users code does not work properly.  Gotta love TI Support. "

    If you scroll back in the thread, I think you'll notice that the question was marked Verified by the original author of the post.

    Alan

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 08 2012 23:35 PM
    Intellectual925 points

    Hi jonathan,

    I have a same question.

    I try  two type code,but it didn`t call my interrupt sever routine.

    My code is here:

    CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, (CpIntc_FuncPtr)myrxint, NULL, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();


    /*CpIntc_dispatchPlug(CSL_INTC0_UARTINT, (CpIntc_FuncPtr)myrxint, NULL, TRUE);//后添加

    CpIntc_mapSysIntToHostInt(0, CSL_INTC0_UARTINT, 32);//后添加

    CpIntc_enableHostInt(0, 32);//后添加

    CpIntc_enableSysInt(0, CSL_INTC0_UARTINT);//后添加

    eventId = CpIntc_getEventId(32);//后添加

    EventCombiner_dispatchPlug (eventId, CpIntc_dispatch, 32, TRUE);//后添加*/

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 13 2012 03:04 AM
    Intellectual925 points

    Hi,judahvang

    I try to use http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/355/2664.tests.zip.But the interrupt routine not be called.

    Use 6678.

    My code like this:

    void idl0Fxn(void)
    {

    CpIntc_postSysInt(0, 15);


    }


    void event15Fxn()
    {
    event15Done = TRUE;
    }

    void main()
    {
    Hwi_Params params;
    Int eventId;

    printf("Running LX_uart\n");

    UartInit();

    CpIntc_mapSysIntToHostInt(0, 15, 8);

    CpIntc_dispatchPlug(15, (CpIntc_FuncPtr)&event15Fxn, 15, TRUE);

    CpIntc_enableHostInt(0, 8);

    eventId = CpIntc_getEventId(8);

    Hwi_Params_init(&params);

    params.arg = 8;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 6;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    // CpIntc_enableSysInt(0,15);

    // Hwi_enableInterrupt(5);

    // Hwi_enable();

    printf("main compelet\n");
    BIOS_start();


    }

    please tell me why? 

    Thanks 

    LI

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Aug 13 2012 15:45 PM
    Genius15630 points

    Li,

    Were you able to get any of the SYS/BIOS examples to work?

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 13 2012 19:42 PM
    Intellectual925 points

    HI,

    Thank for your reply.

    I got some examples ( which from e2e forums)and coding like these,but i`m not sure the code is right.

    I have read SYS/BIOS 6.32.05.54 GA Release Notes and anything i can get.

    I think that I have understood c66 interrupt and uart init,but the code is still not OK.

    Can you give me some suggestion or example? And Please tell me where is wrong in my code?

    Thanks,

    Li

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 13 2012 22:06 PM
    Intellectual925 points

    Hi todd,

    I want to use FIFO-interrupt mode of UART receiver.

    Uart  system interrupt id is 148.so i code like this:

    CpIntc_mapSysIntToHostInt(0, 148, 32);//core 0

    But i found when i called "eventId = CpIntc_getEventId(32);"

    the eventId is 255,i think it`s wrong.but did`t know why?

    My code is following:

    CpIntc_mapSysIntToHostInt(0, 148, 32);

    CpIntc_dispatchPlug(148, (CpIntc_FuncPtr)myrxint, NULL, TRUE);

    CpIntc_enableHostInt(0, 32);

    eventId = CpIntc_getEventId(32);

    Hwi_Params_init(&params);

    params.arg = 32;

    params.eventId = eventId;

    params.enableInt = TRUE;

    params.priority = 2;

    Hwi_create(5, &CpIntc_dispatch, &params, NULL);

    Hwi_enableInterrupt(5);

    Hwi_enable();

    Thanks Todd

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    UART 6678
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Aug 14 2012 18:48 PM
    Genius15630 points

    First can you please verify that you can get any of the SYS/BIOS examples (e.g. Task Mutex) to work.

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 14 2012 20:13 PM
    Intellectual925 points

    Hi Todd,

    Yes,I can. Yesterday,I have resolved the problem with API eventcombiner.

    I have some question:

    Q1:What is the different between eventcombiner (to map hwi) and Hwi create(to map hwi).

    Q2:If I want to use Hwi create,How to use it correctly.I have try many times but still failed.

    Q3:The question about

    CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE);

    if I use it like this, it looks like wrong.

    But if i use like the folllowing:(event15Fxn the function is void return)

    CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);

    It is right.

    I have read

    SYS/BIOS 6.32.05.54

    API reference.

    I think it need a func address.

    Thanks,

    Li

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 15 2012 03:40 AM
    Intellectual925 points

    Hi todd,

    Sorry , I try to use CpIntc_dispatchPlug(15, &event15Fxn, 15, TRUE) and CpIntc_dispatchPlug(15, event15Fxn, 15, TRUE);

    The both all right.

    But used Hwi_create to create a hwi still failed.

    I used CpIntc_postSysInt for test.But not to work(it meant the hwi create failed)

    I have another question today:

    I continually send data from PC,Mostly it can call interrupt routine only once.

    The reason is about BIOS or UART or CPU?

    Thanks,

    Li

     

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    BIOS interrupt uart
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • ToddMullanix
    Posted by ToddMullanix
    on Aug 15 2012 09:48 AM
    Genius15630 points

    Li,

    Can you start a new post when you have a new question? It makes it easier to answer the question and for other forum users to search and find answers.

    Todd

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • xiang_li
    Posted by xiang_li
    on Aug 15 2012 10:16 AM
    Intellectual925 points

    Hi todd,

    Sorry, I start a new post last week. But nobody answer me. Thank you.

    I will start a new post again.

    Thanks,

    Li

    Don't forget to verify answers to your forum questions by using the green "Verify Answer" button.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use