Author Topic: Need ASMEMBLY code help. Someone who knows how to code please!!!  (Read 1469 times)

Offline h311jump3r

  • Fart Sniffer
  • *
  • Posts: 41
  • Post quality +0/-0
  • Gender: Male
    • SparkMods - The Mod Repository
*EDIT* I actually just need to know the addresses of the ports and the bits cuz I cant find this info anywhere...a link or something would help (or you can just tell me)

Hi there anyone...lol.

Anyways, what I really need to know is what name/code corresponds to each pin in a 12f683 if my layout is gonna be like this. (1 = open (high) 0 = closed (low))

                                                                                       
                              ______
 (1?) Power->     1 -|         |- 8   <-Ground  (0?)           
                         2 -| CHIP  |- 7         
(0) leftTrigger->  3 -|         |- 6    <-Right Trigger (0)       
                         4 -|_____ |- 5                                   
                                                                                         
                                                         
                  *idk what to do with the power (pin 1) and the Ground (pin 8). I know how to set the pins to in or out but I don't know how to show to what pin. Basically I'm not sure what name they would have in an asmembly program. The coding is probably going to be the hard also but first I need to know this...I need to know when/how to send a pulse to both right and left triggers (pins 3 & 6). I can do that with something like...

*my constants are wrong because I do not know how to set which pin for input output and stuff because I dont know what they are called. Basically...I want 1,0,0,0,0,0,0,0,0

*So...basically...the only one that is an input is the power (if it needs to be input?) then the rest are jsut output (to send the signals). What I ahve now is 02h for the 00000 (Idk what pins that is for tho!) and 00h (same thing). Just help me out...

;Our Constants

STATUS  equ  03h                              ;Address of the STATUS register
TRISA     equ  85h                              ;Address of the tristate register for port A
PORTA    equ  05h                              ;Address of Port A
COUNT1  equ  08h                              ;First counter for our delay loops
COUNT2  equ  09h                              ;Second counter for our delay loops

Start            movlw              02h               ;send the signal by putting it
                   movwf             PORTA           ;into the w register and then on the port

;****the delay

          call Delay

;****Delay finished, now turn signal off****

movlw  00h
movwf  PORTA

call Delay

goto Start
         
;****Our subroutine

Delay

Loop1          decfsz              COUNT1,1     ;This second loop keeps the signal
                  goto                 Loop1          ;turned off to
                  decfsz              COUNT2,1     ;
                  goto                 Loop1          ;
return

;****End of the program****

end                                                         
                               




lol...this is my first time ever programming anything...so help me out...                                       
                                                                     

Offline ryan0

  • I EAT STUFF
  • Millennium Poster
  • *
  • Posts: 1128
  • Post quality +0/-0
  • Gender: Male
  • I LIEK CHEEEEZE
Re: Need ASMEMBLY code help. Someone who knows how to code please!!!
« Reply #1 on: August 06, 2008, 01:38:53 PM »
wrong section dude,theres a section for PIC programming,please move it so you can talk to the right people
Derp.

Offline h311jump3r

  • Fart Sniffer
  • *
  • Posts: 41
  • Post quality +0/-0
  • Gender: Male
    • SparkMods - The Mod Repository
Re: Need ASMEMBLY code help. Someone who knows how to code please!!!
« Reply #2 on: August 06, 2008, 04:29:02 PM »
There's like...almost no one there! Anyways...screw it...Ill find it out myself...even kingmike doesn't like to talk to me. Ima do my own sleep like he did (it really easy if you ask). All his does is wait for the button press, and if it is pressed...it runs the signal loop...really smart I like to point out.

I'm sure no one helped him so Ill do this myself I suppose...and maybe join his team sometime...

Offline PspKicks316

  • Acidmods Alumni
  • Mad Bomber
  • *
  • Posts: 5709
  • Post quality +5/-4
  • Gender: Male
Re: Need ASMEMBLY code help. Someone who knows how to code please!!!
« Reply #3 on: August 06, 2008, 07:15:51 PM »
Please do not post 2 of the same threads anywhere!

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal