TMS320F2812Сϵͳ 22
ʵ棬bΪƫУ㷨ľ岽£
1֪οѹźŵתֵylyh
2תy?x?ma?b֪IJοߡ͵ѹֵ?xt,yt??xh,yh?ʵƫʵma??yh?yt?/?xh?xt?ƫb?yt?xt?ma
3뷽x?y?mb?mcתy?x?ma?bóУmb?1/maУʧmc?b/ma
4У漰УʧӦͨADCתУ
3-1УǰɼݵľͱȽϣ
3-1 УǰɼݵıȽ
ֱֵ ѹ 0V 1V 1.5V 2V 0 1365 2047.5 2730 ʵֵ 5 1411 2106 2812 Уֵ 1 1373 2051 2725 ʵ 0.973 У 1.028 ʵʧ 0.00356V ͨ3-1ıȽϣ֪УֵֵȽϽӽ˵TMS320F2812ƬA/DУɹ
3.4 SCIģ
ͨSCIӲӿƵĽܣ֪δڴӲΪɲɼݵ˳䣬дڴڴУͨDSPоƬĴλĶдعܺͿơнϸ˵˼·ܡڵȫѭοľ涨
Ϊ˼СͨʱCPUF2812оƬSCIģķͽ16ȵFIFOҷͽжʹܺжλʹݿڰ˫ȫ˫ģʽ¶ܴ͡ΪȷݵԣSCIģԽյݽжϼ⡢ԡ֡ͳʱ⡣ͨ16λIJʿƼĴб̣òͬSCIͨʡF2812оƬ֧ԶʼݺͽݿɲжϺͲѯַʽ
ݵķͺͽ֮ǰԴڽгʼϵͳжSCIAڽвڴϸ˵SCIAڵijʼ
ȽDSPоƬĵ155ţSCITXDA͵157ţSCIRXDAó蹦ܣGPFMUXĴд0x0030
ţSCIAڵͨſƼĴд0x07趨첽/ͨģʽSCIAڵĿƼĴ1д0x03ʹSCIͷSCIRXD
TMS320F2812Сϵͳ 23
Ͻյݻ͵λĴSCIRXBUFУܴSCITXDϷͳȥƼĴ2д0x03ʹܷͻͽջжϣSCIAڵIJʼĴֽд0x00ʼĴֽд0x27ɲʼ㹫ʽöӦΪ115200أSCIAڵĿƼĴ1д0x23SCIλ
PIEΧжϼĴĵ9жϼĴд1ʹܽաжϡˣSCIAڵijʼ
ģзݲòѯʽݲжϷʽ
ʱF2812÷ͱ־λSend_FlagѯSCIڵĿƼĴ2е8λTXRDYͻĴñ־λ״̬TXRDY=0ʾSCITXBUFٷݣTXRDY=1ʾSCITXBUFգýһַʱɽɼصijһͻСӳͼ3-4ʾ
ݵӳλѭУͻĴñ־λͷͱ־λͬʱΪ1ʱÿηһֽڣͬʱӣһѭзһֽڡݷϺͱ־λSend_Flag0
ʱжռF2812PIEжRXAINTSCIյһֽںѽλĴRXSHFеݷ͵ջĴУͬʱվ־λRXRDYλжϱӦжӦӳͼ3-4ʾ
жӦӳжSCI״̬Ĵĵ7λRXRDYǷΪ1Ϊ1ֱӷΪ1ݻĴSCIRXBUFеݴָıУȻҪPCҪݴ뷢Уͬʱ÷ͱ־λSend_Flag
ͼ3-4 жӦӳ
TMS320F2812Сϵͳ 24
SCIijʼ£ #include \void InitSci(void) {
ScibRegs.SCICCR.all = 0x07; //ݳΪ8λ ScibRegs.SCICTL1.all = 0x03; //ͺͽ
ScibRegs.SCICTL2.all = 0x03; //RXRDY/BRKDTж
ScibRegs.SCIHBAUD = 0x01; //Ϊ19200bps LSPCLK=62.5MHz ScibRegs.SCILBAUD = 0x96;
ScibRegs.SCIHBAUD = 0x01; //9600bps LSPCLK=62.5MHz ScibRegs.SCILBAUD = 0x86;
ScibRegs.SCIFFTX.all=0x4000; //ʹSCI FIFOǿ ScibRegs.SCIFFTX.all|=0x2000; //ʹܷFIFO ScibRegs.SCIFFTX.all|=0x8000; //SCI FIFOԻָͻ
ScibRegs.SCIFFRX.all=0x4041 //RXFFOVF־λRXFFINT־λýFIFOжϼΪ1
ScibRegs.SCIFFRX.bit.RXFIFORESET=1; //ʹܽFIFO
ScibRegs.SCIFFRX.bit.RXFFIENA=1; //ʹܻRXFFVLƥRX FIFOж
ScibRegs.SCIFFCT.all=0x0008; //ÿFIFOͻ//һλ//ĴӳΪ8ӳ
ScibRegs.SCICTL2.bit.TXINTENA=1; //SCITXBUFĴжʹ ScibRegs.SCICTL2.bit.RXBKINTENA=1; //ʹRXRDY/BRKDTж ScibRegs.SCICTL1.all = 0x23; //ĴúãSW RESET1ͺͽ
}
TMS320F2812Сϵͳ 25
4 ϵͳ
TI˾DSPоƬTMS320F2812ǿĹܼܼ۸ȣ㷺ӦáֳӺ͵ŸţʹʵеϵͳֳװȴܹȶعDSPӦϵͳĿɿơżӦñԽԽҪˣͬʱDSPһЩбڵƬص㣬DSPϵͳĿżҲص㡣
4.1 ŵԴ
ſظ·DSPϵͳҲԳʽӿռDSPϵͳҪռţϵͳţͨš
ŶDSPϵͳÿԷΪλ
1ϵͳŵźϣʹݲɼرǰͨĴӿСѹźʱأ
2ϵͳʹźŻңӦDSPϵͳʵһϵغ
23DSPϵͳںˡʹϵźŴңʧڲָ3ң״̬ʧ飬RAMݱģصĻᵼʹϵͳȫ 4.2 Ӳ 4.2.1 Ӳ ӲЧʸߣӲʩõԽž֮⡣ӲżҪ¼֣ 1롣ͨͨϢɽDSPϵͳִءִлӵϸ뿪赲ܴһָţ 2Ӳ˲RCͨ˲ԴƵźţࡰë̡ţ 3ӵϵͳơEMCУɲӵġһDSPϵͳУߵ϶࣬ءźŵءεءصȡֵ·ڸƵʱԴȽϴģԴһʹʱͻģԴɸţTexas Instrument1999ϵͳڲͬԴͲ֮ͬӵеķʽ[26]·ͼ4-1ʾ 3.3VVCC3.3VGNDL1L2L3L4PLLVCCAVCCP1VCCAAGNDͼ4-1 и