• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::

論壇索引


Board index » All Posts (rtaur)




為何APP0001板之RS-232收不到資料?
#11
初級會員
初級會員


以下是用rs-232接收來自終端機字元,
然後顯示在LCD之程式,且輸出到port D
為何都收不到,那裡出錯?
謝謝

#include "main.h"

#pragma idata access My_RAM_2

near unsigned char Rec_Data=0;

#pragma idata

void main(void)
{
char Title[16]="The DATA System"+0x00;
char p;

// Initial portD
TRISD=0x00;
PORTD=0x00;
OpenLCD();
InitializeUSART();
LCD_Set_Cursor(0,0);
putsLCD(Title);

LCD_Set_Cursor(1,0);
putcLCD('R');
LCD_Set_Cursor(1,1);
putcLCD(':');


while (1)
{
p=Rec_Data;
LCD_Set_Cursor(1,3);
putcLCD(p);
PORTD=P;
Delay10KTCYx(500);

}
}

//************************************************
//* Function: isr_high_direct *
//* - Direct execution to the actual *
//* Hi-priority interrupt code. *
//************************************************
#pragma code isrhighcode = 0x0008

void isr_high_direct(void)
{
_asm //begin in-line assembly
goto isr_high //go to isr_high function
_endasm //end in-line assembly
}
#pragma code

//************************************************
//* Function: isr_high(void) *
//* High priority interrupt: *
//* - Received a serial data from RS-232 *
//* Save the received data to buffer Rec_Data*
//************************************************
#pragma interrupt isr_high

void isr_high(void)
{
if (DataRdyUSART())
{
Rec_Data=ReadUSART(); // Get RS-232 data
}

}
#pragma code

發表於: 2005/3/30 7:39
頂部


為何程式不會停?
#12
初級會員
初級會員


以下是我的程式,為何在PORD=0xff時不會停下來?
又從0x00開始累加上去,一直循環??
而且我將c018i.c中的goto loop給remark起來也無效
//******************************************
// test.c
//******************************************

#include <p18f452.h>
#include <delays.h>

void main(void)
{
// Initial portD
TRISD=0x00;
PORTD=0x00;

while (PORTD<0xff)
{
PORTD++;
Delay10KTCYx(10);
}
}


//************************************
// c018i.c
//************************************
void
_startup (void)
{
_asm
// Initialize the stack pointer
lfsr 1, _stack lfsr 2, _stack clrf TBLPTRU, 0 // 1st silicon doesn't do this on POR
bcf FPFLAGS,RND,0 // Initialize rounding flag for floating point libs

// initialize the flash memory access configuration. this is harmless
// for non-flash devices, so we do it on all parts.
bsf 0xa6, 7, 0
bcf 0xa6, 6, 0
_endasm
_do_cinit ();

//loop:

// Call the user's main routine
main ();

// goto loop;
} /* end _startup() */
//*************************************

發表於: 2005/3/25 23:09
頂部


Re: APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
#13
初級會員
初級會員


找到問題了!
原來JICD1~3不須調整,還是放在1&2 (MCU DEBUGE)位置
MPLAB設定Programmer(Programmer-->Select Programmer-->MPLAB ICD2)
說明書也沒寫清楚,害我忙了半天!

發表於: 2005/3/21 14:59
頂部


Re: APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
#14
初級會員
初級會員


以下是我在program mode下要燒陸產生的錯誤.
程式是WAP002的範例程式ANS6中的WAP002.mcp
板子是app001 ,Jumper JICD1~3也都放在2&3 (PROGRAMER),MPLAB 也設定在PROGRAMER

build all都ok,program時卻不成功,請問是什麼原因?

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x21, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0x21, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Erasing Target Device...
ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation
...Erase Succeeded
MPLAB ICD 2 Ready
Programming Target...
ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation
ICDWarn0035: Debug mode must be disabled. Disable debug mode or cancel?
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x1C6F)
...Programming User IDs
Verifying...
ICDWarn0052: MPLAB ICD 2 cannot validate a target device. Please make sure that the target device is connected and properly powered. Select "OK" to continue, or "CANCEL" to abort the operation
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0xEFBF, Val Read = 0x0)
ICD0275: Programming failed.
MPLAB ICD 2 Ready

發表於: 2005/3/21 14:15
頂部


APP001 REV2用ICD2燒錄程式後如何獨立執行,不用ICD2?
#15
初級會員
初級會員


如果將程式用ICD2 DownLOAD到APP001的CPU上
拔掉ICD2的接頭,APP001應該要調那一個JUMPER或接線?
可以讓APP001獨立執行,不用ICD2來啟動?
其他如APP005及APP009又該如何調整?
謝謝!

發表於: 2005/3/20 15:09
頂部


APP001說明書與實際電路板不符?
#16
初級會員
初級會員


昨天買了一塊APP001與所附說明書對照之下發現有很多不一樣的地方.
1.相片上很多零件實際多沒插,例如U3,C9,D13,L1,C8,OSC1等,我想是為了省成本.
2.板子的右半部完全不同.
3.RS-232之設定為何,可否直接接MPLAB IDE程式,
4.板子上附的溫度顯示及PWM控制程式是否有列表.
5.CPU插座不是用有拉桿的省力插座,應該又是成本的關係.
====================================
建議趕快更新網頁上的資料及所附的說明書.
用點時間撰寫針對APP001,APP005,APP009等詳細一點的說明書,以方便想入門的大眾,功德無量!
謝謝!

發表於: 2005/2/22 11:56
頂部


Re: 如何自製燒錄線路及程式?
#17
初級會員
初級會員


參照:

Ryang 寫道:
在Microchip網站上找 DS30277D 有詳細的 ICSP 程式與電路。


該文件我有看過:
只有提到12C5XX,16CXX,17CXX,16F8XX
沒有提到線路在18FXX及dsPIC30FXX可否使用?
Programming Specification是否相同?
程式要否調整?
報歉問了許多問題!

發表於: 2005/2/16 3:02
頂部


如何自製燒錄線路及程式?
#18
初級會員
初級會員


如果沒有MPLAB ICD2或燒錄器的話,
有沒有簡單的線路及程式可以直接將.HEX或.BIN燒到
PIC18FXXX或dsPIC30FXX等cpu上
或應該reference which document?
或是有更便宜的ICSP KITS
謝謝!

發表於: 2005/2/15 14:41
頂部


Re: 請問Data Sheet中Standard Flash與Enhance Flash有何不同?
#19
初級會員
初級會員


參照:

Ryang 寫道:
Standard Flash : 抹寫次數約 1000 次;沒有自我燒錄功能;沒有內建的 EEPROM;比較便宜。點型的元件如 : PIC16F73,PIC16F74...等。

Enhance Flash : 抹寫次數約 100000 次;有自我燒錄功能;內建的 EEPROM;比較貴。點型的元件如 : PIC16F877,PIC18F452 等大部分的PIC。


何謂自我燒錄?可否解釋一下?
謝謝

發表於: 2005/2/15 9:38
頂部


請問Data Sheet中Standard Flash與Enhance Flash有何不同?
#20
初級會員
初級會員


請問在Data Sheet中之規格
有Standard Flash與Enhance Flash兩種
有何不同?

發表於: 2005/2/14 16:01
頂部



« 1 (2) 3 »



:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------