comparison src/eeprom_rs232.asm @ 648:aeca5717d9eb

3.17 / 10.72 release
author heinrichs weikamp
date Fri, 04 Mar 2022 08:29:36 +0100
parents 8c1f1f334275
children bc214815deb2
comparison
equal deleted inserted replaced
647:357341239438 648:aeca5717d9eb
489 bra serial_rx_stream_tmr_loop ; NO - continue waiting 489 bra serial_rx_stream_tmr_loop ; NO - continue waiting
490 bra serial_rx_timeout ; YES - timeout 490 bra serial_rx_timeout ; YES - timeout
491 491
492 ;----------------------------------------------------------------------------- 492 ;-----------------------------------------------------------------------------
493 493
494 ;-----------------------------------------------------------------------------
495 ; Add new services and characteristics to new BLE (type 2) module
496 ;-----------------------------------------------------------------------------
497 global ble2_configure
498 ble2_configure:
499 rcall enable_rs232
500 bcf NCTS ; Clear to send
501 call wait_1s
502 call wait_1s
503 bcf PORTB,6
504 bsf PORTB,6 ; rising edge -> Command mode
505
506 ; point to config table
507 movlw LOW ble_AT1
508 movwf TBLPTRL
509 movlw HIGH ble_AT1
510 movwf TBLPTRH
511 movlw UPPER ble_AT1
512 movwf TBLPTRU
513 rcall ble_init_loop
514
515 rcall disable_rs232
516 bcf PORTB,6 ; keep low for min. current consumption
517 return ; done.
518
519 ble_init_loop:
520 TBLRD*+
521 movlw 0xFF ; end
522 cpfseq TABLAT
523 bra ble_init_loop1 ; not end
524 ; quit (return)
525 return ; done.
526 ble_init_loop1:
527 movlw 0xFE ; WAIT 20ms
528 cpfseq TABLAT
529 bra ble_init_loop2 ; not wait 20ms
530 WAITMS d'20'
531 bra ble_init_loop
532 ble_init_loop2:
533 movlw 0xFD ; WAIT 1s
534 cpfseq TABLAT
535 bra ble_init_loop3 ; not wait 1s
536 call wait_1s
537 bra ble_init_loop
538 ble_init_loop3:
539 movf TABLAT,W
540 SERIAL_CC_SEND WREG
541 bra ble_init_loop
542
543 ble_AT1: ; config table
544 ; 0xFF at the end
545 ; 0xFE: 20ms delay
546 ; 0xFD: 1s delay
547 ; .13: cr character
548 db 0xFD,0xFD ; Wait 2 seconds
549 db "AT+UDSC=0,0",.13,0xFE,0xFE ; Disable SPP Server on ID0 (and wait 40ms)
550 db "AT+UDSC=0,3",.13,0xFE,0xFE ; SPP Server on ID0 (and wait 40ms)
551 db "AT+UDSC=1,0",.13,0xFE,0xFE ; Disable SPS Server on ID1 (and wait 40ms)
552 db "AT+UDSC=1,6",.13,0xFE,0xFE ; SPS Server on ID1 (and wait 40ms)
553 db "AT&W",.13,0xFE ; write settings into eeprom (and wait 20ms)
554 db "AT+CPWROFF",.13,0xFD,0xFD,0xFF ; save and reboot (and wait 2 seconds)
555
556
494 END 557 END