Morse Code w/ PIC1684F84A

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
Tommy volts
Posts: 149
Joined: Tue Oct 29, 2002 1:01 am
Location: Arizona
Contact:

Morse Code w/ PIC1684F84A

Post by Tommy volts »

Morse w/ PIC16F84A <p>Last night I “wrote” (copied and modified from “Easy PIC’n for Beginners”) a routine for my PIC. It didn’t work. I am trying to blink out a simple two word Morse code signal on an LED. I need to vary the on and off time for dits and das and pauses. The problem is the Delay subroutines I am using don’t work. I can’t even get it to blink off and on at an even rate. <p>Does anybody have or know where I can get a simple assembly routine to do this task.
:confused:
Tommy volts
Posts: 149
Joined: Tue Oct 29, 2002 1:01 am
Location: Arizona
Contact:

Re: Morse Code w/ PIC1684F84A

Post by Tommy volts »

The MCU I have is a PIC16F84A, unfortunately I have a typo in the subject box
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

Re: Morse Code w/ PIC1684F84A

Post by hlreed »

Wasting time with a PIC is simple to do in line.<p>You have two counter constants C1,C2 and two variables for counting v1 and v2
...
MOVLW C1 ;set up counters
MOVWF v1
MOVLW C2
MOVWF v2
ML1
DECFSZ v2 ;1 delay for C2 time
GOTO ML1 ;3 + 2
DECFSZ v1 ;4 + delay for C1 time
; add more as needed
...
Since PIC cycles are uniform, this provides good time if needed. For morse code you only need your on and off loops to be equal. In line you simply make an equal number of code statements.
The same structure is used for both.
If you need more, just ask.<p>[ February 14, 2003: Message edited by: Harold ]</p>
Harold L. Reed
Microbes got brains
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 29 guests