新人报到,前几天第一次和PSOC亲密的接触,照着书本熟悉设计界面.感觉还行.不过问题也多了.希望大家给点建议和经验.下面是SPIM的程序.编译没问题,但用试波器测不到信号. #include <m8c.h> #include "PSoCAPI.h" // PSoC API definitions for all User Modules #include"psocgpioint.h"
CHAR Message[] = "Hello World."; CHAR *pbStrPtr = Message; void main() { M8C_EnableGInt; SPIM_Start(SPIM_SPIM_MODE_0 | SPIM_SPIM_MSB_FIRST); while( *pbStrPtr != 0 ) /* While data remains to be sent */ { SPIM_EnableInt(); /* Ensure the transmit buffer is free */ while( ! (SPIM_bReadStatus() & SPIM_SPIM_TX_BUFFER_EMPTY ) ); SPIM_SendTxData( *pbStrPtr ); /* load the next byte */ pbStrPtr++; } }
我有想过是不是资源设置方面有问题,,,但不知怎么做......期待.急...谢谢
|