Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

CM-510 and interrupts

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
4 postsPage 1 of 1
4 postsPage 1 of 1

CM-510 and interrupts

Post by ggismero » Sun Feb 20, 2011 9:44 pm

Post by ggismero
Sun Feb 20, 2011 9:44 pm

Hello,

It's possible to program interrupts in embebed C for CM-510?

I'm using Zigbee, and i want to put the received message in a buffer (becouse hardware only keeps the last message arrived). At the moment my main code is a loop which checks the state of Zigbee and then execute the real code, but it generates overhead, so i thought to change it to an interrupt that is called every time a package is received.

Best regards,
Gonzalo.
Hello,

It's possible to program interrupts in embebed C for CM-510?

I'm using Zigbee, and i want to put the received message in a buffer (becouse hardware only keeps the last message arrived). At the moment my main code is a loop which checks the state of Zigbee and then execute the real code, but it generates overhead, so i thought to change it to an interrupt that is called every time a package is received.

Best regards,
Gonzalo.
ggismero
Robot Builder
Robot Builder
Posts: 8
Joined: Tue Jul 20, 2010 11:16 pm

Post by Fritzoid » Tue Feb 22, 2011 12:24 pm

Post by Fritzoid
Tue Feb 22, 2011 12:24 pm

ggismero wrote:
It's possible to program interrupts in embebed C for CM-510?

Of course it is, you control the the entire machine! In fact it's probably just the first step you should take in making useable firmware for the CM-510.
ggismero wrote:
It's possible to program interrupts in embebed C for CM-510?

Of course it is, you control the the entire machine! In fact it's probably just the first step you should take in making useable firmware for the CM-510.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by ggismero » Tue Feb 22, 2011 2:36 pm

Post by ggismero
Tue Feb 22, 2011 2:36 pm

Thanks for your answer,

I found how to do it, but i've got troubles finding the right interruption.
For the ATmega2561 I found the next possible interrupts for the rx complete (from here: http://www.nongnu.org/avr-libc/user-man ... rupts.html):
USART0_RX_vect
USART1_RX_vect
USART2_RX_vect
USART3_RX_vect

Does anybody know the right interrupt that's triggered when the reception of a packet through zigbee is complete?

Thanks,
Gonzalo
Thanks for your answer,

I found how to do it, but i've got troubles finding the right interruption.
For the ATmega2561 I found the next possible interrupts for the rx complete (from here: http://www.nongnu.org/avr-libc/user-man ... rupts.html):
USART0_RX_vect
USART1_RX_vect
USART2_RX_vect
USART3_RX_vect

Does anybody know the right interrupt that's triggered when the reception of a packet through zigbee is complete?

Thanks,
Gonzalo
ggismero
Robot Builder
Robot Builder
Posts: 8
Joined: Tue Jul 20, 2010 11:16 pm

Post by Fritzoid » Tue Feb 22, 2011 4:11 pm

Post by Fritzoid
Tue Feb 22, 2011 4:11 pm

Hi ggismero,

The zigbee is connected to the same circuit as the serial cable. These lines interface with USART1.

The only input-related interrupt is RX complete. This interrupt fires whenever a new byte is received by the USART. So there is one interrupt for each byte in the packet. There is no additional interrupt when the packet is complete so you will have to be parsing the received data to see if it's all there yet. Hint: byte 4 of the packet tells you how many more bytes to expect.

It is usual practice to have the low-level interrupt routine move the byte into a buffer. Then a higher-level routine, running in a loop, can parse the bytes to extract the packet and its contents.
Hi ggismero,

The zigbee is connected to the same circuit as the serial cable. These lines interface with USART1.

The only input-related interrupt is RX complete. This interrupt fires whenever a new byte is received by the USART. So there is one interrupt for each byte in the packet. There is no additional interrupt when the packet is complete so you will have to be parsing the received data to see if it's all there yet. Hint: byte 4 of the packet tells you how many more bytes to expect.

It is usual practice to have the low-level interrupt routine move the byte into a buffer. Then a higher-level routine, running in a loop, can parse the bytes to extract the packet and its contents.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am


4 postsPage 1 of 1
4 postsPage 1 of 1