PICkit2 - Tutorials, Experiments
PICkit 2 - Small size USB programmer
from Microchip.
How to use it as a demo device for
USB programming in C language
Java SE SWING JSR-296 Example
How to run background task in
JSR-296 SWING application
with 'busy animation' in the status bar.
Useful addition to Netbeans template.
Computer vision
Vision is the main sense of our robots.
See some Java algorithms we use
Tips-n-Tricks
Some advices about hardware and software tricks
PIC Programming
(firmware)
Assembler program for PIC16F628A
Communication program for sending
commands from cell phone to motors.
Driver for motor controller.
RoboHobbyPlugin
Open Source project on
SourceForge, Java brain
for the robot
Here you can download an assembler program for PIC16F628A.
This program is a part of our robotics project.
Main part of our project is a J2ME program, which works on cell phone.
We use cell phone as a 'brain' of our robot.
But we need some assembler programming for technical purpose.
Cell phone can not drive DC motors.
But it can send byte to serial interface via cell phone socket.
We use for this special additional board, which uses PIC (Microchip) processor.
And program on this page is a kind of 'software driver' (firmware) for our robot.
We are trying to keep the PIC assembler part of our robotics project as simple as possible.
All 'business logic' we put to cell phone Java program.
And this assembler program we use just for a very primitive function:
The program receives 1 byte from serial interface from Java cell phone
and put this value to the port.
It just turn on/off some contacts (put voltage to some pins/legs on the PIC chip).
There are no any timers here - we moved timing function to Java program.
Now Java program decides - how long this or that motor should work.
It is not a function of PIC assembler program.
We are Java programmers and we are trying to keep ASM part in very simple form.
Download it and have fun!
The code:
;
; www.RoboHobby.com
; Assember code for PIC processor PIC16F628A.
;
; Motor driver for small hand-made robot.
; (c) 2004-2006, Oleg Lioubtchenko, Anton Lioubtchenko
;
;
list p=16F628A, r=DEC
#include "P16F628A.INC"
;******************************************
;* Wait for a char from RS232 - return in W
receive:
btfss PIR1,RCIF ;wait for a byte from RS232
goto receive
movf RCREG,W ;return received byte in W
return
;*************************
transmit:
movwf TXREG ;transmit byte in W
bsf STATUS,RP0 ;bank 1
send1: btfss TXSTA,TRMT ;is the transmission done?
goto send1 ;no, then go again
bcf STATUS,RP0 ;bank 0
return ;OK, done
;*******
;* Delay
delay movlw 60
movwf loop1
outer movlw 200
movwf loop2
inner nop