Friday, 20 January 2012

Got the idea.

At last I got the idea but I do not know how and where to start it.
To fully test the device operationally, I should test each peripheral module, ADC, USART, Timers, Comparators, etc.
A test "jig" board which can provide various analog and digital stimuli combined with test results transmitted through a serial connection to a monitoring PC is an option.
The devices program can be designed to manipulate the various stimuli inputs recording the results as the test progresses.
Environmental testing requires subjecting the device to both its stated temperature range and operational voltage range while running the above tests.
This is usually performed with a test "jig" board which can be mounted in an environmental chamber where temperature and humidity can be precisely controlled.
However, I'll most likely need to utilize a freezer and oven which provide adequate control over the temperature levels.
It all depends on how well you need to test the device and compare your findings to the devices datasheet.
And I still been thinking how to start stimulate it. I hope next week I'll show some progress to Dr.Zul.

Wednesday, 18 January 2012

First class of C Programming

Yesterday, Dr.Zul ask me to join his programming class so I can learn more about programming. He said, actually on Monday is the first class but I'm on leave. So, I have left behind a class but it doesn't matter at all, I can learn slowly. In the class, I have learn how to swap the program, then compute because an important reason for using a computer - very fast calculation.
Arithmetic instruction format:
var = <var/const><arithmetic operator><var/const>
Among the arithmetic operators are:
+, -, *, /(division), %(mod)
Any formula can be translated into the arithmetic instruction format.
Computer can also make decision. We use keywords if, if-else, if-elseif, switch.
Conditional statement format:
<var/const><conditional operator><var/const>
where the conditional operators are:
>, <, >=, <=, == (equal), !=(not equal)
and the result of the conditional operation either 0(false) or 1(true). In fact, other than 0 is equal to true.

Using if statement:
*If using only one statement, use semicolon. If more tahn one statements, use block.Then, no need semicolon.

Using switch statement:
*no semicolon after the block
*without break, then if ans== Yes, the computer will print both Yes, No and Others.

Equivalent using if-else.

Wednesday, 11 January 2012

PIC16F877A..??


Today, I just studied on PIC16F877A. Try to understand more on the IC. About the device overview, memory organization, Data EEPROM and flash program, and etc.
Some of the basic features :
1) 200 nanosecond instruction execution
2) 35 single words instruction
3) CMOS FLASH-based 8-bit
4) 40 or 44 pins packages
5) Memory : RAM/ROM (EEPROM)
6) Timers (2X8 bit & 1X16bit)
7) ADC (8 channels, 10 bit)

This is PIC MIcrocontroller block diagram : 


The software for PIC16F877A can be written using :
1) Assembly language
2) Pseudocode
3) C Programming

C Programming is preferred. Allowing application to be written using syntax is easier to understand than using Assembly Language. C source code is converted into assembly language by compiler, then assemble using machine codes. The machine codes are stored in a hex file.

*** to be continue***