AnsweredAssumed Answered

ADSP-BF706  UART problem 

Question asked by a561975400 on Aug 1, 2017
Latest reply on May 25, 2018 by mghecea

I cant type char from putty to 706 register

 

/*****************************************************************************
* UR_TEST.c
*****************************************************************************/

#include <sys/platform.h>
#include "adi_initialize.h"
#include "UR_TEST.h"

#include <services/int/adi_int.h>
#include <services/gpio/adi_gpio.h>
#include <stdio.h>
#define BUFF_SIZE 100
void GPIO_SET(void);
void UART_SET(void);
void UART_interrupt(void);
void UART0_STAT_ISR(uint32_t iid, void* handlerArg);
unsigned char RxBuffer[BUFF_SIZE]={0xFF};
int j=0;
static int i=0;


int main(void)
{
adi_initComponents();
GPIO_SET();
UART_SET();
while(1)
{}
}
void GPIO_SET(void)
{
*pREG_PORTB_FER_SET = (ADI_GPIO_PIN_8 | ADI_GPIO_PIN_9);
}

void UART_SET(void)
{
*pREG_UART0_CTL=0x0301;
*pREG_UART0_CLK=0x028B;
*pREG_UART0_IMSK_SET=0x0002;
}
void UART_interrupt(void)
{
adi_int_InstallHandler(INTR_UART0_STAT, UART0_STAT_ISR, NULL, true);
}
void UART0_STAT_ISR(uint32_t iid, void* handlerArg)
{
*pREG_UART0_IMSK_SET=0x0001;
if(*pREG_UART0_STAT&0x0001)
{
if(i != BUFF_SIZE)
{
RxBuffer[i] = *pREG_UART0_RBR;
}
i++;
}

}

Outcomes