PIC Vietnam

Go Back   PIC Vietnam > Robotics > Điều khiển

Tài trợ cho PIC Vietnam
Trang chủ Đăng Kí Hỏi/Ðáp Thành Viên Lịch Bài Trong Ngày Vi điều khiển

Điều khiển Lý thuyết điều khiển và ứng dụng lý thuyết điều khiển trong những trường hợp thực tế

 
 
Ðiều Chỉnh Xếp Bài
Prev Previous Post   Next Post Next
Old 23-03-2009, 04:43 PM   #1
minh_luandt
Nhập môn đệ tử
 
Tham gia ngày: Dec 2008
Bài gửi: 10
:
Rắc rối với CYWUSB6935 WirelessUSB LR

Em đang làm đồ án về con CYWUSB6935 WirelessUSB LR nhưng đang gặp vài vấn đề như sau:
1. Về nguồn VCC ,datasheet nói Vcc là 3,3v nhưng sao khi cắm module nó vào thì áp ko ổn định và thường chỉ đạt 2,2 -2,5v thôi???
2,Không biết có phải do áp như trên hay ko mà khi ghi và đọc các thanh ghi của module bằng SPI thì lúc được lúc ko

----------------------------------------------
void CYWM_WriteReg(unsigned int8 which,unsigned int8 data)
{
output_low(CYWM_nSS);
delay_ms(1);
SPI_write(REG_Write | which);// REG_Write =0x80
delay_ms(1);
SPI_write(data);
delay_ms(1);
output_high(CYWM_nSS);
}
unsigned int8 CYWM_ReadReg(unsigned int8 which)
{
output_low(CYWM_nSS);
delay_ms(1);
SPI_write(which);
delay_ms(1);
spi_write(which);
delay_ms(1);
output_high(CYWM_nSS);
return SSPBUF;
}

int main()
{
unsigned int8 n;
unsigned int8 test;
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_MASTER|SPI_L_TO_H|SPI_CLK_DIV_16);
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);// This device COMP currently not supported by the PICWizard
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

// TODO: USER CODE!!
// Set initial pin states
output_high(CYWM_nPD);
delay_ms(50);
output_high(CYWM_nRESET);
delay_ms(50);
output_high(CYWM_nSS);
delay_ms(50);

for (n=0; n<1; n++)
{

output_high(LED_PIN);
delay_ms(500);
output_low(LED_PIN);
delay_ms(500);
}



// Setup radio
while(1)
{
delay_ms(500);

CYWM_WriteReg( REG_CLOCK_MANUAL, 0x41 );
test=CYWM_ReadReg(REG_CLOCK_MANUAL);
if (test==0x41)
{

output_high(LED_PIN);
delay_ms(50);
output_low(LED_PIN);
delay_ms(50);
}
else
{
output_low(LED_PIN);
delay_ms(50);
output_low(LED_PIN);
delay_ms(50);
}
}
}



Có ai đã làm rồi giúp em với nha
minh_luandt vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
 


Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt

Chuyển đến


Múi giờ GMT. Hiện tại là 10:21 AM.


Được sáng lập bởi Đoàn Hiệp
Powered by vBulletin®
Page copy protected against web site content infringement by Copyscape
Copyright © PIC Vietnam