Download Print this page

NEX ROBOTICS Fire Bird V ATMEGA2560 Software Manual page 59

Robotic research platform
Hide thumbs Also See for Fire Bird V ATMEGA2560:

Advertisement

NEX Robotics
3.6.3 Bargraph LED display
Bargraph LED display is connected to the port J of the microcontroller. It can be used as general
purpose LED display to display data or information for debugging.
void
LED_bargraph_config (void)
{
DDRJ = 0xFF;
//PORT J is configured as output
PORTJ = 0x00;
//Output is set to 0
}
Note: To use this display make sure that Jumper J3 is enabled on the microcontroller adaptor
board. For more details, refer to section 3.19.6 of the Hardware Manual.
3.6.4 Robot motion control
For more information on the hardware, refer to section 3.8 and 3.9 from the Hardware Manual
and table 3.7 for the hardware connection details, table 3.6 for control logic from this manual.
3.6.4.1 motion_pin_config()
Sets the directions and logic levels of the pins involved in the motion control.
void
motion_pin_config (void)
{
DDRA = DDRA | 0x0F;
PORTA = PORTA & 0xF0;
DDRL = DDRL | 0x18;
PORTL = PORTL | 0x18;
}
3.6.4.2 motion_set()
Used for setting appropriate logic values for controlling robots direction. It is called by other
functions to set robot's direction.
void
motion_set
(unsigned char
{
unsigned char
PortARestore = 0;
Direction &= 0x0F;
PortARestore = PORTA;
PortARestore &= 0xF0;
PortARestore |= Direction;
PORTA = PortARestore;
}
www.nex-robotics.com
//set direction of the PORTA 3 to PORTA 0 pins as output
// set initial value of the PORTA 3 to PORTA 0 pins to logic 0
//Setting PL3 and PL4 pins as output for PWM generation
//PL3 and PL4 pins are for velocity control using PWM
Direction)
// removing upper nibbel as it is not needed
// reading the PORTA's original status
// setting lower direction nibbel to 0
// adding lower nibbel for direction command and
// restoring the PORTA status
// setting the command to the port
Fire Bird V Software Manual
59

Advertisement

loading
Need help?

Need help?

Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?

Subscribe to Our Youtube Channel