Library calls for which there is no information

Beta Testing discussion on mikroC PRO for AVR.
Post Reply
Author
Message
sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

Library calls for which there is no information

#1 Post by sadavis80 » 21 Nov 2008 01:34

String library -
strtok
UART library -
UARTx_TX_Idle

Also - there is no way I can see to reference the UARTx calls to any specific USART on any specific device ... or is there?? I sure can't get anything to work and I've tried them all.

I'm guessing that TX_Idle MIGHT be the equivalent of TX Buffer empty??
Also - if you use UARTx_Init - when you hit the '(' to provide the baud, the tool tip pops up that says 'No Parameter Expected' .
Steve

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

#2 Post by filip » 21 Nov 2008 08:53

Dear Steve,

Regarding the Strtok and UARTx_TX_Idle issue, you were right, by some strange accident these routines were left out from the help file. It will be corrected in the final version of the compiler.

UARTx_TX_Idle routine is used for internal purposes only.

If you want to initialize UART module, UARTx_Init should be replaced with the UART1_Init, UART2_Init, etc, depending on the desired UART module.
So, in every routine letter "x" should be replaced with the desired module number.

Regards,
Filip.

sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

#3 Post by sadavis80 » 21 Nov 2008 14:34

filip wrote:If you want to initialize UART module, UARTx_Init should be replaced with the UART1_Init, UART2_Init, etc, depending on the desired UART module.
So, in every routine letter "x" should be replaced with the desired module number.

Regards,
Filip.
I understand that part of it, but I see no way to know whether your UART1 actually controls USART0 of my device or some other port (it has 4). I was unable to get yours to work on ANY port ... so I wrote my own - and it works :).
Steve

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

#4 Post by rajkovic » 21 Nov 2008 15:12

sadavis80 wrote:
filip wrote:If you want to initialize UART module, UARTx_Init should be replaced with the UART1_Init, UART2_Init, etc, depending on the desired UART module.
So, in every routine letter "x" should be replaced with the desired module number.

Regards,
Filip.
I understand that part of it, but I see no way to know whether your UART1 actually controls USART0 of my device or some other port (it has 4). I was unable to get yours to work on ANY port ... so I wrote my own - and it works :).
Steve
Please tell us which device it is and we will check it (it should work). You have ready and tested examples of using UART library in examples folder.

sadavis80
Posts: 114
Joined: 15 Nov 2008 19:27

#5 Post by sadavis80 » 21 Nov 2008 15:23

I am using ATmega1280 on a BigAVR board. There are no examples for my device - some for other devices, but I don't know anything ABOUT the other devices, so I don't know how they relate.
From what you indicate, can I assume that
UART1... => USART0
UART2... => USART1, etc??
That was my guess, but I could never get anything out of the TX pin on my device. (of course, I had other troubles, so they might have been interfering at the time).
BigAVR has level shift and connectors tied to USART1 and USART2. In MY case, I'm using USART0 to control a serial LCD connected to PE1 and THAT's what I was working toward.
Steve

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

#6 Post by rajkovic » 21 Nov 2008 16:25

sadavis80 wrote:I am using ATmega1280 on a BigAVR board. There are no examples for my device - some for other devices, but I don't know anything ABOUT the other devices, so I don't know how they relate.
From what you indicate, can I assume that
UART1... => USART0
UART2... => USART1, etc??
That was my guess, but I could never get anything out of the TX pin on my device. (of course, I had other troubles, so they might have been interfering at the time).
BigAVR has level shift and connectors tied to USART1 and USART2. In MY case, I'm using USART0 to control a serial LCD connected to PE1 and THAT's what I was working toward.
Steve
this is working example for 1280

Code: Select all

char uart_rd;

void main() {

  UART1_Init(9600);               // Initialize UART module at 9600 bps
  Delay_ms(100);                  // Wait for UART module to stabilize

  while (1) {                     // Endless loop
   if (UART1_Data_Ready()) {      // If data is received,
     uart_rd = UART1_Read();      //   read the received data,
     UART1_Write(uart_rd);        //   and send data via UART
    }
  }
}

Post Reply

Return to “mikroC PRO for AVR Beta Testing”