PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : مشکل در کار با codevision avr v2.05



azadmard
20-03-2013, 12:22
سلام دوستان من ابتدا که کدویژن رو نصب کرد خیلی راحت باهاش کار میکردم و خوب جواب میداد
ولی نمیدونم چیشد که حتی وقتی روی برنامه های درست قبلی میرو بازهم موقع کامپایل برنامه این ارورو میده
can't open #include mega16
undefined symbol 'DDRB'
undefined symbol'PORTB
روی پورت های دیگه هم امتحان کردم ولی درمورد اونها هم ارور داد
کلا درمورد اصولی که باید توی کدویژن انجام بشه ارور میده درحالی که تارز قبلش درست کار میکرد
میشه دوستان کمکم کنند
مرسی

esisafa
20-03-2013, 12:30
پاک کن دوباره نصب کن
شاید لایسنس اون خراب شده
شاید کتابخونه ی مورد نظر پاک شده
و ...

sarbaz13
20-03-2013, 18:29
سلام دوست عزیز
دوتا علت داره
1-ویندوزت ویروسی هست ( ممکن هم هست ویروسی نباشه) در این صورت باید برنامت رو دوباره پاک کنی بخصوص فولدر Cvavr در درایو ویندوزت.و دوباره نصب کنی.
که اگر ویروسی باشه کامپیوترت هر از چند گاهی شما با این ارور مواجه میشوید.
2-به علت بد باز کردن فایل های درست قبلیت می باشه که اومدی مثلا دوبار روی فایل قبلیت کلیک کردی و وارد کدویژن شدی که این کار اشتباه است و حتما باید اول برنامه کدویژن رو باز کنی و بعد از طریق Flie--->Open به آدرس فایل مورد نظرت بری و بعد از انتخاب فایل روی open کلیک کنید.
موفق باشید یا علی

azadmard
22-03-2013, 12:56
سلام دوست عزیز
دوتا علت داره
1-ویندوزت ویروسی هست ( ممکن هم هست ویروسی نباشه) در این صورت باید برنامت رو دوباره پاک کنی بخصوص فولدر cvavr در درایو ویندوزت.و دوباره نصب کنی.
که اگر ویروسی باشه کامپیوترت هر از چند گاهی شما با این ارور مواجه میشوید.
2-به علت بد باز کردن فایل های درست قبلیت می باشه که اومدی مثلا دوبار روی فایل قبلیت کلیک کردی و وارد کدویژن شدی که این کار اشتباه است و حتما باید اول برنامه کدویژن رو باز کنی و بعد از طریق flie--->open به آدرس فایل مورد نظرت بری و بعد از انتخاب فایل روی open کلیک کنید.
موفق باشید یا علی
سلام ممنون ازکمکتون
دومی بود
الن درست کار میکنه

micro_like
28-06-2016, 05:49
سلام,من یه سری کدبرای راه اندازی ماژول بلوتوثhc05وatmega8Lدارم که توکدویژن ارور میده:
اینم کدهام:hc1.c
#include<io.h>
/*Includes io.h header file where all the Input/Output Registers and its Bits are defined for all AVR microcontrollers*/

#define F_CPU 8000000
/*Defines a macro for the delay.h header file. F_CPU is the microcontroller frequency value for the delay.h header file. Default value of F_CPU in delay.h header file is 1000000(1MHz)*/
#include<delay.h>
/*Includes delay.h header file which defines two functions, _delay_ms (millisecond delay) and _delay_us (microsecond delay)*/
#include<hc05.h>
/*Includes hc05.h header file which defines different functions for HC-05 Bluetooth Module. HC-05 header file version is 1.1*/

void main(void)
{
delay_ms(500);
delay_ms(500);
/*Delay of 1s*/

usart_init();
/*USART initialization*/

hc_05_bluetooth_transmit_string("ABLab Solutions");
/*Transmits a string to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0d);
/*Transmits Carriage return to Bluetooth Module*/

hc_05_bluetooth_transmit_byte(0x0a);
/*Transmits New Line to Bluetooth Module for new line*/
hc_05_bluetooth_transmit_string("You can see links before reply (You can see links before reply)");
/*Transmits a string to Bluetooth Module*/
hc_05_bluetooth_transmit_byte(0x0d);
/*Transmits Carriage return to Bluetooth Module*/

hc_05_bluetooth_transmit_byte(0x0a);
/*Transmits New Line to Bluetooth Module for new line*/
}
/*End of program*/

- - - Updated - - -

hc05.h


