comparison src/ms5541.asm @ 29:50c3e2c7ba7a

adding cardinal (and ordinal) directions for the compass
author heinrichsweikamp
date Sat, 20 Jul 2013 22:01:49 +0200
parents 11d4fc797f74
children 7ca1105751c7
comparison
equal deleted inserted replaced
28:fcaf94b913db 29:50c3e2c7ba7a
466 bsf MS5541_clk 466 bsf MS5541_clk
467 nop 467 nop
468 nop 468 nop
469 nop 469 nop
470 nop 470 nop
471 nop
472 nop
471 bcf MS5541_clk 473 bcf MS5541_clk
474 nop
475 nop
472 nop 476 nop
473 nop 477 nop
474 return 478 return
475 479
476 send_data_MS5541: 480 send_data_MS5541:
477 movwf clock_count ; From WREG 481 movwf clock_count ; From WREG
478 ; send three startbits first 482 ; send three startbits first
479 bcf MS5541_clk 483 bcf MS5541_clk
484 nop
485 nop
480 bsf MS5541_mosi 486 bsf MS5541_mosi
481 movlw d'3' 487 movlw d'3'
482 subwf clock_count,F ; total bit counter 488 subwf clock_count,F ; total bit counter
483 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk 489 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk
484 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk 490 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk
485 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk 491 rcall send_clk_pulse ; Send one high-low sequence on MS5541_clk
486 ; now send 8 bytes from isr_temp1 and fill-up with zeros 492 ; now send 8 bytes from isr_temp1 and fill-up with zeros
487 send_data_MS5541_2: 493 send_data_MS5541_2:
488 bcf MS5541_clk 494 bcf MS5541_clk
495 nop
496 nop
489 497
490 btfss isr1_temp,7 ;MSB first 498 btfss isr1_temp,7 ;MSB first
491 bcf MS5541_mosi 499 bcf MS5541_mosi
492 btfsc isr1_temp,7 ;MSB first 500 btfsc isr1_temp,7 ;MSB first
493 bsf MS5541_mosi 501 bsf MS5541_mosi
494 502
495 bsf MS5541_clk 503 bsf MS5541_clk
496 504
497 bcf STATUS,C 505 bcf STATUS,C
498 rlcf isr1_temp,F 506 rlcf isr1_temp,F
499 ; nop 507 nop
500 ; nop 508 nop
501 ; nop 509 ; nop
502 ; nop 510 ; nop
503 ; nop 511 ; nop
504 ; nop 512 ; nop
505 ; bcf MS5541_clk 513 ; bcf MS5541_clk