This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Register not getting set

I have the sample KEIL USB HID project for the LPC2148 and I have a project I started in which I am going through the KEIL code section by section attempting to thouroughly understand its function and tune the code for my needs.

In the KEIl project it runs this line of code fine, but in mine it freezes:

while((USBDevIntSt & 0x00000100) == 0);

Thanks for any help in advance!
Wesley

Parents
  • This is identical logic to the code I am using in my project which is below and allows me to realize and setup the needed number of endpoints all at once which in my case is the first four endpoints:

    void realizeEndpoints(char count)
    { char i;

    for(i = 0; i < count; i++) { USBReEp |= (1 << i);

    USBEpInd = i; USBMaxPSize = 64;

    while((USBDevIntSt & 0x00000100) == 0); USBDevIntClr |= 0x00000100; }
    }

    When I run the sample code it goes over this line "while ((DEV_INT_STAT & EP_RLZED_INT) == 0);" with no problem but when i run my code it gets stuck on "while((USBDevIntSt & 0x00000100) == 0);" and they should be the same from what I can tell.

    And I am confused by "you should pass bad parameter(s)". So I should try and pass in bad data to registers and so forth to see if it also fails under those conditions?

    Thanks,
    Wesley

Reply
  • This is identical logic to the code I am using in my project which is below and allows me to realize and setup the needed number of endpoints all at once which in my case is the first four endpoints:

    void realizeEndpoints(char count)
    { char i;

    for(i = 0; i < count; i++) { USBReEp |= (1 << i);

    USBEpInd = i; USBMaxPSize = 64;

    while((USBDevIntSt & 0x00000100) == 0); USBDevIntClr |= 0x00000100; }
    }

    When I run the sample code it goes over this line "while ((DEV_INT_STAT & EP_RLZED_INT) == 0);" with no problem but when i run my code it gets stuck on "while((USBDevIntSt & 0x00000100) == 0);" and they should be the same from what I can tell.

    And I am confused by "you should pass bad parameter(s)". So I should try and pass in bad data to registers and so forth to see if it also fails under those conditions?

    Thanks,
    Wesley

Children
No data