#ifndef _HC05_H_
#define _HC05_H_ 1

#include<io.h>
#include<delay.h>
#include<usart.h>
char hc_05_buffer1[25], hc_05_buffer2[50];
char temp;
void hc_05_bluetooth_transmit_byte(char data_byte);
char hc_05_bluetooth_receive_byte(void);
void hc_05_bluetooth_transmit_string(char *transmit_string);
void hc_05_bluetooth_transmit_command(char *transmit_string);
char *hc_05_bluetooth_receive_string(char *receive_string, unsigned char terminating_character);
unsigned char hc_05_bluetooth_at_command_mode_test(void);
unsigned char hc_05_bluetooth_device_name_change(char *device_name);
unsigned char hc_05_bluetooth_get_version(void);
unsigned char hc_05_bluetooth_change_baud_rate(long int baud_rate);
unsigned char hc_05_bluetooth_pin_change(char *new_pin);

void hc_05_bluetooth_transmit_byte(char data_byte)
{
usart_data_transmit(data_byte);
}
char hc_05_bluetooth_receive_byte(void)
{
return usart_data_receive();
}
void hc_05_bluetooth_transmit_string(char *transmit_string)
{
usart_string_transmit(transmit_string);
}
char *hc_05_bluetooth_receive_string(char *receive_string, unsigned char terminating_character)
{
unsigned char temp=0x00;
for(unsigned char i=0;;i++)
{
*(receive_string+i)=usart_data_receive();
if(*(receive_string+i)==terminating_character)
break;
else
temp++;
}
*(receive_string+temp)='\0';
return receive_string;
}
unsigned char hc_05_bluetooth_at_command_mode_test(void)
{
UBRRL=12;
delay_ms(500);
usart_string_transmit("AT");
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,0x0d);
temp=usart_data_receive();
if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_change_baud_rate(long int baud_rate)
{
UBRRL=12;
delay_ms(500);

if(baud_rate==4800)
{
usart_string_transmit("AT+UART=4800,0,0");
}
else if(baud_rate==9600)
{
usart_string_transmit("AT+UART=9600,0,0");
}
else if(baud_rate==19200)
{
usart_string_transmit("AT+UART=19200,0,0");
}
else if(baud_rate==38400)
{
usart_string_transmit("AT+UART=38400,0,0");
}
else if(baud_rate==57600)
{
usart_string_transmit("AT+UART=57600,0,0");
}
else if(baud_rate==115200)
{
usart_string_transmit("AT+UART=115200,0,0");
}
else if(baud_rate==230400)
{
usart_string_transmit("AT+UART=230400,0,0");
}
else if(baud_rate==460800)
{
usart_string_transmit("AT+UART=460800,0,0");
}
else if(baud_rate==921600)
{
usart_string_transmit("AT+UART=921600,0,0");
}
else if(baud_rate==1382400)
{
usart_string_transmit("AT+UART=1382400,0,0");
}
else
{
;
}
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);
usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();

if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_device_name_change(char *device_name)
{
UBRRL=12;
delay_ms(500);

usart_string_transmit("AT+NAME=");
usart_string_transmit(device_name);
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);

usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();

if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_get_version(void)
{
UBRRL=12;
delay_ms(500);

unsigned char i=9,j=0;
usart_string_transmit("AT+VERSION?");
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);

usart_string_receive(hc_05_buffer2,13);
temp=usart_data_receive();

usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();

for(i=9;hc_05_buffer2[i]!=0;i++)
{
hc_05_buffer2[j]=hc_05_buffer2[i];
j++;
}
hc_05_buffer2[j]=0;

if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
unsigned char hc_05_bluetooth_pin_change(char *new_pin)
{
UBRRL=12;
delay_ms(500);

usart_string_transmit("AT+PSWD=");
usart_string_transmit(new_pin);
usart_data_transmit(0x0d);
usart_data_transmit(0x0a);

usart_string_receive(hc_05_buffer1,13);
temp=usart_data_receive();

if(!(strcmp(hc_05_buffer1,"OK")))
{
return 1;
}
else
{
return 0;
}
}
#endif

- - - Updated - - -

usart.h




#ifndef _USART_H_
#define _USART_H_ 1



#include<io.h>
#include<delay.h>


/*The function is declared to initialize the USART with following cinfiguration:-
USART mode - Asynchronous
Baud rate - 9600
Data bits - 8
Stop bit - 1
Parity - No parity.*/
void usart_init();



/*The function is declared to transmit data.*/
void usart_data_transmit(unsigned char data );



