Jump to content
Sign in to follow this  
Flutter

Any PICALL users here?

Recommended Posts

Any one of you using PICALL (or P16PRO) programmer here? I got one,but I need to get the answers on some basic questions before I can get going. I really need a very basic example (like making diodes flash on a PIC16F84) to see how I implement the code in the main window (what goes in program memory and what goes in data memory).

Flutter

Share this post


Link to post
Share on other sites

Hey, you're in luck. I just went through all this - encountering and solving a bunch of problems.

First off, I must say that I never got PICALL to work properly with my P16PRO board. You may have a different experience, but I ended up using the programmer at www.ic-prog.com.

Actually, before I repeat myself, look for my thread on the piclist Yahoo group. It's got my whole story:

http://groups.yahoo.com/group/piclist/message/3665

OK, and here's a very simple LED flasher program. Just enter this into MPLAB (from Microchip) and compile it into a .HEX file, then open it with your programmer application. Program the chip and you're off and running! (of course you'll need to set up a breadboard).

;################################################

;# Program: Flash.asm -- Flashing LED

;# Author: Jeff Swayze

;# Date: December 18, 2003

;#

;# Description: Simply flashes an LED on RB0

;#

;################################################


	title "Flash LED"


	list P = 16F84a


	#include <p16F84a.inc>            


	__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _RC_OSC


;-------variables

count1	equ 0x0B; outer loop's counter

count2	equ 0x0D; middle loop's counter



;-------Constants

_TRISA	equ b'00000000'; All outputs on PORTA

_TRISB	equ b'00000000'; All outputs on PORTB



; For Timing, see loop-time-calculator spreadsheet

;LIMIT1	equ d'102'	; outer loop's limit

;LIMIT2	equ d'100'	; middle loop's limit

;LIMIT3	equ d'8'	; inner loop's limit



;-------Initialization

	bsf	STATUS, RP0; Switch to bank 1

movlw	_TRISA; W = _TRISA

	movwf	TRISA; Set all of PORTA pins to output pins

	movlw	_TRISB; W = _TRISB

	movwf	TRISB; Set all of PORTB pins to output pins

	bcf	STATUS, RP0; bank 0



;-------Main

main	movlw	b'00000001'; turn bit 0 on

  movwf	PORTB; PORTB = W

  call	stall; stall()

  call	stall; stall()

	movlw	b'00000000'; turn bit 0 off

  movwf	PORTB; PORTB = W

  call	stall; stall()

  call	stall; stall()

  goto	main; repeat



;-------Stall function

stall	movlw	0x40	; Get the delay time

  movwf	count1; and put into a variable

outer	movlw	0x7f

  movwf	count2; and put into a variable

inner	nop

  nop

  decfsz	count2,f; Decrement 1 from the delay time

  goto	inner; until it reaches zero

  decfsz	count1,f; Decrement 1 from the delay time

  goto	outer

  return  ; Done!


	end  ; Necessary for the ASSEMBLER

**Previewing my post, it looks like the "CODE" tag didn't like the tabs in the code, so the formatting looks a little funny. It should still work OK, however.

A couple of notes:

1) I'm an absolute beginner at this, so I'm SURE my code can be better, but hey, it works!

2) I'm assuming you've got a basic understanding of the electronics. If not, ask more questions.

3) Go to www.piclist.com. There's TONS of information there.

Good luck!

-Jeff

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×