회원가입 ID/PW 찾기
AA
 아크마님께서 전에 올려주신  ds1620을 이용한 온도측정기 글에 따라 제작하고

첨부한 소스를 빌드시 아래와 같은 오류가 발생하였습니다.

혹시 제가 뭐 잘못한게 있는지?    AVR  Studio    와 |WinAVR 을 사용했습니다.

rm -rf ds1620.o ds16202.o  ds1620.elf dep/* ds1620.hex ds1620.eep
Build succeeded with 0 Warnings...
avr-gcc.exe  -mmcu=atmega16 -Wall -gdwarf-2 -O0 -MD -MP -MT ds1620.o -MF dep/ds1620.o.d  -c  ../ds1620.c
avr-gcc.exe  -mmcu=atmega16 -Wall -gdwarf-2 -O0 -MD -MP -MT ds16202.o -MF dep/ds16202.o.d  -c  ../ds16202.c
../ds16202.c:19: error: parse error before "value"
../ds16202.c: In function `ds1620_set_CLOCK':
../ds16202.c:21: error: `value' undeclared (first use in this function)
../ds16202.c:21: error: (Each undeclared identifier is reported only once
../ds16202.c:21: error: for each function it appears in.)
../ds16202.c:22: warning: implicit declaration of function `SETBIT'
../ds16202.c:22: error: `PORTA' undeclared (first use in this function)
../ds16202.c:22: error: `PORTA1' undeclared (first use in this function)
../ds16202.c:24: warning: implicit declaration of function `CLRBIT'
../ds16202.c: At top level:
../ds16202.c:28: error: parse error before "value"
../ds16202.c: In function `ds1620_set_RST':
../ds16202.c:30: error: `value' undeclared (first use in this function)
../ds16202.c:31: error: `PORTA' undeclared (first use in this function)
../ds16202.c:31: error: `PORTA2' undeclared (first use in this function)
../ds16202.c: At top level:
../ds16202.c:36: error: parse error before "value"
../ds16202.c: In function `ds1620_set_IO':
../ds16202.c:38: error: `DDRA' undeclared (first use in this function)
../ds16202.c:38: error: `PORTA0' undeclared (first use in this function)
../ds16202.c:39: error: `value' undeclared (first use in this function)
../ds16202.c:40: error: `PORTA' undeclared (first use in this function)
../ds16202.c: At top level:
../ds16202.c:46: error: parse error before "ds1620_get_IO"
../ds16202.c:47: warning: return type defaults to `int'
../ds16202.c: In function `ds1620_get_IO':
../ds16202.c:48: error: `PORTA' undeclared (first use in this function)
../ds16202.c:48: error: `PORTA0' undeclared (first use in this function)
../ds16202.c:49: warning: implicit declaration of function `CHKBIT'
../ds16202.c:49: error: `PINA' undeclared (first use in this function)
../ds16202.c:49: error: `PINA0' undeclared (first use in this function)
../ds16202.c: At top level:
../ds16202.c:52: error: parse error before "BYTE"
../ds16202.c:52: warning: type defaults to `int' in declaration of `degree'
../ds16202.c:52: warning: data definition has no type or storage class
../ds16202.c:54: error: parse error before "data"
../ds16202.c: In function `Put1620byte':
../ds16202.c:56: error: `BYTE' undeclared (first use in this function)
../ds16202.c:56: error: parse error before "i"
../ds16202.c:59: error: `i' undeclared (first use in this function)
../ds16202.c:65: error: `data' undeclared (first use in this function)
../ds16202.c: At top level:
../ds16202.c:79: error: parse error before "Get1620byte"
../ds16202.c:80: warning: return type defaults to `int'
../ds16202.c: In function `Get1620byte':
../ds16202.c:82: error: `BYTE' undeclared (first use in this function)
../ds16202.c:82: error: parse error before "i"
../ds16202.c:84: error: `DDRA' undeclared (first use in this function)
../ds16202.c:84: error: `DDA0' undeclared (first use in this function)
../ds16202.c:86: error: `data' undeclared (first use in this function)
../ds16202.c:87: error: `data1' undeclared (first use in this function)
../ds16202.c:95: error: `i' undeclared (first use in this function)
../ds16202.c: In function `ds1620_Init':
../ds16202.c:126: error: `DDRA' undeclared (first use in this function)
../ds16202.c:126: error: `DDA1' undeclared (first use in this function)
../ds16202.c:127: error: `DDA0' undeclared (first use in this function)
../ds16202.c:128: error: `DDA2' undeclared (first use in this function)
../ds16202.c: At top level:
../ds16202.c:139: error: parse error before '*' token
../ds16202.c: In function `GetTemperature':
../ds16202.c:141: error: `BYTE' undeclared (first use in this function)
../ds16202.c:141: error: parse error before "data"
../ds16202.c:148: error: `WORD' undeclared (first use in this function)
../ds16202.c:148: error: parse error before "count_remain"
../ds16202.c:161: error: `data' undeclared (first use in this function)
../ds16202.c:225: error: `temp_and_half_bit' undeclared (first use in this function)
../ds16202.c:226: error: `sign_bit' undeclared (first use in this function)
../ds16202.c:233: error: `count_remain' undeclared (first use in this function)
../ds16202.c:243: error: `count_per_c' undeclared (first use in this function)
../ds16202.c:262: warning: implicit declaration of function `sprintf'
../ds16202.c:262: error: `ptrTemp' undeclared (first use in this function)
../ds16202.c:262: warning: double format, float arg (arg 3)
../ds16202.c:262: warning: embedded `\0' in format
make: *** [ds16202.o] Error 1
Build failed with 49 errors and 10 warnings...
댓글 1
  • No Profile
    전에 군대에서 만드신다던 푸르미님이신거 같군요..

    일단 avrxx.h 와 같이 avr 모델에 따른 헤더파일을 인클루드 해줘야되고요

    128일경우에는

    #include "avr128.h"

    이런식인데 컴파일러마다 조금씩 다르니까 확인해보셔야 합니다.

    매크로로 사용된 setbit등도 main문 위에서 정의되어야 합니다;;

하드웨어 설계 및 개발에 대하여 개발자들이 자유롭게 토론하는 공간입니다.
- Q&A, 자유주재 토론, 관련 정보 공유
- 분야 : 마이크로프로세서 응용, 전기/전자(아날로그/디지털) 회로 설계, C/C++ 프로그래밍, 펌웨어,
         PCB Artwork, 트러블슈팅 등 하드웨어 설계에 관한 전반인 내용
※ 게시글에 맞는 분류를 선택하여 글을 작성해 주시면 쾌적한 사이트 운영에 많은 도움이 됩니다.
※ 하드웨어 인사이트는 회원들간의 거래정보를 게재할 뿐이지, 그 어떤 책임과 의무도 가지지 않습니다.

search
번호 분류 제목 글쓴이 조회 수 날짜
1 Sensor 설계 HOT사진에 있는 tr 제품명이 먼지 알고 싶습니다 ㅡㅜ5 텐지무용 1160 2010.11.22
  • 문제는 목적지에 얼마나 빨리 가느내가 아니라 그 목적지가 어디냐는 것이다.
    - 메이벨 뉴컴버
  • * 납포인트 정보 *
  • 글 작성 : 3
  • 댓글 작성 : 1
  • 내 글이 추천받음 : 1
저작권법에 위배되는 콘텐츠는 등록 불가하며, 저작물에 대한 권리는 저작자에게 있습니다.
Copyright 2006-2021 © hardwareis.com, All rights reserved.