minimalmode3.asm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. list p=18f25k22
  2. errorlevel -305 ; no default destination messages
  3. errorlevel -302 ; no bank 0 warnings
  4. errorlevel -202 ; no 'argument out of range' warnings
  5. include <p18f25k22.inc>
  6. ; Device configuration settings
  7. config FCMEN = OFF
  8. config IESO = OFF
  9. config PRICLKEN = ON
  10. config PLLCFG = OFF
  11. config FOSC = HSMP
  12. config BORV = 285
  13. config BOREN = OFF
  14. config PWRTEN = ON
  15. config WDTPS = 2048
  16. config WDTEN = OFF
  17. config CCP2MX = PORTB3
  18. config PBADEN = OFF
  19. config CCP3MX = PORTC6
  20. config HFOFST = OFF
  21. config T3CMX = PORTB5
  22. config P2BMX = PORTC0
  23. config MCLRE = INTMCLR
  24. config XINST = ON
  25. config DEBUG = OFF
  26. config LVP = OFF
  27. config STVREN = ON
  28. config CP0 = OFF
  29. config CP1 = OFF
  30. config CP2 = OFF
  31. config CP3 = OFF
  32. config CPD = OFF
  33. config CPB = OFF
  34. config WRT0 = OFF
  35. config WRT1 = OFF
  36. config WRT2 = OFF
  37. config WRT3 = OFF
  38. config WRTC = OFF
  39. config WRTB = OFF
  40. config WRTD = OFF
  41. config EBTR0 = OFF
  42. config EBTR1 = OFF
  43. config EBTR2 = OFF
  44. config EBTR3 = OFF
  45. config EBTRB = OFF
  46. ; Holding registers for some values
  47. CONTMR equ 000
  48. CPSTATE equ 001
  49. DLYCOUNT equ 002
  50. LCD_CHAR equ 003
  51. LCD_NIB_H equ 004
  52. LCD_NIB_L equ 005
  53. DLYREG1 equ 006
  54. DLYREG2 equ 007
  55. WTEMP equ 008
  56. PWM_VALUE equ 009
  57. ; Some constants
  58. PILOT_12 equ 0F4
  59. PILOT_9 equ 0D2
  60. PILOT_6 equ 0B4
  61. DIODE equ 016
  62. PWM_6A equ 19
  63. PWM_7A equ 1D
  64. PWM_8A equ 21
  65. PWM_9A equ 25
  66. PWM_10A equ 29
  67. PWM_11A equ 2D
  68. PWM_12A equ 32
  69. PWM_13A equ 36
  70. PWM_14A equ 3A
  71. PWM_15A equ 3E
  72. PWM_16A equ 42
  73. PWM_0A equ 0FA
  74. ; Some port labels
  75. LCD_BL equ 0
  76. LCD_RS equ 3
  77. LCD_RW equ 4
  78. LCD_EN equ 5
  79. ; Return codes for the read_cp functions
  80. STATE_A equ 0
  81. STATE_B equ 1
  82. STATE_C equ 2
  83. KNOP_LINKS equ 0
  84. KNOP_MIDDEN equ 1
  85. KNOP_RECHTS equ 2
  86. CHARGEPWM equ PWM_7A
  87. goto start
  88. start
  89. ; Initialize Ports TRISA
  90. ; PORTA, 0 = CP input = analog in 1
  91. ; PORTA, 1 = PP input = analog in 1
  92. ; PORTA, 2 = Temperatuursensor = analog in 1
  93. ; PORTA, 3 = (niet aangesloten) 1
  94. ; PORTA, 4 = motor driver 1 = digital out 0
  95. ; PORTA, 5 = motor driver 2 = digital out 0
  96. ; PORTA, 6 = kristal 1 0
  97. ; PORTA, 7 = kristal 2 1
  98. movlb 0F ; Stel bank F in voor alle SFR's
  99. movlw b'10001111'
  100. movwf TRISA
  101. movlw b'00001111'
  102. movwf ANSELA
  103. ; Analog to Digital conversion setup
  104. bsf ADCON0, ADON ; Turn on ADC module
  105. movlw b'00100101' ; Settings for ADC: left justified, 8 cycles, Fosc/16
  106. movwf ADCON2
  107. movlw b'00000001'
  108. movwf ADCON0
  109. ; PORTB, 0 = display 1 = digital out
  110. ; PORTB, 1 = display 2 = digital out
  111. ; PORTB, 2 = display 3 = digital out
  112. ; PORTB, 3 = display 4 = digital out
  113. ; PORTB, 4 = Solid State Relais = digital out
  114. ; PORTB, 5 = Richtingsschakelaar voor RS485 = digital out
  115. ; PORTB, 6 = UART 2 TX (moet als input)
  116. ; PORTB, 7 = UART 2 RX (moet als input)
  117. clrf ANSELB
  118. movlw b'11000000'
  119. movwf TRISB
  120. ; PORTC, 0 = display 5 = digital out (display verlichting)
  121. ; PORTC, 1 = Lock State = digital input
  122. ; PORTC, 2 = PWM output poort (moet als input geconfigureerd voor PWM operatie, pag 186)
  123. ; PORTC, 3 = display 6 = digital out
  124. ; PORTC, 4 = display 7 = digital out
  125. ; PORTC, 5 = display 8 = digital out
  126. ; PORTC, 6 = UART 1 TX, RS485 communicatie TX
  127. ; PORTC, 7 = UART 2 RX, RS485 communicatie RX
  128. clrf ANSELC
  129. movlw b'11000110'
  130. movwf TRISC
  131. ; Initialize PWM op poort C2
  132. bcf CCPTMRS0, C1TSEL0 ; Selecteer TMR1 en TMR2 voor PWM
  133. bcf CCPTMRS0, C1TSEL1
  134. bsf CCP1CON, CCP1M3 ; Stel in voor PWM op de CCP module
  135. bsf CCP1CON, CCP1M2
  136. movlw b'00000110' ; Stel 16x prescaler in port Timer 2
  137. movwf T2CON
  138. movlw 0F9h ; Stel periode in op 249 = 1 kHz bij 16 MHz
  139. movwf PR2
  140. movlw PWM_0A ; Stel 100% PWM in bij start
  141. movwf CCPR1L
  142. bcf PIR2, TMR2IF
  143. bsf T2CON, TMR2ON ; Start de timer
  144. bcf PIR1, TMR1IF
  145. bsf T1CON, TMR1ON ; Start TMR1
  146. bcf TRISC, 2 ; Enable output driver
  147. ; Stroom Duty Cycle CCPR1L:CCP1CON<5:4> CCPR1L CCP1CON<5:4>
  148. ; 6 10% 100 25 0
  149. ; 7 11.7% 117 29 1
  150. ; 8 13.3% 133 33 1
  151. ; 9 15% 150 37 2
  152. ; 10 16.7% 167 41 3
  153. ; 11 18.3% 183 45 3
  154. ; 12 20% 200 50 0
  155. ; 13 21.7% 217 54 1
  156. ; 14 23.3% 233 58 1
  157. ; 15 25% 250 62 2
  158. ; 16 26.7% 267 66 3
  159. ; Initialize TMR0 to use as a delay timer
  160. ; Set to 16 bits, instruction cycle clock, use prescaler, use 8x prescaler
  161. clrf TMR0L
  162. clrf TMR0H
  163. clrf T0CON
  164. bsf T0CON, T0PS1
  165. ; Initialize Serial port 2 (UART)
  166. bcf TXSTA2, SYNC ; Asynchronous
  167. bsf TXSTA2, BRGH ; High speed
  168. bcf BAUDCON2, BRG16 ; 8 bit Baud Rate Generator
  169. movlw 33 ; 19.2 kbaud
  170. movwf SPBRG2
  171. bsf TXSTA2, TXEN ; Enable the transmit port
  172. bsf RCSTA2, SPEN ; Enable the receive port
  173. bsf RCSTA2, CREN ; Enable continuous receive
  174. ; Initialize LCD
  175. call delay100
  176. call lcd_init
  177. movlw PWM_7A
  178. movwf PWM_VALUE
  179. call display_7a
  180. ; Main application
  181. enter
  182. bsf PORTA, 4 ; Motor Standby
  183. bsf PORTA, 5
  184. bcf PORTB, 4 ; Power Off
  185. btfss PORTC, 1 ; Make sure the socket is unlocked
  186. goto unlock
  187. movlw 5 ; Reset CONTMR
  188. movwf CONTMR
  189. movlw 0FA ; Turn off PWM
  190. movwf CCPR1L
  191. idle
  192. call display_idle
  193. bcf PORTC, LCD_BL ; Turn off LCD backlight
  194. call check_serial ; Check for serial communications
  195. call check_state ; Check if there is a car
  196. call check_knoppen
  197. sublw STATE_A
  198. btfsc STATUS, Z
  199. goto enter
  200. call delay100 ; Delay 100 ms
  201. decfsz CONTMR ; 5 times
  202. goto idle ; Check the stuff in this loop again
  203. movlw 5
  204. movwf CONTMR
  205. goto connected ; Then go to Connected
  206. connected
  207. call check_knoppen
  208. bsf PORTC, LCD_BL ; Turn on LCD backlight
  209. call check_state
  210. sublw STATE_A
  211. btfsc STATUS, Z
  212. goto enter
  213. btfsc PORTC, 1 ; Check if the lock is closed
  214. goto lock
  215. call display_connected
  216. movff PWM_VALUE, CCPR1L
  217. call delay_1
  218. ; Check if the diode is OK
  219. call check_diode ; Check the diode (als goed: W = 1)
  220. sublw 1 ; (W = 0)
  221. btfss STATUS, Z ; Proceed if the diode state was 1
  222. goto enter
  223. ; Check the S2 state of the vehicle
  224. call check_state
  225. movwf CPSTATE
  226. sublw STATE_B
  227. btfsc STATUS, Z
  228. goto connected
  229. movf CPSTATE, w
  230. sublw STATE_C
  231. btfsc STATUS, Z
  232. goto charging
  233. goto enter
  234. charging
  235. call display_charging
  236. movff PWM_VALUE, CCPR1L
  237. bsf PORTB, 4 ; Power On
  238. call check_knoppen
  239. call check_state
  240. sublw STATE_C
  241. btfsc STATUS, Z
  242. goto charging
  243. bcf PORTB, 4 ; Power Off
  244. goto connected
  245. check_state
  246. ; Lees CP uit en return met een waarde in W (0 = los, 1 = connected, 2 = S2 gesloten)
  247. ; TMR2 loopt mee gedurende de PWM. Als TMR2 < CCPR1L dan zitten we nog in de hoog periode.
  248. ; De aquisitietijd voor de AD-conversie is 4 cycli. Als we 8 cycli voor het eind van de PWM-hoog periode beginnen met samplen, hebben we tijd genoeg.
  249. ; We willen niet direct aan het begin van de periode zitten, maar na 5%.
  250. ; Dus 12 < TMR2 < (CCPR1L - 8)
  251. ; Check if TMR2 > 12d
  252. movlw d'12'
  253. cpfsgt TMR2 ; Compare TMR2 to W, proceed if TMR2 > W
  254. goto check_state
  255. ; Check if TMR2 < (CCPR1L - 16)
  256. movlw 8 ; 8 -> W
  257. subwf CCPR1L, W ; (CCPR1L - 8) -> W
  258. cpfslt TMR2 ; Compare TMR2 to W, proceed if TMR2 < W
  259. goto check_state
  260. call take_sample
  261. movf ADRESH, W
  262. ; Check if >12V
  263. movf ADRESH, w ; Voltage -> W
  264. sublw PILOT_12 ; PILOT_12 - Voltage: moet < nul zijn, dus STATUS,C = 0
  265. btfss STATUS, C
  266. retlw STATE_A
  267. ; Check if >9V
  268. movf ADRESH, w
  269. sublw PILOT_9
  270. btfss STATUS, C
  271. retlw STATE_B
  272. ; Check if >6V
  273. movf ADRESH, w
  274. sublw PILOT_6
  275. btfss STATUS, C
  276. retlw STATE_C
  277. ; If it is something else, take state A which is safe.
  278. retlw STATE_A
  279. check_diode
  280. ; Read the CP at the low point, return 1 if OK, 0 if not.
  281. ; (CCPR1L + 12) < TMR2 < (PR2 - 8)
  282. ; Check if TMR2 > CCPR1L + 12
  283. movf CCPR1L, W ; CCPR1L -> W
  284. addlw d'12' ; (CCPR1L + 12) -> W
  285. cpfsgt TMR2 ; Compare TMR2 to W, proceed if TMR2 > W
  286. goto check_diode
  287. ; Check if TMR2 < (PR2 - 8)
  288. movlw 8 ; 8 -> W
  289. subwf PR2, W ; (PR2 - 8) -> W
  290. cpfslt TMR2 ; Compare TMR2 to W, proceed if TMR2 < W
  291. goto check_diode
  292. call take_sample
  293. movlw DIODE
  294. cpfsgt ADRESH ; Compare ADRESH to DIODE, return 0 if ADRESH > DIODE
  295. retlw 1
  296. retlw 0
  297. take_sample
  298. bsf ADCON0, GO ; Start the sample
  299. wait_sample
  300. btfsc ADCON0, DONE
  301. goto wait_sample
  302. return
  303. ; Routines for locking and unlocking
  304. lock
  305. call display_lock
  306. bcf PORTA, 4
  307. bsf PORTA, 5
  308. call delay100 ; Blocking 100ms delay
  309. call delay100 ; Blocking 100ms delay
  310. bsf PORTA, 4 ; Stop the motor
  311. call delay2000 ; Wait 2 seconds to charge the capacitor back up..
  312. goto connected
  313. unlock
  314. movlw 0FA ; Turn off PWM
  315. movwf CCPR1L
  316. bcf PORTB, 4 ; Power off
  317. call display_unlock
  318. bsf PORTA, 4 ; Start the motor
  319. bcf PORTA, 5
  320. call delay100 ; Blocking 100ms delay
  321. call delay100 ; Blocking 100ms delay
  322. bsf PORTA, 5 ; Stop the motor
  323. call delay2000 ; Wait 2 seconds to charge the capacitor back up.
  324. goto enter ; Always go to 'enter' after unlocking.
  325. ; Routines for a 100 ms delay
  326. delay100
  327. ; Preset timer 0 value at 15533
  328. movlw 3C
  329. movwf TMR0H
  330. movlw 0AD
  331. movwf TMR0L
  332. ; Start the timer
  333. bcf INTCON, TMR0IF ; Clear the interrupt
  334. bsf T0CON, TMR0ON ; Start the timer
  335. delay_wait
  336. btfss INTCON, TMR0IF ; Wait for the timer to overflow
  337. goto delay_wait
  338. bcf T0CON, TMR0ON ; Stop the timer
  339. return
  340. ; Routines for a 2 second delay
  341. delay2000
  342. movlw d'20'
  343. movwf DLYCOUNT
  344. goto delay_repeat
  345. delay_repeat
  346. call delay100
  347. decfsz DLYCOUNT, f
  348. goto delay_repeat
  349. return
  350. ; Routines to handle serial communication from the Raspberry Pi
  351. check_serial
  352. btfsc PIR3, RC2IF ; Check of er iets aan de hand is
  353. goto read_serial
  354. return
  355. read_serial
  356. btfsc RCSTA2, FERR ; Check of er een frame error is (dan naar reset)
  357. goto start_reset
  358. btfsc RCSTA2, OERR ; Check of er overrun-errors zijn en wis deze
  359. call clear_oerr
  360. movf RCREG2, W
  361. return
  362. clear_oerr
  363. bcf RCSTA2, CREN
  364. bsf RCSTA2, CREN
  365. return
  366. start_reset
  367. call display_reset
  368. reset
  369. display_reset
  370. movlw 1
  371. call lcd_write
  372. movlw 80
  373. call lcd_write
  374. movlw A'R'
  375. call lcd_print
  376. movlw A'E'
  377. call lcd_print
  378. movlw A'S'
  379. call lcd_print
  380. movlw A'E'
  381. call lcd_print
  382. movlw A'T'
  383. call lcd_print
  384. return
  385. ; 1 ms Delay (for display logic)
  386. delay_1
  387. movwf WTEMP
  388. movlw 4
  389. movwf DLYREG1
  390. movlw 0F8
  391. movwf DLYREG2
  392. delay_1_inner
  393. nop
  394. decfsz DLYREG2 ; 1 cycle
  395. goto delay_1_inner ; 2 cycles
  396. delay_1_loop
  397. movlw 0F8
  398. movwf DLYREG2
  399. decfsz DLYREG1
  400. goto delay_1_inner
  401. movf WTEMP, W
  402. return
  403. ; Everything having to do with the HD44780 display
  404. lcd_init
  405. call delay100
  406. bcf TRISB, KNOP_LINKS
  407. bcf TRISB, KNOP_MIDDEN
  408. bcf TRISB, KNOP_RECHTS
  409. bcf PORTC, LCD_EN
  410. bcf PORTC, LCD_RW
  411. bcf PORTC, LCD_RS
  412. movf PORTB, W
  413. andlw 0F0
  414. iorlw 3 ; Reset instruction, see page 45 of Hitachi datasheet
  415. movwf PORTB
  416. call lcd_go
  417. call delay_1 ; wait 5 ms
  418. call delay_1
  419. call delay_1
  420. call delay_1
  421. call delay_1
  422. call lcd_go
  423. call delay_short
  424. call lcd_go
  425. call delay_short
  426. movf PORTB, W
  427. andlw 0F0
  428. iorlw 2 ; Set up as 4-bit mode (interpreted as 8-bit command so completes in one write)
  429. movwf PORTB
  430. call lcd_go
  431. call delay_1 ; 4-bit transmissions starts here
  432. movlw b'00101000' ; Function Set, 4-bit, 2 line display, 5x8 pixel characters
  433. call lcd_write
  434. movlw b'00001000' ; Display Off, Cursor Off, Blink Off
  435. call lcd_write
  436. movlw b'00000001' ; Clear Display
  437. call lcd_write
  438. movlw b'00000110' ; Entry mode set (increment and not shifted)
  439. call lcd_write
  440. movlw b'00001100' ; Display On, Blink On
  441. call lcd_write
  442. bsf TRISB, KNOP_LINKS
  443. bsf TRISB, KNOP_MIDDEN
  444. bsf TRISB, KNOP_RECHTS
  445. return
  446. lcd_print
  447. bsf PORTC, LCD_RS
  448. call lcd_write
  449. bcf PORTC, LCD_RS
  450. return
  451. lcd_write
  452. ; Split nibbles
  453. bcf TRISB, KNOP_LINKS
  454. bcf TRISB, KNOP_MIDDEN
  455. bcf TRISB, KNOP_RECHTS
  456. movwf LCD_CHAR
  457. andlw 0F
  458. movwf LCD_NIB_L
  459. swapf LCD_CHAR, W
  460. andlw 0F
  461. movwf LCD_NIB_H
  462. ; Write high nibble
  463. movf PORTB, W
  464. andlw 0F0
  465. iorwf LCD_NIB_H, W
  466. movwf PORTB
  467. call lcd_go
  468. call delay_1
  469. ; Write low nibble
  470. movf PORTB, W
  471. andlw 0F0
  472. iorwf LCD_NIB_L, W
  473. movwf PORTB
  474. call lcd_go
  475. call delay_1
  476. call delay_1
  477. bsf TRISB, KNOP_LINKS
  478. bsf TRISB, KNOP_MIDDEN
  479. bsf TRISB, KNOP_RECHTS
  480. return
  481. lcd_go
  482. bsf PORTC, LCD_EN
  483. nop
  484. nop
  485. bcf PORTC, LCD_EN
  486. return
  487. delay_short
  488. decfsz DLYREG1
  489. goto delay_short
  490. return
  491. display_idle
  492. movlw 80
  493. call lcd_write
  494. movlw A' '
  495. call lcd_print
  496. movlw A'G'
  497. call lcd_print
  498. movlw A'e'
  499. call lcd_print
  500. movlw A'r'
  501. call lcd_print
  502. movlw A'e'
  503. call lcd_print
  504. movlw A'e'
  505. call lcd_print
  506. movlw A'd'
  507. call lcd_print
  508. return
  509. display_connected
  510. movlw 80
  511. call lcd_write
  512. movlw A'V'
  513. call lcd_print
  514. movlw A'r'
  515. call lcd_print
  516. movlw A'b'
  517. call lcd_print
  518. movlw A'o'
  519. call lcd_print
  520. movlw A'n'
  521. call lcd_print
  522. movlw A'd'
  523. call lcd_print
  524. movlw A'e'
  525. call lcd_print
  526. movlw A'n'
  527. call lcd_print
  528. return
  529. display_charging
  530. movlw 80
  531. call lcd_write
  532. movlw A' '
  533. call lcd_print
  534. movlw A'L'
  535. call lcd_print
  536. movlw A'a'
  537. call lcd_print
  538. movlw A'd'
  539. call lcd_print
  540. movlw A'e'
  541. call lcd_print
  542. movlw A'n'
  543. call lcd_print
  544. movlw A' '
  545. call lcd_print
  546. movlw A' '
  547. call lcd_print
  548. return
  549. display_unlock
  550. movlw 80
  551. call lcd_write
  552. movlw A' '
  553. call lcd_print
  554. movlw A'U'
  555. call lcd_print
  556. movlw A'n'
  557. call lcd_print
  558. movlw A'l'
  559. call lcd_print
  560. movlw A'o'
  561. call lcd_print
  562. movlw A'c'
  563. call lcd_print
  564. movlw A'k'
  565. call lcd_print
  566. movlw A' '
  567. call lcd_print
  568. return
  569. display_lock
  570. movlw 80
  571. call lcd_write
  572. movlw A' '
  573. call lcd_print
  574. movlw A' '
  575. call lcd_print
  576. movlw A'L'
  577. call lcd_print
  578. movlw A'o'
  579. call lcd_print
  580. movlw A'c'
  581. call lcd_print
  582. movlw A'k'
  583. call lcd_print
  584. movlw A' '
  585. call lcd_print
  586. movlw A' '
  587. call lcd_print
  588. return
  589. check_knoppen
  590. btfss PORTB, KNOP_LINKS
  591. goto set_7a
  592. btfss PORTB, KNOP_RECHTS
  593. goto set_14a
  594. btfss PORTB, KNOP_MIDDEN
  595. goto unlock
  596. return
  597. set_7a
  598. movlw PWM_7A
  599. movwf PWM_VALUE
  600. call display_7a
  601. return
  602. set_14a
  603. movlw PWM_14A
  604. movwf PWM_VALUE
  605. call display_14a
  606. return
  607. display_7a
  608. movlw 0C2
  609. call lcd_write
  610. movlw A' '
  611. call lcd_print
  612. movlw A'7'
  613. call lcd_print
  614. movlw A'A'
  615. call lcd_print
  616. return
  617. display_14a
  618. movlw 0C2
  619. call lcd_write
  620. movlw A'1'
  621. call lcd_print
  622. movlw A'4'
  623. call lcd_print
  624. movlw A'A'
  625. call lcd_print
  626. return
  627. end