LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Porting to ARM LM3S811, PWM and serial port issues

Solved!
Go to solution

Read my previous post: http://forums.ni.com/ni/board/message?board.id=420&thread.id=1996

 

I am having problems again, I have corrupted sent data throught serial port 0 when using the NI serial driver on the LM3S811. I also get error code -1073807339 when reading that data, inside labview with VISA, sent from my ARM to my PC.

 

I am thinking that the timings might be wrong, but I don t know where to look for  baud-rate divisor for UART0. The 3S811 is Xtal 6Mhz, not 8Mhz like the 3S8962.

 

I also tested the PWM on a scope and the frequency dosen t match, if I ask for 1kHz I get around 666Hz. Seems like setting the Xtal to 6Mhz in uVision is not enought.

 

 

thx

Lukasz

0 Kudos
Message 1 of 3
(6,405 Views)

Hi Lukasz,

 

My collegue will be posting to your other post shortly.

 

 

Regards,
Claire Reid
National Instruments
0 Kudos
Message 2 of 3
(6,374 Views)
Solution
Accepted by topic author L._Andrzejewski

Ok, here is the solution.

 

Open "startup.s"

Goto line 193:

        ; set the system clock to run at 50 MHz
        ; SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL |
        ;                SYSCTL_XTAL_8MHZ | SYSCTL_OSC_MAIN);

        LDR        R0, =0x01C002C0
        BL        SysCtlClockSet

        B       __main

 

Replace R0, with the right values found in "sysctl.h" line 236:

in my case set the crystal to 6Mhz which is "0x000002C0"

 

PWM timing is restored and serial port works fine now.

0 Kudos
Message 3 of 3
(6,350 Views)