comparison code_part1/OSTC_code_asm_part1/start.asm @ 463:86fc79735d3b

Experimental 32MHz mode
author heinrichsweikamp
date Tue, 27 Sep 2011 22:23:12 +0200
parents af2894e5cda4
children 915e0d38edec
comparison
equal deleted inserted replaced
462:32e1174fb89e 463:86fc79735d3b
393 movwf EEDATA 393 movwf EEDATA
394 write_int_eeprom d'92' ; Store number of CF used in this firmware 394 write_int_eeprom d'92' ; Store number of CF used in this firmware
395 bra start3 ; continue with normal start 395 bra start3 ; continue with normal start
396 396
397 init: 397 init:
398 movlw b'01101100' ; 4MHz (x4 PLL) 398 movlw OSCCON_VALUE
399 movwf OSCCON 399 movwf OSCCON
400
401 movlw b'00010001' ; I/O Ports 400 movlw b'00010001' ; I/O Ports
402 movwf TRISA 401 movwf TRISA
403 clrf PORTA 402 clrf PORTA
404 movlw b'00000011' 403 movlw b'00000011'
405 movwf TRISB 404 movwf TRISB
415 clrf PORTD 414 clrf PORTD
416 415
417 movlw b'01000000' ; Bit6: PPL enable 416 movlw b'01000000' ; Bit6: PPL enable
418 movwf OSCTUNE 417 movwf OSCTUNE
419 418
420 movlw b'00011111' ; Timer0 419 movlw T0CON_VALUE ; Timer0
421 movwf T0CON 420 movwf T0CON
422 421
423 movlw b'00000111' ; Timer1 422 movlw b'00000111' ; Timer1
424 movwf T1CON 423 movwf T1CON
425 424
447 movwf SSPSTAT 446 movwf SSPSTAT
448 movlw b'00101000' 447 movlw b'00101000'
449 movwf SSPCON1 448 movwf SSPCON1
450 movlw b'00000000' 449 movlw b'00000000'
451 movwf SSPCON2 450 movwf SSPCON2
452 movlw d'8' ; 400kHz I2C clock @ 16MHz Fcy 451
452 movlw SSPADD_VALUE ; I²C Speed
453 movwf SSPADD 453 movwf SSPADD
454 454
455 clrf CCP1CON ; PWM Module off 455 clrf CCP1CON ; PWM Module off
456 clrf ECCP1CON ; PWM Module off 456 clrf ECCP1CON ; PWM Module off
457 457
466 movlw b'10010000' 466 movlw b'10010000'
467 movwf RCSTA 467 movwf RCSTA
468 movlw b'00001000' 468 movlw b'00001000'
469 movwf BAUDCON 469 movwf BAUDCON
470 clrf SPBRGH 470 clrf SPBRGH
471 movlw d'34' 471
472 movlw SPBRG_VALUE
472 movwf SPBRG 473 movwf SPBRG
473 clrf RCREG 474 clrf RCREG
474 clrf PIR1 475 clrf PIR1
475 return 476 return