veerubiji
Full Member level 2
- Joined
- Feb 24, 2011
- Messages
- 122
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,298
- Activity points
- 2,301
I have understand your concept but not fully, if you don't mine can you give little bit explanation. I am new to micro controller programming so i am confusing with this task.I agree with sequel, from your description it appears you have two development boards which you require to be connected in some way.
If this is correct, why not simply connect the USARTs of the boards together using either an asynchronous or synchronous protocol?
Using an asynchronous TTL or RS-232 would most likely be the simplest method, requiring firmware development for only the AT90USB1287 dev board.
Essentially you would be implementing your on USB to serial bridge/converter out of the AT90USB1287 dev board.
One possible option would be to implement a Communication Device Class (CDC) offering a virtual COM port and which utilizes standard drivers provided by the Windows OS.
Atmel AVR4907: ASF - USB Device CDC Application
**broken link removed**
BigDog
BigDog
You have to redirect the serial data accepted by AT90USB1287 to usb port so that the data goes to PC via USB
Your ATMEGA32 sends serial data to AT90USB1287 using UART and that data received by AT90USB1287 has to be sent to PC via USB? Am I right?
If I am right, you have to send the data read through rs232 to usb write buffer of AT90USB1287.
all you need to do is simply copy whatever that you want to output to the pc from the ATmega32 board down to the AT90USB board via the serial port then of the micros then you can finish it of from here.
that is to say you have to master-slave the micros so that one can serve as the bridge while the other can serve as the master. so you have to first of all get this data down to the AT90USB first via any mode of communication that will be flexible for you say I2C, SPI or whatever protocol that will make you to be on the go....
......sequel
I have searched all the way, i didn't found any such example code. Can any one help me with sample code.
uart_usb_getchar()
uart_usb_putchar()
I am using CodeVisonAVR compiler.Which Compiler are you using? I can do that using mikroC Compiler.
please pardon me for asking like that in the previous post.
// USART1 Receiver interrupt service routine
interrupt [USART1_RXC] void usart1_rx_isr(void){
if(UCSR1A & 0x1C){
SerIn[RxCnt] = UDR1; //Read the corrupted byte
return; // Error
}
if(++BufCnt >= SIBUFSIZE){ // Increment & check for buffer overflow
BufCnt = SIBUFSIZE-1; // Set to max value
return; // Skip char
}else{ // Else: if buffer ok
if(++RxCnt >= SIBUFSIZE) RxCnt = 0; // Increment read counter, if 10 -> 0 (max 9)
SerIn[RxCnt] = UDR1; // Write to SBUF (load the transmit register)
}
}
// USB Receive
void catchString(void){
while(UEBCLX){
if(++BufCnt >= SIBUFSIZE){ // Increment & check for buffer overflow
BufCnt = SIBUFSIZE-1; // Set to max value
// printf("!Overflow\r\n");
// UENUM = 2;
return; // Skip char
}else{ // Else: if buffer ok
if(++RxCnt >= SIBUFSIZE) RxCnt = 0; // Increment read counter, if 10 -> 0 (max 9)
SerIn[RxCnt] = UEDATX; // Write to SBUF (load the transmit register)
}
}
}
// Read from ringbuffer
char getcharb(void){
if(BufCnt){ // If anything
BufCnt--; // Decrement buffer counter
if(++RdCnt >= SIBUFSIZE) RdCnt = 0; // Increment read counter, if 10 -> 0 (max 9)
return SerIn[RdCnt]; // Read from SBUF (access receive register)
}
return 0;
}
Attached zip files are unknown format or damaged, I tried to unzip with all software's, But still i can't. even i have tried from this website also but still same problem.[/URL]"
while (rx_counter)
{
uart_putchar(uart_usb_getchar()); // loop back USB to USART
}
while (rx_counter)
{
//uart_putchar(uart_usb_getchar()); // loop back USB to USART
uart_usb_putchar(uart_usb_getchar()); //loop back USB to USB
}
At90USB1287 is receiving the command and it is giving result as "unknown command"
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?