comparison code_part1/OSTC_code_asm_part1/start.asm @ 466:67d908f51e80

cleanup
author heinrichsweikamp
date Sun, 02 Oct 2011 18:01:24 +0200
parents 915e0d38edec
children f53aa96ff2f4
comparison
equal deleted inserted replaced
465:915e0d38edec 466:67d908f51e80
396 movwf EEDATA 396 movwf EEDATA
397 write_int_eeprom d'92' ; Store number of CF used in this firmware 397 write_int_eeprom d'92' ; Store number of CF used in this firmware
398 bra start3 ; continue with normal start 398 bra start3 ; continue with normal start
399 399
400 init: 400 init:
401 movlw b'01101100' ; 4MHz (x4 PLL) 401 movlw OSCCON_VALUE
402 movwf OSCCON 402 movwf OSCCON
403 403
404 movlw b'00010001' ; I/O Ports 404 movlw b'00010001' ; I/O Ports
405 movwf TRISA 405 movwf TRISA
406 clrf PORTA 406 clrf PORTA
418 clrf PORTD 418 clrf PORTD
419 419
420 movlw b'01000000' ; Bit6: PPL enable 420 movlw b'01000000' ; Bit6: PPL enable
421 movwf OSCTUNE 421 movwf OSCTUNE
422 422
423 movlw b'00011111' ; Timer0 423 movlw T0CON_VALUE ; Timer0
424 movwf T0CON 424 movwf T0CON
425 425
426 movlw b'00000111' ; Timer1 426 movlw b'00000111' ; Timer1
427 movwf T1CON 427 movwf T1CON
428 428
450 movwf SSPSTAT 450 movwf SSPSTAT
451 movlw b'00101000' 451 movlw b'00101000'
452 movwf SSPCON1 452 movwf SSPCON1
453 movlw b'00000000' 453 movlw b'00000000'
454 movwf SSPCON2 454 movwf SSPCON2
455 movlw d'8' ; 400kHz I2C clock @ 16MHz Fcy 455 movlw SSPADD_VALUE ; I²C Speed
456 movwf SSPADD 456 movwf SSPADD
457 457
458 clrf CCP1CON ; PWM Module off 458 clrf CCP1CON ; PWM Module off
459 clrf ECCP1CON ; PWM Module off 459 clrf ECCP1CON ; PWM Module off
460 460
469 movlw b'10010000' 469 movlw b'10010000'
470 movwf RCSTA 470 movwf RCSTA
471 movlw b'00001000' 471 movlw b'00001000'
472 movwf BAUDCON 472 movwf BAUDCON
473 clrf SPBRGH 473 clrf SPBRGH
474 movlw d'34' 474 movlw SPBRG_VALUE
475 movwf SPBRG 475 movwf SPBRG
476 clrf RCREG 476 clrf RCREG
477 clrf PIR1 477 clrf PIR1
478 return 478 return