Avr beginner with avrcam

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

Avr beginner with avrcam

Postby arvind » Wed Mar 29, 2006 11:52 am

Am just trying to PING the avrcam from the micro(atmega8535). Am using peter fleury's uart library. The mega8535 is running with an external 8Mhz crystal oscilator.This is the code:
Code: Select all
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <avr/pgmspace.h>
#include <string.h>
#include <inttypes.h>

#include "uart.h"
#include "lcd.h"

#ifndef F_CPU
#define F_CPU 8000000UL
#endif

#define UART_BAUD_RATE    115200     


int main(void)
{
    unsigned int c;
      
   
    uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
   
    sei();
   uart_puts("PG");
   lcd_init(LCD_DISP_ON);
    lcd_clrscr();
    lcd_puts("Cam:");
    lcd_command(LCD_DISP_ON_CURSOR_BLINK);
   
for(;;)
    {
     c = uart_getc();
    
     if ( c & UART_NO_DATA )
        {
        }
        else
        {
       lcd_putc((unsigned char)c);
       lcd_putc("a");
      }
    }
   
}


Now nothing gets printed on the lcd after "cam:". I dont know whats wrong...
The avrcam has worked properly when "PING"ed from the avrcamview pc application.please help me..i need to get it working..n am a beginner at embedded programming
arvind
 
Posts: 14
Joined: Mon Jul 25, 2005 8:14 am

Ping avrcam from mega8535

Postby arvind » Fri Mar 31, 2006 10:31 am

Well, i learnt that i should not have used 8Mhz crystal as the error in serial transmission was very high. Hence i have used 11.0592Mhz crystal and have succesfully transmitted data serially to hyper terminal at 115.2kbps. But even now, when i try pinging the cam from the micro, the cam does not respond. Nothing is recieved by the micro.Please help me..am just not able to find out what is wrong...
arvind
 
Posts: 14
Joined: Mon Jul 25, 2005 8:14 am

Postby johno » Sat Apr 01, 2006 12:45 pm

So when you send the PG\r (ping) command to the AVRcam from your board, what do you receive back? When you are trying to talk to the AVRcam from another AVR board, I assume you are communicating through the TTL-level UART interface, and not the RS-232-level UART interface, right?
-John O
Site Admin
johno
 
Posts: 51
Joined: Thu Mar 16, 2006 2:29 pm

dumb mistake

Postby arvind » Sun Apr 02, 2006 4:21 am

i had made a dumb mistake....had connected the rx of mega8 to rx of mega8535 directly instead of tx... :( :oops:
arvind
 
Posts: 14
Joined: Mon Jul 25, 2005 8:14 am


Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 22 guests

cron