Is it possible!!!! at90usb162 doing serial + USB...

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have established wireless RF link between atmega16 and usb162 using Tx-Rx 433Mhz...
I have connected Rx-433 to RXD (pin eight) of 90usb162...I am able to get data from atmega16 connected tx-433....
I wanted to connect usb162 to pc via usb...now my question is...is it possible to operate both simultaneously rs232 pin and usb of 90usb162 in USB HID class....

I know that in CDC class controller becomes usb-serial link....
but can I do that in HID class??my HID works properly alone..

I have tried but it does not work when I integrate both......

Its like this..
main()
{
USB_task()
HID_task()
check UART for data..
data=UDR

and copy data to usb register...

}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

is there something fundamentally wrong??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The usb task is probably taking a slice of processor time. You'll most likely have to run the serial via interrupts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

actually I need to set hardware baud rate(for both controller to match uart) in 90usb162...so when I set baudrate and load the hexfile in it my usb device does not recognize in windows...without setting the baudrate my usb works but I do not get data from uart.......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How are you checking for the USART data? If you are spinlooping until a character is received, you'll block the other tasks from running. Make sure your receive code is testing if a character is received and aborting immediately if not.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On another point: Which IC(s) are you using to establish the wireless RF link?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
How are you checking for the USART data? If you are spinlooping until a character is received, you'll block the other tasks from running. Make sure your receive code is testing if a character is received and aborting immediately if not.

- Dean :twisted:


ya...dean...I am first checking if something received then take it else continue......

as I said previously...when I set the baud=1200 or UBRR=466(even without any uart receiving command)...it does not go to usb mode...and windows does not recognize the device.......
is there anything related to hardware uart baudrate and usb hid...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Joeks wrote:
On another point: Which IC(s) are you using to establish the wireless RF link?

It is just Tx-Rx 433Mhz rf modules.......which goes to txd and rxd of controller respectively......

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you got a part/module/manufacturer name or number for me of those rf modules?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

ya...dean...I am first checking if something received then take it else continue......

as I said previously...when I set the baud=1200 or UBRR=466(even without any uart receiving command)...it does not go to usb mode...and windows does not recognize the device.......
is there anything related to hardware uart baudrate and usb hid...

Not normally. The only thing I can think of would be you enabling a USART interrupt that you then didn't declare, causing resets. Being able to see the USART code would help.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wonder setting the baudrate(1200) might affect system clock (8MHz)which eventually disturbing USB function....so it may not work...is this logical??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

USB clock is fed straight from the clock input pin, and isn't affected by the CPU prescaler. This has to be something to do with the USART driver disabling interrupts, or enabling an interrupt without an associated vector.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
USB clock is fed straight from the clock input pin, and isn't affected by the CPU prescaler. This has to be something to do with the USART driver disabling interrupts, or enabling an interrupt without an associated vector.

- Dean :twisted:


how to do that?? I have not done anything like this when I used uart normally...