Monday, September 17, 2007

Serial Servo Controller Part1

The first step toward completing the robotic arm project is to make sure the PIC Chip 16F84A gadgets are all OK. This will involve some engineering work from software, hardware, and mechanical job. As for first stage since I already got the EPICA programmer and MicroCode software, what I have to do is to write the test program for the Serial Servo Controller. As for information, the software for EPICA is called EPICWIN.EXE and the software for PIC is called MicroCode.

The code is first being programmed using MicroCode. Next, once all OK. the code is compiled and will produced a HEX code that will be burnt onto the PIC chip. The HEX code later is opened using EPICWIN where later on it will be programmed on to the PIC chip 16F84A.

The intermediate device that is used to transfer the HEX code from PC to PIC chip is called a EPICA PROGRAMMER. It is connected to the PC using 25P DSUB connector through parallel port.

Software Test
This is the code for ssc-test.bas that I used to program the Serial Servo Controller
'----------------------------------------------------------------------------------------

'NAME : ssc-test.bas
'COMPILER : PicBasic Pro - microEngineering Labs
'NOTES : Program to test the serial servo controller board
'----------------------------------------------------------------------------------------
TRISB=000000
TRISA=001101
DEFINE OSC 4
Button_1 VAR PORTA.2
Button_2 VAR PORTA.3
Led VAR PORTA.4
I VAR BYTE

Low Led
Start:

FOR I=1 TO 10
HIGH Led
PAUSE 200
LOW Led
PAUSE 200
NEXT I
Loop:
LOW Button_1
LOW Button_2

IF Button_1 = 1 THEN HIGH Led
IF Button_2=1 THEN LOW Led

GOTO Loop
END

The code is programmed using MicroCode software that later on after compiling will create a HEX file. This HEX file is used by EPICWIN to burnt onto the PIC chip.


Circuit Test
The circuit is quite simple. However to shorten the R&D period I just used the one Matthew installed on the prototype board. After correcting some wiring mistakes I managed to power it on. Firstly I thought the input DC power supply got problem because the EPICA LED is OFF. Upon checking, I found the 9V DC supply is OK. As suggested by the book author, I managed to drive the SSC circuit LED to blink 10X continuosly. Next I also managed to trigger button 1 to ON the LED and button 2 to turn OFF the same LED. In fact , this means that the assembled circuit is OK and all the parts used are OK as well. Next it also meant that I successfully burnt the program to PIC chip 16F84A. One more, this shows that the EPICA programmer is working fine. This is how it woll looks like once completed.

No comments:

Hangman