Bạn đổi (AN5) thành (AN0_AN1_AN4_AN5_VREF_VREF)
CCS tiếng Việt update - I
Collapse
This is a sticky topic.
X
X
-
-
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau:
#include "D:\PIC\tuhoc\New folder\led2.h"
#include<16f877a.h>
#include<def_877a.h>
#FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT
#use delay(clock=20000000)
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
TRISB=0x00;
PORTB=0xFF;
// TODO: USER CODE!!
While(1)
{
PORTB=0x00;
delay_ms(250);
PORTB=0xFF;
delay_ms(250);
}
}
nhưng khi dịch lại bị lỗi:
Comment
-
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau:
#include "D:\PIC\tuhoc\New folder\led2.h"
#include<16f877a.h>
#include<def_877a.h>
#FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT
#use delay(clock=20000000)
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
TRISB=0x00;
PORTB=0xFF;
// TODO: USER CODE!!
While(1)
{
PORTB=0x00;
delay_ms(250);
PORTB=0xFF;
delay_ms(250);
}
}
nhưng khi dịch lại bị lỗi:
mong các bác có kinh nghiệm xem và chỉ cho e với. thanks các bác nhiều
Comment
-
-
em mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau:
#include "D:\PIC\tuhoc\New folder\led2.h"
#include<16f877a.h>
#include<def_877a.h>
#FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT
#use delay(clock=20000000)
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
TRISB=0x00;
PORTB=0xFF;
// TODO: USER CODE!!
While(1)
{
PORTB=0x00;
delay_ms(250);
PORTB=0xFF;
delay_ms(250);
}
}
có phải bạn chưa định nghia portB nên nó báo lỗi. Bạn thử chèn ở đầu chương trình #byte portb=0xf81 xem sao.
Comment
-
Thanks bác nhìu! chờ phần 2Nguyên văn bởi txt View Post_Bản CCS tiếng Việt mới , nhiều bổ sung , có cả PIC 18 .
_Do thời gian qua bận rộn nên tài liệu vẫn chưa đầy đủ , còn thiếu nhiều , nhưng do nhiều bạn đang tiếp cận PIC gởi mail kêu ca thiếu tài liệu CCS quá , tui post lên xem đỡ .
_Bản này chỉnh sửa nhiều phần đã đăng trong CCS tiếng Việt I . Bản cũ có nhiều sai sót , nay đã sửa lại , song bản mới này chắc chắn cũng có nhiều sai sót , bạn nào đã và đang làm PIC nếu thấy chỗ nào nói sai , thiếu sót , phiền bạn lên tiếng bổ sung . Thanks !
Comment
-
-
Chào mọi người
Mình đang ở TP.HCM. mình đang tìm mua MCP23017 (Expander 16B - I2C) nhưng không biết mua ở đâu?
Bạn nào biết, chỉ mình với.
Cảm ơn nhiều!
Comment
-
Bác nói chuẩn đấy !! Do bạn ý thiếu định nghĩa PortB nên khi chạy thì máy nó không hiểu cái PortB của bạn là gì nên nó báo lỗi !Nguyên văn bởi badboy2809 View Postem mới tìm hiểu về pic.thấy bài viết của bác TXT hay wa.thanks
hôm qua em làm thử bài nháy led code e lập theo wizad như sau:
#include "D:\PIC\tuhoc\New folder\led2.h"
#include<16f877a.h>
#include<def_877a.h>
#FUSES NOWDT,HS,NOPUT,NOPROTECT,NODEBUG,NOBROWNOUT,NOLVP, NOCPD,NOWRT
#use delay(clock=20000000)
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
TRISB=0x00;
PORTB=0xFF;
// TODO: USER CODE!!
While(1)
{
PORTB=0x00;
delay_ms(250);
PORTB=0xFF;
delay_ms(250);
}
}
có phải bạn chưa định nghia portB nên nó báo lỗi. Bạn thử chèn ở đầu chương trình #byte portb=0xf81 xem sao.
Comment

Comment