LPC1769 USB Virtual Com Port build Problems

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1769 USB Virtual Com Port build Problems

2,499 Views
thoret
Contributor II

Hi,

I use the LPC1769 to communicate over a usb as a virtual com port.

I dowload the CMSIS libary from:

lpc17xx.cmsis.driver.library/Examples/USBDEV/USBCDC at master · scottellis/lpc17xx.cmsis.driver.libr... 

I get some include erros: I include the lpc_chip_175x_6x libary

Then I get: fatal error: usbd.h: No such file or directory    usbcore.c    /usb_test/src    line 32    C/C++ Problem
I include the usbd folder from the lpc_chip. After I get a lot of conflict type erros (see the sceenshot below)

error_usbd.JPG

I seems there is a conflict between usb.h and usbd.h. I didn't understand this.

Also I try to install the driver for the virtual com port: But the driver cannot used for my x64 based system. I fond a driver in windows 10, but there is an error (see the sceenshot below). Can I used this driver from windows 10.

usb vcom error.JPG

I hope somebody can help me.

Labels (3)
0 Kudos
3 Replies

1,785 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Thore,

I would highly recommended you to use the LPCOpen packages for development work instead of the CMSIS code packages, you can download the latest LPCOpen package from this page:
 
LPCOpen Software for LPC17XX|NXP 

 
You could use the usbd_lib_cdc or usbd_lib_cdc_uart projects as base for your application.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

1,785 Views
thoret
Contributor II

Hi Carlos,

Thank you. The usb_lib_cdc project works.

But I build all my stuff my cmsis: A pwm signal and a timer.

Can I change it:

       //PWM

        LPC_SC->PCONP |= 1 << 6; //  Power up the PWM
        LPC_SC->PCLKSEL0 |= 1 << 12; // PWM clock = microcontroller clock i.e the prescaler value is 1.
        LPC_PINCON->PINSEL4 = (1<<0)|(1<<2)|(1<<4);    // Configure pin p2_0 for pwm modep

        //LPC_PWM1->CTCR =0;
        LPC_PWM1->PR = 0x0; /* No Prescalar */

        LPC_PWM1->MCR = (1 << 19); // Reset timer on Match0

        LPC_PWM1->MR0 = 2000000; // PWM freq = 50 Hz = 20 ms  2000000
        LPC_PWM1->MR1 = 150000;  // Duty Cycle of 1 ms
        LPC_PWM1->MR2 = 150000;
        LPC_PWM1->MR3 = 150000;
        LPC_PWM1->LER = (1<<0)|(1<<1)|(1<<2)|(1<<3);

        LPC_PWM1->PCR = (1<<9)|(1<<10)|(1<<11);
        LPC_PWM1->TCR |= (1 << 0) | (1 << 3);      /* Enable Counters,PWM module */

// Timer

    LPC_SC->PCONP |= 1 << 1; //Power up Timer 0
        //LPC_SC->PCLKSEL0 |= 1 << 2; // Clock for timer = CCLK/2
        LPC_SC->PCLKSEL0 |= 1<<1; //100 MHz
        LPC_TIM0->MR0 = 100000; // Give a value suitable for the LED blinking frequency based on the clock frequency // Bei 1000000 == 1s Takt
        LPC_TIM0->MCR |= 1 << 0; // Interrupt on Match0 compare
        LPC_TIM0->MCR |= 1 << 1; // Reset timer on Match 0
        LPC_TIM0->TCR |= 1 << 1; // Reset Timer0

        NVIC_EnableIRQ(TIMER0_IRQn);


        LPC_TIM0->TCR = 1; // Start timer

void TIMER0_IRQHandler (void)
        {
            //if((LPC_TIM0->IR & 0x01) == 0x01) // if MR0 interrupt
            {
                LPC_TIM0->IR = 1; // Clear MR0 interrupt flag
{

0 Kudos

1,785 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Thore,

 

It would be better if you could migrate the code to use the LPCOpen 16/32-bit Timer drivers,  the periph_timer project could help you get familiar with them.


Hope it helps!

 

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos