DSPRelated.com
Forums

DSP Newbie

Started by Jokerz2 November 20, 2003
Hello,
I am new to DSP'in, I am use to just doing 8 and 16 bit designs. I
am triyng to get started on a 535 blackfin board. I am just trying to
use the UARTS and the SPI ports.

This is my UART Init Code ..

void Uart0Init(void)
{
*pUART0_LCR = 3; //8 bits
*pUART0_IER = 0; // Disable Uart Interupts
*pUART0_LCR |= DLAB; //access other set of registers
*pUART0_DLH = 0; // These 2 make up the baud rate
*pUART0_DLL = 255;
*pUART0_LCR &= ~DLAB; // Normal Registers

} Then I just write to the UART tx buffer liker this ..
*pUART0_THR = data; it does not appear to be working ... I am monitoring the TX pin on
the demo board. Anyone want to help out on what I am doing wrong ?

For the SPI, here is what I init:

void SPI0Init(void)
{
*pSPI0_CTL = SPE|MSTR|CPHA; // SPI ENABLE; Master Mode; Clock transer
on leading edge
*pSPI0_FLG = 2;
*pSPI0_BAUD = 125; // (System Clock/(2*SPI_BAUD) = SPI Clock
}

and then write like this ..

void SPI0Write(unsigned char data)
{
*pSPI0_FLG |= 0x100;
*pSPI0_TDBR = data;
*pSPI0_FLG &= ~0x100;
}

any help would be appreciate d.. there are a lot less registers in
itty bitty micros ..

-J