/*The function is declared to receive data.*/
unsigned char usart_data_receive( void );



/*The function is declared to transmit string.*/
void usart_string_transmit(char *string);



/*The function is declared to receive string.*/
char *usart_string_receive(char *receive_string,unsigned char terminating_character);


/*Function defination*/
void usart_init()
{
UBRRH = 0;
UBRRL =51;
UCSRB|= (1<<RXEN)|(1<<TXEN);
UCSRC |= (1 << URSEL)|(3<<UCSZ0);
}

void usart_data_transmit(unsigned char data )
{
while ( !( UCSRA & (1<<UDRE)) )
;
UDR = data;
}
unsigned char usart_data_receive( void )
{
while ( !(UCSRA & (1<<RXC)) )
;
return UDR;
}
void usart_string_transmit(char *string)
{
while(*string)
{
usart_data_transmit(*string++);
}
}
char *usart_string_receive(char *receive_string,unsigned char terminating_character)
{
unsignedchar temp=0x00;
for(unsignedchar i=0;;i++)
{
*(receive_string+i)=usart_data_receive();
if(*(receive_string+i)==terminating_character)
break;
else
temp++;
}
*(receive_string+temp)='\0';
return receive_string;
}
#endif

- - - Updated - - -

واینم ارور هاش:

Error: C:\cvavr\inc\usart.h(113): undefined symbol 'unsignedchar'
Error: C:\cvavr\inc\usart.h(114): undefined symbol 'unsignedchar'
Error: C:\cvavr\inc\usart.h(114): undefined symbol 'i'
Error: C:\cvavr\inc\usart.h(117): undefined symbol 'i'
Error: C:\cvavr\inc\usart.h(120): undefined symbol 'temp'
Error: C:\cvavr\inc\usart.h(122): undefined symbol 'temp'

- - - Updated - - -

ادامه ی ارورها:

Error: C:\cvavr\INC\hc05.h(34): can't open #include file: usart.h
Error: C:\cvavr\INC\hc05.h(53): undefined symbol 'usart_data_transmit'
Error: C:\cvavr\INC\hc05.h(66): undefined symbol 'unsigned'
Error: C:\cvavr\INC\hc05.h(66): undefined symbol 'i'
Error: C:\cvavr\INC\hc05.h(81): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(90): no matching if
Error: C:\cvavr\INC\hc05.h(103): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(145): undefined symbol 'usart_data_transmit'
Error: C:\cvavr\INC\hc05.h(34): can't open #include file: usart.h
Error: C:\cvavr\INC\hc05.h(53): undefined symbol 'usart_data_transmit'
Error: C:\cvavr\INC\hc05.h(66): undefined symbol 'unsigned'
Error: C:\cvavr\INC\hc05.h(66): undefined symbol 'i'
Error: C:\cvavr\INC\hc05.h(81): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(90): no matching if
Error: C:\cvavr\INC\hc05.h(103): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(145): undefined symbol 'usart_data_transmit'
Error: C:\cvavr\INC\hc05.h(154): no matching if
Error: C:\cvavr\INC\hc05.h(165): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(177): no matching if
Error: C:\cvavr\INC\hc05.h(187): must declare first in block
Error: C:\cvavr\INC\hc05.h(188): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(205): undefined symbol 'strcmp'
Error: C:\cvavr\INC\hc05.h(209): no matching if
Error: C:\cvavr\INC\hc05.h(220): undefined symbol 'usart_string_transmit'
Error: C:\cvavr\INC\hc05.h(232): no matching if

H.R
09-08-2018, 19:02
سلام
من با برنامه codevision برای آردوینو uno برنامه می نویسم تا اینکه آردوینوم سوخت. یه آردوینو جدید گرفتم ولی مشکل آپلود داشت ولی با برنامه خود آردوینو آپلود می شد.فکر کردم آردوینوم خرابه و یکی دیگه خریدم ولی این هم همون مشکل رو داره
ممنون می شم راهنماییم کنید

- - - Updated - - -

این ارور رو میده:
Communication error whit the arduino bord, please check the fallowing:
-the bord's pawer supply is on
-the cable between the board and the PC's USB port
-the board type and COM port are correctly set in the project|configure|after build|action|upload to arduino menu

hossein911
18-08-2018, 11:57
سلام من هم این مشکل را داشتم، کرک کدویژن را دوباره نصب کردم درست شد.
البته باید پروژه را حتما با فایلی که از داخل کرک کپی میکنی اجرا کنی