AnsweredAssumed Answered

Simple LED program without library

Question asked by capitano88 on Apr 26, 2017
Latest reply on May 2, 2017 by capitano88

Hello guys,

 

I am trying to program ADUCM350EBZ without using libraryes. I simply want to light on the led "DISPLAY" wired on pin P0.11. (I checked all jumper and they are ok).

 

The code I wrote is the following:

 

#include <stdlib.h>
#include <stdio.h>

 

#define GP0OUT *((long*)0x40020014)  // all 16 bit register. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 
#define GP0OEN *((long*)0x40020004) //     pin 0.11            (0   0   0  0    1   0  0 0 0 0 0 0 0 0 0 0)b
#define GP0SET *((long*)0x40020018) //                                       (0                  8         0         0)h

 

void main()

{

   GP0OUT = 0x0800;

   GP0OEN = 0x8000;

   GP0SET = 0x0800;

}

 

So, the code is compiled and downloaded on the Evaluation Board correctly, but the led is always turn off. Is it need to activate the GPIO peripheral? If yes, how I can do it (vecause I cannot found this information on datasheet)? Or simply, there is an error in my code?

 

Many thanks

Outcomes