This dsPIC30F4011-based servo (position) controller receives commands via a CAN. If a DC motor does not have a rotary encoder, you can plug a contactless magnetic rotary encoder (CMRE) module into the board (via two SIL connectors) and provide (in a self-contained unit) rotary encoder and position control.
Mariano Lizarraga Fernandez, the designer, explains that the board in this project also fully configurable via a CAN network and no power-cycle is necessary for any change to take effect. The board has programmed PID controllers with selectable parameter from user. The controller gains, maximum and minimum pwm commands, and device ID are also configurable. All configuration values are stored in the dsPIC's EEPROM so once it is configured at the full contempt of the end-user, no more changes are required.
The wearable Musical Gloves enable you to play various forms of music on virtually any surface. This exciting wireless system is built around an MC13192 SARD board’s MC9S08GT60 MCU, MC13192 transceiver, and MMA6261Q (x- and y-axis) and MMA1260D (z-axis) accelerometers. The gloves are instrumented with fingertip switches and the three axis accelerometers. The system tracks finger presses, which start and stop notes, and hand motion, which determines the loudness and octave of each note. The Musical Gloves are connected via a wireless RF connection to a host PC, which processes the finger presses and accelerometer readings in order to control the musical output. This project created and build by Steve Kranish. Download :
The creative Virtual Interactive Boxing system makes shadow boxing more interesting by providing a virtual opponent with whom to spar. Designed around an MC9S08GT60 microcontroller and an MC13192 RF transmitter, the system monitors the user’s performance. Enhancements include digitized audio and speech that provide motivational cues and feedback about the user’s performance to help him improve his technique. Download :
AVR has two programming modes: Mode Programming Parallel (Mode Parallel) and Serial Downloading Mode (ISP mode).
At Mode Parallel, device which will be program placed at programming socket and required tension 12V at pin RESET. Communications between programmers and device is done with instruction of programming in parallel. Programming speed of twice the quickly is compared to ISP Mode. Way of this programming usually applied in pre-program and/or ISP Mode cannot be applied by factor design. Most of the programmer, except STK500 seen to be doesn't support this mode.
At ISP MODE, device communicates through SPI interface to programming and verification. This mode only requires three lines signal programming without tension of 12 Volts, causing earns target system program direct - ISP ( In-System Programming). But, ISP MODE cannot change fuse bit at some device, and some device doesn't have features ISP. Device like this must be program in parallel.
When using AVR with ISP Mode, target of board must be designed by considering function of ISP, what applies pin ISP: RESET, SCK, MISO and MOSI. Pin ISP can share between function of I/O and ISP satisfactorily. When using pin I/O having function of ISP, hopes paid attention of this things:
a. Inserts a resistor between pins RESET and reset network to avoid interference from reset network.
b. Ensures that action ISP doesn't generate effect at other function.
c. Men-drive doesn't from external network when operation ISP takes place, or if desired that way, need to be inserted a resistor.
d. Doesn't attribute to heavy burden because will influence function of ISP.
Character %_ used as pattern conversion operator. Pattern conversion would very useful at the time of we present result to LCD. There are some kinds of pattern conversion along with the function. For example:
a. %d functioning to presents positive integer. example: sprintf(buf,"Angka %d",14);
b. %o functioning to presents integer octal number.
c. %x functions to present number heksa decimal integer.
d. %u useful to presents number decimal without sign.
Often we find group of instruction for a certain need often implemented in a program. Group of this instruction can be made as procedure or function. Stepped this will be able to economize memory compared to if the instruction is written repeatedly. Remember, program in microcontroller to have a real limited memory.
Definition of Procedure.
Procedure is a gathering of instruction to do a certain need without returning a value.
Under this is as of cut-off example of way of writing of program at procedure making;
Function is a gathering of instruction to do a certain need with return end result of the value and need. Under this is writing concept of its(the program.
...
Type data name_function ( parameter1, parameter2,... parameter N)
{
Statements;
return variable_result;
}
...
Example:
...
int wide(int width, int height) {
wide = width*height
return wide;
}
...
Denominating of procedure or function of done directly by writing down its(the procedure or function.
In last matter of we have tried studies about header, etc. Now we will to continue study about programming structure C. At this structure we study about reserved keywords, operator and ramification.
1. Operator.
Operator is an instruction of fit containing operator and operand. Operand is variable which is the part of statement while operator is a symbol expressing which operation will be done by operand. For example:
c = a+b
There is 3 type operand (a,b and c) and 2 operator (= and +).
Operator in programming of C divided to become 3 group;
a. Unary is operator operating on one operand, example; - nitrogen.
b. Binary is operator operating on two operand, example; a-n.
c. Nitrogen is operator operating with three or more operand, example; a= ( b*c)+d
2. Reserved Keywords.
Reserved keyword is glossary is standard which useless for label, identification or variable. Following the glossary;
breakflashsignedcontinue
bitfloatsizeofif
caseforsfrbstruct
charfuncusedsfrwdefault
constgo to staticinline
switchdointtypedef
doubleinterruptunionunsigned
eepromlongelseregister
voidenumreturnvolatile
externshortwhile
3. Branching
In doing ramification at programming of C there is 4 form of public.
a. if - then.
b. if - then - else
c. switch - case
d. switch - case - default
We will study one by one to the four instructions.
a. If - then
Form of generally is
if (condition) {
// statement
};
Mean was statement will be implemented if condition full filled. For example is
if (a<0x55)>
PORTC=0x55;
};
In this example PORTC will be sent data 0x55 (remembers in the form of heksa) if value a smaller than 0x50.
b. if – then – else
Form of generally is
if (condition) {
// statement a
}
Else {
// statement b
};
Mean is statement of a will be implemented if condition full filled and statement of b will be implemented if condition is not full filled. For example;
PORTC will be sent data 0x55 if value a smaller than 0x50 and PORTC will be sent data 0x44 if a>0x50.
if (a<0x50)>
// PORTC=0x55;
}
Else {
// PORTC=0x44
};
c.switch – case
Statement switch - case is applied if happened many ramifications. Writing structure in general is;
…
switch (expression) {
case constant 1:
Statement1
break;
case constant 2:
Statement 2
break;
case constantN:
StatementN
break;
}
…
For example:
…
switch (a) {
case 1:
PORTC=0x01;
break;
case 2:
PORTC=0x02;
break;
case3:
PORTC=0x04;
break;
}
…
PORTC will be sent data 0x01 if value a=1, PORTC will be sent data 0x02 if value a=2 and PORTC will be sent data 0x04 if value a=3.
d. switch – case – default.
Statement switch - case - default much the same to with switch - case. Becoming difference was there is default hence otherwise there is condition of case matching with expression switch hence would towards statement which there is part of default. This writing structure like under this;
switch ( expression) {
case constanta 1:
statement 1
break;
case konstanta 2:
statement 2
break;
case konstanta N:
statement N
break;
default:
statements;
}
For example:
switch (a) {
case 1:
PORTC=0x01;
break;
case 2:
PORTC=0x02;
break;
case 3:
PORTC=0x04;
break;
default:
PORTC=0xFF;
}
PORTC will be sent data 0x01 if value a=1, PORTC will be sent data 0x02 if value a=2 and PORTC will be sent the data 0x04 if value a=3 and if condition of case unmatched to expression hence statement at default will be implemented.