Keywords: Category:
 
Using PraSel Instruction in EzCode4E
TIME: 2009-3-4
 
Multiple IO ports are used for bonding selection in many cases of application. However, if the AM4E input port receives high level, the current leakage may occur. Or in some cases of motor system, the leakage may also occur when the input port of positioning point receives high level. To avoid this problem, EzCode4E has included the PraSel instruction, which can change the status of Pra port and thus solve the leakage problem effectively
 
This article illustrates how to use PraSel instruction by taking the example of motor positioning before it enters into sleep mode.
 
Instruction Description
 
PraSelpra3pra2pra1pra0
pra(n):{I,O}  I means input,O means output.
 
Ex
PraSel(i,i,o,o)        ;Pra3 and Pra2 are set as input. Pra1 and Pra0 are set as output.
 
AvddPra is a special procedure to mask the input state of Pra port if it is used for other functions. And it can also prevent the interference caused by Pra port status change when scanning key-press.
 
Ex
 [Procedure]
   Avddpra
   {
     Andia  B’0001’
   }
This procedure is to ignore Pra1, Pra2, and Pra3 pins when scanning key-press in EzCode4E.
 
Program Function Description
The following takes motor as an example to explain program function.
After power on, the Prb3 can trigger motor to rotate. Until the Prb3 contacts the high level, the motor will stop rotating. Then the input state of pin is changed to output state and output high level, finally it enters into sleep mode.
 
Another function, after Pra2 is pressed, it will trigger midi playing and motor rotating. Until the playing is ended and the point contacts the high level, it will stop rotating. Then the pin input state is changed to output state and output high level, finally it enters into sleep mode.
 
Setting Steps
1. Create a file and select an AM4E Body (e.g. AM4EC005).
2. Fill in client name (agent name) in Project page.
3. Add Melody.
4. Set input and output pin as the figure1 shows.

... ...

PraSel.rar

ORIGIN: ICE
BACK TO TOP PRINT ADD TO FAVORITE SUBMIT CLOSE
 
>>
 OTHERS
 
·Application Note of Recording Modes (EzCode4...
·Using Midi Background
·How to Use General I/O to Drive LCD?
·The Application of One Key One Note
·Making an LED fan by ALPHA MCU
·Using ALPHA IC in Serial Communication
·Application of the Action Function
·Using AM8EB for I2C Communication
 
>>
 RECOMMENDED
 
·About the Recording Duration of AMSR Series ...
·EzCode4E Solutions
·Application Note of Recording Modes (EzCode4...
·Using Midi Background
·The Control of Silicon Controlled Rectifier
·The Application of One Key One Note
·Portamento Effect in AM4F
 
 

About Us Contact Us Disclaimer


ICP Record : 08035793 Prepared Guangdong ICP