1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

VicIntEnable Register of LPC2148

Discussion in 'ARM' started by Twisted_transistor, Apr 1, 2013.

  1. Twisted_transistor

    Twisted_transistor New Member

    Joined:
    Jul 22, 2012
    Messages:
    23
    Likes:
    0
    Hi.. I urgently want to know the configuration of the VicIntEnable Register of LPC2148. I've searched everywhere but in vain. Can someone pls help? Need it for my final year project.

    Thank you. Muito obrigada:)
     
  2. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
  3. Twisted_transistor

    Twisted_transistor New Member

    Joined:
    Jul 22, 2012
    Messages:
    23
    Likes:
    0
    Thanks alot Atom. I found the register configuration but the use of VICIntEnClr register to disable the UART1 interrupt still does not work. Could you pls check my code and tell me why?
    Thanks.

    Code (text):
    #include "LPC214x.h"

    void init(void);
    extern unsigned char at[]="ATE0";
    extern unsigned char cmgf[]="AT+CMGF=1";                            //Text format in GSM modem
    extern unsigned char cmgs[]="AT+CMGS=\"+917875252763\"";            //Mobile number to which the msg is sent
    extern unsigned char msg[]="Heya:P";                               


    void senduart1(unsigned char a)                 //sends a byte through U1
    {
    U1THR=a;
    while(U1LSR!=0x60);
    }

    void sendstring(unsigned char *p)            //Sends a string of data through UART1
    {
    while(1)
    {
    if(*p=='\0') break;
    senduart1(*p++);
    }
    }

    void delaygsm()                           //delay function
    {
    int i,c=0;
    for(i=0;i<4000000;i++)
    {
    c++;
    }
    }


    int main()
    {  VICIntEnClr=0x00000080;
    PINSEL0=0x00050005;         //initialized U0 and U1 as UART and not GPIO
    PINSEL1 = 0x00000000;
    PINSEL2 = 0x00000000;
    IO1DIR = 0xFFFFFFFF;

    init();

    sendstring(at);
    senduart1(0x0D);                                        // equivalent of
    senduart1(0x0A);
                                            //   enter key
    delaygsm();

    IO1SET = 0x00010000;
       
    sendstring(cmgf);
    senduart1(0x0D);                                        // equivalent of
    senduart1(0x0A);                                    //   enter key
    delaygsm();


    IO1SET = 0x00020000;
    sendstring(cmgs);
    senduart1(0x0D);
    senduart1(0x0A);
    delaygsm();

    IO1SET = 0x00040000;


    sendstring(msg);
    senduart1(0x1A);
    IO1SET = 0x00080000;
    delaygsm();

    senduart1(0x1A);
    IO1CLR= 0x000F0000;
    }


    void init()
    {

    U1LCR=0x83; //8-N-1, enable divisors
    U1DLL=0x62; //9600 baud (9615)
    U1DLM=0x00;
    U1LCR=0x03; //8-N-1, disable divisors
    U1FCR=0x07;
     
    }

     
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US

    You can try throwing it in after the
    init();

    or at the end of the init function...

    ... also try clearing it before disabling it with

    VICSoftIntClear = 0x80;
    VICIntEnClr = 0x80;
     
  6. Twisted_transistor

    Twisted_transistor New Member

    Joined:
    Jul 22, 2012
    Messages:
    23
    Likes:
    0
    Ok.. yes.. I'll try that thanks:)
     

Share This Page