Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   assembly help, please (http://www.programmingforums.org/showthread.php?t=15102)

james1212 Feb 1st, 2008 3:37 PM

assembly help, please
 
I have to write a program that will produce two signals, at pins RAo and RA1. I have only just started using this language and have no clue.

I have started the program already and I need some help please.
This is it so far.

; waveforms.asm
title "waveforms.asm"
list p=18f452, f=inhx32
#include <p18f452.inc>

PORTA equ 0x01

start

loop
movlw b'0000 0001'
movwf PORTA

call delay100

movlw b'0000 0010'
movwf PORTA

call delay200

movlw b'0000 0000'
movwf PORTA

call delay600

movlw b'0000 0010'
movwf PORTA

call delay250

movlw b'0000 0000'
movwf PORTA

call delay600

movlw b'0000 0010'
movwf PORTA

call delay300

goto loop

end

I need to get this program to run this loop over. I know this must be a very simple program but I am studying mech eng not programming, but I want to learn this as well. I am curious why. Thanks for your help

mbd Feb 1st, 2008 4:13 PM

Re: assembly help, please
 
what chip are you programming?

james1212 Feb 1st, 2008 4:40 PM

Re: assembly help, please
 
it is a PIC18F452, thats all i realy know

james1212 Feb 4th, 2008 8:05 AM

Re: assembly help, please
 
1 Attachment(s)
I have included an upload, that gives a better idea of what I have to do, Can someone talk me through this and give me some ideas please.

colin mac Feb 4th, 2008 2:26 PM

Re: assembly help, please
 
I'm not familiar with pics so I can't help much with the assembly.

You need to work out the high and low times of the pulses, and make the pins high and low for those times. Generate that waveform at RC0 first on its own, by making it high, calling a delay of 100uS, bringing it low and calling a delay of whatever that off time is, looping over, rather than trying to get both working together at first.


All times are GMT -5. The time now is 3:41 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC