CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Generate Morse Code by Mplab. Need Help!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
morgan



Joined: 24 Jul 2010
Posts: 1

View user's profile Send private message

Generate Morse Code by Mplab. Need Help!
PostPosted: Sat Jul 24, 2010 8:13 pm     Reply with quote

I need to implement the software to read a four bit values from the input port and then generate the Morse code serial output to one output port. An example of a PIC program to test the Morse code generator function is shown below. In addition, use the RAM (File Register are 0x0c to 0x4f) to store the results of computations and use the working register to pass the input and output values.

I need to write a version of the Morse code program in PIC assembly code and test with the main program.
Code:

; Outline of PIC assembly program
; (16F84 with RC osc, watchdog timer off, power-up timer on)
processor 16f84A
include
__config _RC_OSC & _WDT_OFF & _PWRTE_ON
; beginning of program code
org 0x00 ; reset at address 0
reset: goto init ; skip reserved program addresses
org 0x08 ; beginning of user code
init:
; At startup, all ports are inputs.
bsf STATUS,RP0 ; switch to bank 0 memory
clrf TRISB ; set PORTB to all outputs
bcf STATUS,RP0 ; return to bank 1 memory
mloop:
; here begins the main program
movf PORTA,w ; read stdin to w reg
call main
goto mloop
main:
; add your Morse Code here
;
; put your result into w-reg
call printf ; output the value
return ; main return
printf: ; only standard library function
movwf PORTB ; output w to stdout
return
end ; end of program code

I have several questions. How to write a Morse code in Mplab? I already know how to write it in C. Please give me some instructions. I need help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 24, 2010 10:11 pm     Reply with quote

This is a C forum. You should not ask for help on an ASM program in
a C forum.

Look in the Microchip forum. They do ASM there. Search their forum
archives using Google with this search string:
Quote:

site:microchip.com/forums "morse code" movlw

Here is the Microchip forum for 16F PICs, if you have ASM questions:
http://www.microchip.com/forums/f11.aspx


To search the net for a Morse code program written in Microchip ASM,
use this search string in Google:
Quote:

"morse code" movlw

or
Quote:

"morse code" generator movlw
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group