LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming timer A in LM3S8962

0 Kudos
Message 1 of 10
(9,589 Views)

The application properties doesn't allow this but you could change to one-shot in block diagram prior any other opperation.

one-shot.png

 

This will determine a single interrupt and then timer stops.

0 Kudos
Message 2 of 10
(9,587 Views)

Bonjour,

Thank you for the explanation, but I dont understand why I cannot use the VI "ccg mem poke" in order to configure the timer.

In your code, I have to add the preloaded value for the timer ? Can you explain me how I can do that ? 

Sorry for all these questions, but it's very difficult to find explanations for all these questions... 

It would be fine that NI give us a real documentation for this version of LABVIEW !!!

Bests regards.

Alain.

0 Kudos
Message 3 of 10
(9,575 Views)

NI guys did well their job (both documentation and implementation)

 

one-shot peek poke.png

 

Also Luminary/TI explained how to configure the timer:

1. Ensure the timer is disabled (the TAEN bit in the GPTMCTL register is cleared) before making
any changes.

2. Write the GPTM Configuration Register (GPTMCFG) with a value of 0x0.
3. Set the TAMR field in the GPTM TimerA Mode Register (GPTMTAMR):
a. Write a value of 0x1 for One-Shot mode.
b. Write a value of 0x2 for Periodic mode.
4. Load the start value into the GPTM TimerA Interval Load Register (GPTMTAILR).
5. If interrupts are required, set the TATOIM bit in the GPTM Interrupt Mask Register (GPTMIMR).
6. Set the TAEN bit in the GPTMCTL register to enable the timer and start counting.

(page 229/Datasheet-LM3S8962.pdf)

 

Good Luck!

0 Kudos
Message 4 of 10
(9,551 Views)

Hello,

Thank you for  your help. I know "NI guys did well their job", and usually, I like working with LABVIEW ...

I called to NI FrANCE yesterday, just to explain my problem.

In fact, when I try to write in memory at 0x4003000 for example, (timer A adress) (or 0x4003000C, or 0x40030004, ...) with the CCG VI or in C code (both examples you sent me), in simulation mode,it is OK, but in debug mode with my luminary development card LM3S8962, it is impossible to write in memory at this adress.When I look at the code in KEIL VISION, I have an infinite loop in the module "startup.s" - FaultISR.

May be you have the possibility to test this code on such a development card ?

Is there any protection for this memory area? I don't understand the problem.

Thank's for your help.

Best regards.

Alain.

0 Kudos
Message 5 of 10
(9,539 Views)

Alain,

 

          When you are running your code in debug mode on your board, are you seeing any errors or does the code just not run and write to that memory space? 

0 Kudos
Message 6 of 10
(9,528 Views)

Bonsoir,

 

For example, I try to run this very simple code...

I have no error message in LABVIEW, but my program never stop !

lv.JPG

 

 

If I look at the code in KEIL, I find an infinite loop in the "Startup.s".

 

FaultISR

    B    FaultISR

 

 

Configuration in KEIL:

 

Target:

LM3S8962

 

IROM1  start: 0x0   Size: 0x4000         

 

and for the R/W Mem Access:

IRAM1: 0x2000 0000    Size: 0x10 0000

 

Well, I don't know exactly the importance of these parameters, but if I increase the size of IRAM1 to 0x2500 0000

The result is the same ....

 

So, I don't understand....

Thank you for your help...

Alain.

 

 

0 Kudos
Message 7 of 10
(9,516 Views)

Alain,

 

It appears you are trying to access registers from Timer0 without enabling that device. That's why you are getting a "Bus Fault" (unfortunately, uVision IDE shows wrong line in startup.s, but in disassembly the address is correct - default ISR)

Timer0 is enabled in LabVIEW if you are using interrupts (see LM3Sxxxx_Timer0.c in uVision). The configuration is done prior executing anything from the main VI, so you can use safely Peek&Poke in peripheral's registers. (However, I don't know what are you trying, but using Inline C Node is more descreptive than poking numbers to addresses, and at run time is faster).

 

I attached here a project with two applications (check Manage Interrupts page of each application properties). If you'll run Application Fault you'll see the same behavior as you had already described. (give a hardware reset before running Application Fault first time - unplug the board or press Reset)

Message 8 of 10
(9,494 Views)

Bonjour,

Thank you very much. It's OK now!

I didn't think it was necessary to enable interrupts to write in TIMER0 registers ....

I use InLine C Node, and it's working now.

 

One more time, thank you for your help.

Alain.

 

Message 9 of 10
(9,487 Views)

can u please tell me ho to use inline c for timer A

0 Kudos
Message 10 of 10
(8,024 Views)