HIN Diploma Master of Science P.o.box 385, Lodve Langes gate NARVIK

Size: px
Start display at page:

Download "HIN Diploma Master of Science P.o.box 385, Lodve Langes gate NARVIK"

Transcription

1 HIN Diploma Master of Science P.o.box 385, Lodve Langes gate NARVIK Telephone Fax Title: ncube Power supply Enclosures Date: June Graded: Open Pages: 147 Arthur: Student number Surname Name Cederblad Henrik Fasseland Joar Nordin Olof Division: Branch: Technology Electrotechnology 5 Th. Grade Teaching supervisor: Waldemar Sulkowski (HIN), Per Johan Nicklasson (HIN) Employer: Reference:

2 Content 1. Pre study report 2. Flow scheme 3. Power management program code 4. PIC18LF MAX1896 step up converter 6. MAX1524 step up converter 7. TPS62203 step down converter 8. Part list DC/DC converters 9. DC/DC test results 10. MAX4372 current sensor 11. MAX6575H,L temperature sensor 12. Danionics DLP battery timer 14. Micronector200 connector 15. PCF8574 I/O expander 16. PC74HC153D Data selector 17. MAX4051 Analog multiplexer Logical AND Logical XOR 20. MAX 6129 Voltage reference 21. FDN335N MOSFET 22. ZXM62N02E6 MOSFET 23. ZXM62P02E6 MOSFET 24. 2MHZ Crystal 25. Inductance 26. Resistance 27. Capacitance 28. Sensitivity report Step down converter 29. Sensitivity report Step up converter

3 HIN Project report Master of Science P.o.box 385, Lodve Langes gate NARVIK Telephone Fax Title: Pre-study report ncube Norwegian student satellite Power supply, HIN Arthur: Student number Surname Name Cederblad Henrik Fasseland Joar Nordin Olof Date: March Graded: Pages: 7 Enclosure: 0 Open Division: Branch: Technology Electrotechnology 5 Th. Grade Teaching supervisor: Waldemar Sulkowski (HIN), Per Johan Nicklasson (HIN) Employer: Norwegian Space Centre (NRS) Reference: Marianne Vinje Tantillo Abstract: This report contains a pre-study for the ncube Power Supply diploma. There is a short summation on or previous work, and a figure presentation of what we are working on right now. There are also presented three special topics to fulfill the demands on the Master of Science diploma. Keywords: CubeSat, Power Management, DC/DC, reliability, structure, sensitivity analysis, risk analysis, hardware in the loop, simulation Norske stikkord: CubeSat, Power Management, DC/DC, pålitlighet, struktur, sensitivitets analyse, risikoanalyse, hardware in the loop, simulering

4 1. Preface After a brief discussion with our technical supervisors in this project; we have agreed that a pre-study is unnecessary. We have been working with this project since January 2001 and we all have a pretty good idea about what it involves. There have been made several reports on the subject. In the diploma there have been added three subjects which will be studied in dept. We will also deliver a brief abstract on the previous reports together with a work flow sheet, and a small presentation of what we are doing right now. We will also present the three special topics to be able to accomplish the demands on Master of Science diploma.

5 2. Introduction We are a group of three students at HIN; which is only a small part of a total of 25 students divided between three different Universities (HIN, HTNU and NLH). The purpose of this project (beside constructing and launce the first Norwegian student satellite) was to gain a better cooperation between the different Universities in Norway together with increasing the interest of science study in high school. 3. Concept ncube is a Cube Sat, a concept developed by Stanford University. The concept is based on a fixed size satellite, and a standard launch method (p-pod). The satellite must not exceed these limits. Size: 10*10*10 cm Weight 1 kg Picture 1: Shows a CubeSat

6 4. A brief summation of our previous work 4.1. Power Supply When we were promoted to this task in January 2001; or main task was to make some suggestions on a technical solution on the power supply part, and deliver a report to Norsk Rom Senter (NRS) the 1 July (Technical solution). There were made three different solutions all based on switch mode power supply, and a micro controller which will handle the power management. Since 1 July 2001, one of the solutions was chosen, and upgraded several times. There have also been bought several components which we have tested in the laboratory, and documented in a report delivered to HIN January 2002 (Fase 3). Between these reports we have been participating in several work shops in Narvik, Trondheim and Oslo. Revues have been done on our work to be able to integrate the other sub systems. In these days the first over sized circuit board is designed and produced. The power supply block schema will look like this: Picture 2: Shows a block schematic overview of the Power Supply circuit board. The chosen components and voltage, current and temperature sensors are displayed. The different currents and voltages are also displayed.

7 4.2. Backplane Beside the power supply circuit board, the backplane on satellite is also produced together with Egil Eide. The backplane will be like a motherboard on a PC. It will contain all the connectors connecting the different subsystems together in the satellite. The backplane circuit board will be two of the total four layer power supply circuit. The backplane is also under construction and will look like this. Picture 3: Shows the top side of the Backplane circuit board. All the connectors from all of the subsystems, the solar cells and the antennas are displayed.

8 5. Special topics These tasks should contain: - Literature study - Analyze of the existing topologies with focus on demands and challenge. - Construction of a practical model and testing 5.1. Power management Structure with focus on reliability This task will be very theoretically. It will document on how the power management should be constructed to be reliable and well structured. The power management on board the ncube satellite is a soft real time system, so there is no room for malfunctions, but no hard. This task should survey what could go wrong in the complete power supply system. Are there other ways to built it to get it more reliably, redundancy? 5.2. DC/DC power converter/ power valve structure, sensitivity analysis, evaluation of EMC The task is mainly a theoretical one. To study the structure of dc/dc converters and make sensitivity analyses. This is to study how to make dc/dc converters more stable and reliable. One part is to look at the EMC problems, how to shield the converter from being disturbed by other systems and to make sure not to disturb Hardware in the loop preparation for simulation/ testing in realistic environments. The task with hardware in the loop is to build and program a realistic environment for testing the power supply system on the satellite. This is made by connecting the different inputs and outputs on the satellite to simulated inputs/outputs in dspace. dspace is programmed with matlab/simulink. The different inputs to the satellite are temperature and sunlight, outputs is different subsystem loads. The I2C data communication busses are divided in one output bus and one input bus.

9 6. Work flow sheet Picture 4: Shows the work flow sheet of the ncube and the diploma work

10 main_routine(1) INIT Empty registers init I2C interrupt routine (10 byte) Check recived_i2c_data() Read_iu_routine () Read_temp_routine_line1() Read_temp_routine_line2() ctrl_sens_value_routine() write_to_logg()

11 Read_iu_routine() part1 START Init AD MUX=port0, AD=AN0 (sensor I_mag) Call Subrutine_Read_AD Writes to I_mag Bank0 AD=AN1 (sensor U_sun) Call Subrutine_Read_AD Writes to U_sun Bank0 MUX=port1 (sensor U_bat) Call Subrutine_Read_AD Writes to U_bat Bank0 AD=AN0 (sensor I_in) Call Subrutine_Read_AD Writes to I_in Bank0 MUX=port2 (sensor I_out) Call Subrutine_Read_AD Writes to I_out Bank0 AD=AN1 (sensor U_dd) Call Subrutine_Read_AD Writes to U_dd Bank0 MUX=port3 (sensor U_s) Call Subrutine_Read_AD Writes to U_s Bank0 AD=AN1 (sensor I_dd) Call Subrutine_Read_AD Writes to I_dd Bank0 MUX=port4 (sensor U_vhf) Call Subrutine_Read_AD Writes to U_vhf Bank0 To the next side

12 Read_iu_routine() part2 AD=AN0 (sensor I_uhf) MUX=port6 (sensor U_mag) AD=AN1 (sensor U_uhf) Call Subrutine_Read_AD Call Subrutine_Read_AD Call Subrutine_Read_AD Writes to I_uhf Bank0 Writes to U_mag Bank0 Writes to U_uhf Bank0 MUX=port5 (sensor I_s) AD=AN0 (sensor I_vhf) AD=AN2 (sensor I_sun) Call Subrutine_Read_AD Call Subrutine_Read_AD Call Subrutine_Read_AD Writes to I_s Bank0 Writes to I_vhf Bank0 Writes to I_sun Bank0 AD=AN1 (sensor U_ais) MUX=port7 (sensor I_ais) AD=AN5 (I_uaf_ampl) Call Subrutine_Read_AD Call Subrutine_Read_AD Call Subrutine_Read_AD Writes to U_ais Bank0 Writes to I_ais Bank0 Writes to I_amp_uhf Return

13 Subrutine_ Read_AD() START Delay (Wait for MUX) Start AD converter (sample & hold) Delay (wait one cycle) If AD finish? NO YES Reads 8 MSB to Work memory Return

14 Read_temp_routine_line1() START Clr Flag0 Empty registers (Data_pins=output) Init t_pointer = h51 Init i_counter = h52 Set timer0 = Save error_return_adr Reset Temperature sensores (data=0; for 16ms) Setup (enable) sensores (Data=1; for min 10us) Startup pulse (Data=0; for min 2,5us) Data=1 Data_pins=input Start timer_0 Enable timer_0_interrupt NO YES Data=1? Stop timer_1 Read timer_1 (reads the temperature) NO Inc t_pointer T_pointer=h57? YES Flag0=1? YES Error_return_adr NO Data=0? YES Start timer_1 NO Return

15 Read_temp_routine_line2() START Clear Flag0 Empty registers (Data_pins=output) Init t_pointer = h57 Init i_counter = h58 Set timer0 = Save error_return_adr Reset Temperature sensores (data=0; for 16ms) Setup (enable) sensores (Data=1; for min 10us) Startup pulse (Data=0; for min 2,5us) Data=1 Data_pins=input Start timer_0 Enable timer_0_interrupt NO YES Data=1? Stop timer_1 Read timer_1 (reads the temperature) NO Inc t_pointer T_pointer=h5C? YES Flag0=1? YES Error_return_adr NO YES Data=0? Start timer_1 NO Return

16 ctrl_sense_routine() START Init ctrl_pointer = h40 Init limit_pointer=h8c (=min) Call error_handler_subroutine() Call check_digipeat_subroutine() Brings the error_byte Limit_pointer< Ctrl_pointer? NO call error_subroutine() Return YES Inc limit_pointer (=max) Limit_pointer> Ctrl_pointer? NO call error_subroutine() YES Inc limit_pointer inc ctrl_pointer NO Limit_pointer= h5d YES

17 error_subroutine() Part1 START Limit_pointer= 8C? YES Limit_pointer NO Limit_pointer= hb4 hd2? (U) NO NO Limit_pointer= H8C hb2? (I) Limit_pointer= hd4 hfe? (T) NO YES YES YES Limit_pointer= BC? NO Limit_pointer =C0? NO Limit_pointer =C4? NO YES YES YES Subsytem on? Limit_pointer =A0? NO Limit_pointer =A8? NO YES YES Subsytem on? YES NO Set error_byte = Set error_byte = Set error_byte = Continue at error_subroutine()part2

18 error_subroutine() Part2 Limit_pointer= hc0? NO Limit_pointer= h8e hc0 hc2? NO YES YES Magnetometer On? YES Limit_pointer= h9a hb4 hd4 hd6? YES NO Set error_byte = NO Limit_pointer= hbc hbe ha6 he8 hea YES Limit_pointer= hbc? NO Set error_byte = NO YES Limit_pointer= hae hc4 hc6 hdc hde? NO YES Limit_pointer= hc4? S-band On? NO YES Set error_byte = YES AIS On? YES Set error_byte = NO Return

19 error_handler_subroutine() START Error_byte=0 YES NO Error_byte= NO Error_byte= NO Error_byte= NO Error_byte= NO YES YES YES YES Turn of mag RC6=0 Turn of all subsystem RC5 RC7=0 Turn of S-band RC5=0 Turn of AIS RC7=0 Call write_to_logg() (h5c Bank0) Error_byte = 0 Return

20 Write_to_log() START 10 minutes since last written log? YES NO Return Get pointers from EEPROM Save pointers to EEPROM Initialize loop values Save time for last log Copy value from RAM to FLASH latch Step up pointers and loop numbers Return Loop numbers= 8? YES NO Write to Flash Step up loop2 number NO Loop2 numbers =4?

21 I2C_interupt_routine() START Load i2c_pointer Move I2C data to What i2c_pointer points at Clr i2c_buffer NO I2c_pointer = complete? YES Inc i2c_pointer i2c_pointer = start adr Put I2C ready state Return

22 Timer0_interrupt() START T_pointer=i_counter? YES NO Stop Timer1 Put hff to tmr1h & tmr1l Increase t_pointer Pop stack Load error_return_adr to satck Load timer0 from Tab[t_pointer] Inc i_counter Return

23 Send_from_logg() START Save log_pointer value Init tmp_mem = 0 Inc tmp_mem Log_pointer=d141? YES Set log_pointer=0 Sum=Log_pointer-tmp_mem*30 Sum=negative? NO NO Log_pointer= temp_mem*30? NO YES YES Log_pointer= temp_mem*30+1 Load log_pointer value I2C buffer Ready? YES NO Return Move from Log_pointer to I2C buffer Inc log_pointer

24 I2C_command() part1 START NO Flag2=1? YES Flag0 = interrupt occurred or no I2C_ack Flag1 = I2C_send enable Flag2 = status_send_complete Flag3 = logg_send_complete Flag1=1? YES Call subroutine send_status NO NO Flag3=1? YES Flag1=1? YES Call subroutine send_logg NO Continues on next page

25 NO YES Return Command= clk_command? Set flag1 Command= Pause_cmd? NO YES Return NO YES Command= resume_cmd? Command= Send_status? NO YES Call Subroutine Send_status NO YES Command= AIS_on? Command= AIS_off? NO YES NO YES Command= mag_on? Command= mag_off? NO YES YES Command= Send_logg? NO YES Command= S-band_on? NO Call Subroutine Send_logg Call Subroutine AIS_on Call Subroutine AIS_off Call Subroutine Mag_on Call Subroutine mag_off Call Subroutine S-band_on NO YES Command= S-band_off Command= AIS_off? NO YES NO Command= Reset_PMU? YES Call Subroutine Sband_off Call Subroutine AIS_off Reset Return Continue from previous page I2C_command() part2

26 #INCLUDE EQUN.ASM #INCLUDE TEXT.ASM #INCLUDE COMANDS.ASM #INCLUDE P18F452.INC PMUcode.txt ORG RES_V GOTO START ;Puts the start address in start vector ORG INT_H GOTO I2C_INTERUPT ;Put I2C as high priority interrupt ORG INT_L GOTO TIMER0_INTERUPT ;Put Timer0 as low priority interrupt ORG RETADR1 GOTO ERROR_RETURN1 ;Sets return address in temp-routines ORG RETADR2 GOTO ERROR_RETURN2 ORG RETADRI2C GOTO SEND_I2C ORG START_ADR ;Sets the start address START ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Initialising of memories, flags and registers ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MOVWF CLRF CLRF CLRF MOVWF MOVWF MOVWF MOVWF CLRF CLRF CLRF CLRF MOVWF MOVWF CLRF CLRF B' ' INTCON INTCON2 INTCON3 ADCON0 B' ' ADCON1 B' ' T0CON B' ' T1CON H'01' FSR1H FSR1L BSR PIR1 PIR2 B' ' IPR1 B' ' PIE1 PIE2 IPR2 Side 1

27 PMUcode.txt B' ' MOVWF RCON B' ' MOVWF SSPSTAT B' ' MOVWF SSPCON1 B' ' MOVWF SSPCON2 B' ' MOVWF TRISC CLRF TRISD ;Sets PORTD To outputs CLRF PORTD CLRF TRISE ;Sets PORTE To outputs CLRF PORTE SETF TRISA ;Sets PORTA as Inputs B' ' MOVWF TRISB ;Sets PORTB as In/Out-puts CLRF PORTB CLRF MEM CLRF COMAND ADR_PMU MOVWF SSPADD ;ADDRESS To PMU H'FF' MOVWF SSPBUF,0 AIS_OFF ;Turns off AIS SBAND_OFF ;Turns off S-Band MAG_OFF ;Turns off Magnetometer CLRF PORTB CLRF FLAG CLRF SUBSYSTEMS CLRF ADR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Clear memory where the housekeeping data will ;;; ;;; be stored ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CLRF FSR0H H'3B' MOVWF FSR0L,0 MOVWF I2Cbyte,0 CLR_MEM CLRF INCF SUBLW BTFSS GOTO MOVWF INDF0 FSR0L,1 FSR0L,0 H'5C' STATUS,Z CLR_MEM H'3B' FSR0L ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Side 2

28 PMUcode.txt ;;; Main routin ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN sensors I2C_COMAND ;Check for received commands CLRWDT ;Clears the watch dog timer READ_IU ;Reads Voltage and Current sensors CLRWDT ;Clears the watch dog timer READ_TEMP_LINE1 ;Reads temperature of internal CLRWDT ;Clears the watch dog timer READ_TEMP_LINE2 ;Read temperature of Solar cells CLRWDT ;Clears the watch dog timer CTRL_SENSE_VALUE;Controls if values are ok CLRWDT ;Clears the watch dog timer WRITE_TO_LOGG ;Write log CLRWDT ;Clears the watch dog timer GOTO MAIN ;Jump to start of Main ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End Of Main ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Receive I2C data check if any command has been ;;;; ;; received on the I2C bus ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I2C_COMAND BTFSS FLAG,2 BRA CH_LOGG ;Check for interruption in send status BTFSC FLAG,1 SEND_STATUS CH_LOGG BTFSS FLAG,3 BRA CH_CMDS ;Check for interruption in send log BTFSC FLAG,1 SEND_LOGG CH_CMDS COMAND,0 BTFSC STATUS,Z RETURN ;Return if no new command COMAND,0 SUBLW CLK_COMAND ;Check for clock command BTFSC STATUS,Z RETURN COMAND,0 SUBLW CMD_PAUSE ;Check for pause command BTFSC STATUS,Z RETURN Side 3

29 PMUcode.txt COMAND,0 SUBLW CMD_RESUME ;Check for resume command BTFSC STATUS,Z BSF FLAG,1 CMD_STATUS_DATA ;Check for "send status" command SUBWF COMAND,0 BTFSC STATUS,Z SEND_STATUS CMD_LOGG_DATA ;Check for "send log" command SUBWF COMAND,0 BTFSC STATUS,Z SEND_LOGG CC1 command CC2 command command CC3 command CMD_AIS_ON ;Check for "Turn on AIS" command SUBWF COMAND,0 BTFSS STATUS,Z GOTO CC1 AIS_ON CLRF COMAND CMD_AIS_OFF ;Check for "Turn off AIS" command SUBWF COMAND,0 BTFSC STATUS,Z AIS_OFF CMD_MAG_ON ;Check for "Turn on Magnetometer" SUBWF BTFSS GOTO CLRF COMAND,0 STATUS,Z CC2 MAG_ON COMAND CMD_MAG_OFF ;Check for "Turn off Magnetometer" SUBWF COMAND,0 BTFSC STATUS,Z MAG_OFF CMD_SBAND_ON ;Check for "Turn on S-band" SUBWF BTFSS GOTO CLRF COMAND,0 STATUS,Z CC3 SBAND_ON COMAND CMD_SBAND_OFF ;Check for "Turn off S-band" SUBWF COMAND,0 BTFSC STATUS,Z SBAND_OFF CMD_RESET ;Check for Reset command SUBWF COMAND,0 Side 4

30 PMUcode.txt BTFSC STATUS,Z RESET RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Receive I2C data routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Read UI reads input Current and Voltage;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_IU B' ' MOVWF ADCON1 BSF ADCON0,6 ;A/D OSC 1/16 BSF ADCON0,0 ;Starts A/D BCF PORTB,0 ;Put Mux in position 0 BCF PORTB,1 BCF PORTB,2 BCF ADCON0,3 ;Put A/D to channel AN0 BCF ADCON0,4 BCF ADCON0,5 READ_AD ;Read value from A/D MOVWF IMAG ;Save value to IMAG BSF ADCON0,3 ;Put A/D to channel AN1 READ_AD ;Read value from A/D MOVWF VSOL ;Save value to VSOL BSF PORTB,0 ;Put Mux in position 1 READ_AD ;Reads VBAT MOVWF VBAT ;Save value to VBAT BCF ADCON0,3 ;Put A/D to channel AN0 READ_AD ;Read value from A/D MOVWF IIN ;Save value to IIN BCF PORTB,0 BSF PORTB,1 ;Put Mux in position 2 READ_AD ;Read value from A/D MOVWF IUT ;Save value to IUT BSF ADCON0,3 ;Put A/D to channel AN1 READ_AD ;Read value from A/D MOVWF VDD ;Save value to VDD BSF PORTB,0 ;Put Mux in position 3 READ_AD ;Read value from A/D MOVWF VS ;Save value to VS BCF ADCON0,3 ;Put A/D to channel AN0 READ_AD ;Read value from A/D MOVWF IDD ;Save value to IDD BSF PORTB,2 ;Put Mux in position 7 READ_AD ;Read value from A/D MOVWF IAIS ;Save value to IAIS BSF ADCON0,3 ;Put A/D to channel AN1 READ_AD ;Read value from A/D MOVWF VUHF ;Save value to VUHF BCF PORTB,0 ;Put Mux in position 6 Side 5

31 PMUcode.txt READ_AD ;Read value from A/D MOVWF VMAG ;Save value to VMAG BCF ADCON0,3 ;Put A/D to channel AN0 READ_AD ;Read value from A/D MOVWF IVHF ;Save value to IVHF BCF PORTB,1 ;Put Mux in position 4 READ_AD ;Read value from A/D MOVWF IUHF ;Save value to IUHF BSF ADCON0,3 ;Put A/D to channel AN1 READ_AD ;Read value from A/D MOVWF VVHF ;Save value to VVHF BSF PORTB,0 ;Put Mux in position 5 READ_AD ;Read value from A/D MOVWF VAIS ;Save value to VAIS BCF ADCON0,3 ;Put A/D to channel AN0 READ_AD ;Read value from A/D MOVWF IS ;Save value to IS (S-band current) BSF ADCON0,4 ;Put A/D to channel AN2 READ_AD ;Read value from A/D MOVWF ISOL ;Save value to ISOL BSF ADCON0,5 BCF ADCON0,4 ;Put A/D to channel AN4 BCF ADCON0,3 READ_AD ;Read value from A/D MOVWF IPAUHF ;Save value to IPAUHF BCF ADCON0,0 ;Turns off A/D RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Read AD routine reads the value ;;;; ;;; on Selected AD port ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_AD D'1' DELAY BSF ADCON0,2 ;Starts converting NOP ADLOOP BTFSC ADCON0,2,0 ;Tests if A/D is finish GOTO ADLOOP ADRESH,0 RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End Of Read_AD ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Read_Temp_Line1 reads the temperature sensors ;;;; ;; at Line1 (Subsystems & Batt)(PortC pin 0) ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_TEMP_LINE1 CLRF BSR ;Bank0 selected Side 6

32 PMUcode.txt CLRF FSR0H ;Pointer0 points at Bank0 TMR0_VALUES MOVWF T0VALUE D'6' ;6 registers that should be cleared MOVWF MEM H'52' MOVWF FSR0L ;Points at first temp-1 H'01' ;ERROR return address MOVWF ERROR_RETH H'30' MOVWF ERROR_RETL CLR_TEMP1 INCF FSR0L ;Loop that clears all temperature CLRF INDF0 ;registers DECFSZ MEM,1 GOTO CLR_TEMP1 BCF FLAG,0 ;FLAG I2C=0 BCF TRISC,0 ;PortC pin0=output H'52' MOVWF FSR0L H'53' MOVWF MEM ;MEM = I_COUNTER H'F8' MOVWF TMR0H ;Inits Timer0 low byte H'30' MOVWF TMR0L ;Inits Timer0 high byte BCF PORTC,0 ;RESET TEMPSENSORS ON PORTC PIN0 D'20' DELAY ;20ms delay BSF PORTC,0 ;TSETUP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP Side 7

33 PMUcode.txt NOP NOP BCF PORTC,0 ;send trig pulse CLRF TMR1H CLRF TMR1L BSF PORTC,0 BSF TRISC,0 ;Sets PortC BITO To Input BSF INTCON,5 ;Enable TIMER0 Interrupt BSF T0CON,7 ;Starts Timer 0 DATA01 DATA11 BTFSC PORTC,0 GOTO DATA01 CLRF TMR1H CLRF TMR1L BSF T1CON,0 ;Starts TIMER1 BTFSS PORTC,0 GOTO DATA11 BCF T1CON,0 ;Stops TIMER1 TEMP_ADJ MOVWF INDF0 ERROR_RETURN1 INCF FSR0L,1 ;Increase T_pionter FSR0L,0 SUBLW H'58' BTFSS STATUS,Z GOTO DATA01 BCF T0CON,7 ;Stops timer0 BCF INTCON,5 ;Disable TIMER0 Interrupt BTFSC FLAG,0 BRA READ_TEMP_LINE1 RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Returns from Temperature line 1 function ;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Read_Temp_Line2 reads the temperature in the sensors ;; ;;; on the second Line (Solar Cells) (PortC pin 1) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_TEMP_LINE2 CLRF BSR ;Bank0 selected CLRF FSR0H ;Pointer0 points at Bank0 TMR0_VALUES MOVWF T0VALUE D'5' ;5 registers should be cleared MOVWF MEM Side 8

34 PMUcode.txt H'58' MOVWF FSR0L H'59' MOVWF MEM ;MEM = I_COUNTER H'F8' MOVWF TMR0H ;Inits Timer0 low byte H'30' MOVWF TMR0L ;Inits Timer0 high byte BCF PORTC,1 ;RESET TEMPSENSORS ON PORTC PIN1 D'20' DELAY ;20ms delay BSF PORTC,1 ;TSETUP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP BCF PORTC,1 ;send trig pulse CLRF TMR1H CLRF TMR1L BSF PORTC,1 BSF TRISC,1 ;Sets PortC BITO To Inputs BSF INTCON,5 ;Enable TIMER0 interrupt BSF T0CON,7 ;Starts Timer 0 DATA02 DATA12 BTFSC PORTC,1 GOTO DATA02 CLRF TMR1H CLRF TMR1L BSF T1CON,0 ;Starts TIMER1 BTFSS PORTC,1 GOTO DATA12 BCF T1CON,0 ;Stops TIMER1 Side 9

35 PMUcode.txt TEMP_ADJ MOVWF INDF0 ERROR_RETURN2 INCF FSR0L,1 ;Increase T_pionter FSR0L,0 SUBLW H'5D' BTFSS STATUS,Z GOTO DATA02 BCF T0CON,7 ;Stops timer0 BCF INTCON,5 ;Disable TIMER0 Interrupt BTFSC FLAG,0 BRA READ_TEMP_LINE2 RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Returns from Temperature line 2 function ;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Temp_ADJ routine adjusts the 2Byte timer1 value ;;;; ;; to a 1Byte temperature value with 0,8C/bit ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TEMP_ADJ H'46' ;Subtract Timer1 SUBWF TMR1L,1 ;Value with 246 BTFSS STATUS,C ; DECF TMR1L,1 ; H'2' ; SUBWF TMR1H,1 ;and divide it with 2 RRNCF TMR1H,1 ; RRCF TMR1L,0 ; RETURN ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Return from adjust temperature routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Control Sense value routine controls that the ;;;; ;; sensor values is out of the limits ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CTRL_SENSE_VALUE CLRF FSR0H ;BANK0 H'40' MOVWF FSR0L H'8C' MOVWF LIMIT_POINTER SENSE_LOOP READ_LIMIT SUBFWB INDF0,0 BTFSS STATUS,C ERROR_SUB Side 10

36 PMUcode.txt INCF LIMIT_POINTER,1 ;Increase Limit pointer INCF LIMIT_POINTER,1 ;2 step for 2byte READ_LIMIT SUBFWB INDF0,0 BTFSC STATUS,C ERROR_SUB INCF LIMIT_POINTER,1 ;Increase Limit pointer INCF LIMIT_POINTER,1 ;2 step for 2byte INCF FSR0L,1 ;Increase senor pointer FSR0L,0 SUBLW H'5D' BTFSS STATUS,Z GOTO SENSE_LOOP GOTO ERROR_HANDLER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Control sensor value routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Read Limit is returning a value from the address;;;; ;; in the table that LIMIT_POINTER is pointing at ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_LIMIT LIMIT_POINTER,0 MOVWF PCL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of READ_LIMIT ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Error sub_routine sets different flags ;;;; ;; depending on what error occur ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ERROR_SUB LIMIT_POINTER,0 SUBLW H'B3' BTFSC STATUS,C ;Check if currents are ok GOTO FLAG4 LIMIT_POINTER,0 SUBLW H'D3' BTFSC STATUS,C ;Check if voltages are ok GOTO FLAG5 LIMIT_POINTER,0 SUBLW H'FF' BTFSC STATUS,C ;Check if temperature are ok FLAG6 GOTO FLAG6 GOTO ERR_ACTION BSF ERRORS,6 ;Sets Error flag6 Side 11

37 PMUcode.txt GOTO ERR_ACTION FLAG5 LIMIT_POINTER,0 SUBLW H'C0' ;Check the reason for the error BZ FLAG5_MAG ;Check if error is from Magnetometer LIMIT_POINTER,0 SUBLW H'BC' BZ FLAG5_SBAND ;Check if error is from S-Band LIMIT_POINTER,0 SUBLW H'C4' BZ FLAG5_AIS ;Check if error is from AIS BSF ERRORS,5 GOTO ERR_ACTION FLAG5_MAG BTFSC SUBSYSTEMS,0 ;Check if subsystem is turned on BSF ERRORS,5 ;Sets Error flag5 if it is GOTO ERR_ACTION FLAG5_SBAND BTFSC SUBSYSTEMS,2 ;Check if subsystem is turned on BSF ERRORS,5 ;Sets Error flag5 if it is GOTO ERR_ACTION FLAG5_AIS BTFSC SUBSYSTEMS,3 ;Check if subsystem is turned on BSF ERRORS,5 ;Sets Error flag5 if it is GOTO ERR_ACTION FLAG4 LIMIT_POINTER,0 SUBLW H'8C' BZ FLAG4_MAG ;Check if error is from Magnetometer LIMIT_POINTER,0 SUBLW H'A0' BZ FLAG4_SBAND ;Check if error is from S-Band LIMIT_POINTER,0 SUBLW H'A8' BZ FLAG4_AIS ;Check if error is from AIS BSF ERRORS,4 ;Sets Error flag4 GOTO ERR_ACTION FLAG4_MAG BTFSC SUBSYSTEMS,0 ;Check if subsystem is turned on BSF ERRORS,4 ;Sets Error flag4 if on GOTO ERR_ACTION FLAG4_SBAND BTFSC SUBSYSTEMS,2 ;Check if subsystem is turned on BSF ERRORS,4 ;Sets Error flag4 if on GOTO ERR_ACTION FLAG4_AIS BTFSC SUBSYSTEMS,3 ;Check if subsystem is turned on BSF ERRORS,4 ;Sets Error flag4 if on GOTO ERR_ACTION Side 12

38 PMUcode.txt ERR_ACTION LIMIT_POINTER,0 ;Checks if flag0 should be set SUBLW H'8E' BTFSC STATUS,Z BSF ERRORS,0 ;Sets Error flag0 LIMIT_POINTER,0 SUBLW H'C0' BTFSC STATUS,Z FLAG0 LIMIT_POINTER,0 SUBLW H'C2' BTFSC STATUS,Z BSF ERRORS,0 ;Sets Error flag0 LIMIT_POINTER,0 ;Checks if flag1 should be set SUBLW H'96' BTFSC STATUS,Z BSF ERRORS,1 ;Sets Error flag1 LIMIT_POINTER,0 SUBLW H'B4' BTFSC STATUS,Z BSF ERRORS,1 ;Sets Error flag1 LIMIT_POINTER,0 SUBLW H'D4' BTFSC STATUS,Z BSF ERRORS,1 ;Sets Error flag1 LIMIT_POINTER,0 SUBLW H'D6' BTFSC STATUS,Z BSF ERRORS,1 ;Sets Error flag1 LIMIT_POINTER,0 ;Checks if flag2 should be set SUBLW H'BC' BTFSC STATUS,Z FLAG2 ;Sets Error flag2 LIMIT_POINTER,0 SUBLW H'BE' BTFSC STATUS,Z BSF ERRORS,2 ;Sets Error flag2 LIMIT_POINTER,0 SUBLW H'A2' BTFSC STATUS,Z BSF ERRORS,2 ;Sets Error flag2 LIMIT_POINTER,0 SUBLW H'E8' BTFSC STATUS,Z BSF ERRORS,2 ;Sets Error flag2 LIMIT_POINTER,0 SUBLW H'EA' Side 13

39 PMUcode.txt BTFSC STATUS,Z BSF ERRORS,2 ;Sets Error flag2 LIMIT_POINTER,0 ;Checks if flag3 should be set SUBLW H'AA' BTFSC STATUS,Z BSF ERRORS,3 ;Sets Error flag3 LIMIT_POINTER,0 SUBLW H'C4' BTFSC STATUS,Z FLAG3 LIMIT_POINTER,0 SUBLW H'C6' BTFSC STATUS,Z BSF ERRORS,3 ;Sets Error flag3 LIMIT_POINTER,0 SUBLW H'DC' BTFSC STATUS,Z BSF ERRORS,3 LIMIT_POINTER,0 SUBLW H'DE' BTFSC STATUS,Z BSF ERRORS,3 ;Sets Error flag3 VB_digpt ;Checks Digipeat voltage level on Batteries CPFSGT VBAT BRA DIGPT_OFF VS_digpt ;Checks Digipeat voltage level on Solar Cells CPFSGT VSOL BRA DIGPT_OFF BSF PORTA,5 ;Turns on digipeat RETURN DIGPT_OFF BCF PORTA,5 ;Turns of digipeat RETURN FLAG0 FLAG2 BTFSC SUBSYSTEMS,0 ;Check if subsystem is turned on BSF ERRORS,0 ;Set flag0 if it is RETURN BTFSC SUBSYSTEMS,2 ;Check if subsystem is turned on BSF ERRORS,2 ;Set flag2 if it is RETURN FLAG3 BTFSC SUBSYSTEMS,3 ;Check if subsystem is turned on BSF ERRORS,3 ;Set flag3 if it is RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Side 14

40 PMUcode.txt ;; End of Error subrutine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAG_OFF BTFSS PORTB,5 ;Check if portb pin5 is set BTG PORTC,6 ;toggle pin6 if not set BCF SUBSYSTEMS,0 ;Clear bit0 subsystem register RETURN ;Return from routine MAG_ON BTFSC PORTB,5 ;Check if portb pin5 is low BTG PORTC,6 ;toggle pin6 of not low BSF SUBSYSTEMS,0 ;Set bit0 subsystem register D'20' ;Wait for DC/DC to start up DELAY RETURN ;Return from routine SBAND_OFF BTFSS PORTB,4 ;Check if port is set BTG PORTC,5 ;toggle pin5 if not set BCF SUBSYSTEMS,2 ;Clear bit2 subsystem register RETURN ;Return from routine SBAND_ON BTFSC PORTB,4 ;Check if port is low BTG PORTC,5 ;toggle pin5 if not low BSF SUBSYSTEMS,2 ;Set bit2 subsystem register D'20' ;Wait for DC/DC to start up DELAY RETURN ;Return from routine AIS_OFF AIS_ON BTFSC PORTB,3 ;Check if port is low BTG PORTC,7 ;toggle pin7 if not low BCF SUBSYSTEMS,3 ;Clear bit7 subsystem register RETURN ;Return from routine BTFSS PORTB,3 ;Check if port is set BTG PORTC,7 ;toggle pin7 if not set BSF SUBSYSTEMS,3 ;Set bit3 subsystem register D'20' ;Wait for DC/DC to start up DELAY RETURN ;Return from routine ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Error handler routine check if subsystems should;;;; ;; be turned of ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ERROR_HANDLER BTFSS ERRORS,0 ;Check error flag0 GOTO ALLSUB_TEST MAG_OFF ;Turn off all magnetometer if set Side 15

41 PMUcode.txt GOTO END_HANDLER ALLSUB_TEST BTFSS ERRORS,1 ;Check error flag1 GOTO SBAND_TEST MAG_OFF ;Turn off all subsystems if set SBAND_OFF AIS_OFF GOTO END_HANDLER SBAND_TEST BTFSS ERRORS,2 ;Check error flag2 GOTO AIS_TEST SBAND_OFF ;Turn off S-Band if set GOTO END_HANDLER AIS_TEST BTFSC ERRORS,3 ;Check error flag3 AIS_OFF ;Turn off AIS if set END_HANDLER CLRF ERRORS RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of error handler routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Write to log writes the sensor values in Bank0;;;; ;; to the log in FLASH ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WRITE_TO_LOGG HOUR,0,0 ;Converts time to minutes MULLW D'60' MIN,0,0 ADDWF PRODL,1,0 BTFSC STATUS,C INCF PRODH,1,0 MOVWF MOVWF SUBWF SUBWFB BTFSC GOTO SUBLW BTFSC PRODL,0 TEMP PRODH,0 TEMP2 OLD_TIMEL,0 TEMP,1 OLD_TIMEH,0 TEMP2,1 STATUS,C CHECK_TIME TEMP,0 D'9' STATUS,C Side 16

42 RETURN PMUcode.txt GOTO RETURN CHECK_TIME since last log SUBLW BTFSC DECF SUBLW ADDWF SUBLW BTFSS RETURN WRITE_LOGG OLD_TIMEL,0 H'A0' STATUS,C OLD_TIMEH,0 H'05' PRODL,0 D'9' STATUS,C ;Check if there are ten minutes WRITE_LOGG PRODH,0 MOVWF OLD_TIMEH ;Save last update time PRODL,0 MOVWF OLD_TIMEL MOVWF CLRF HOUR FSR0L FSR0H CLRF TBLPTRU EE_STARTH READ_EE MOVWF TBLPTRH EE_STARTL READ_EE MOVWF TBLPTRL D'4' ;Sets that there is 4 loop that should be run MOVWF TEMP2 PROG_LOOP D'8' ;8 bytes of data that should be written MOVWF TEMP WRITE_BYTE MOVWF TBLWT+* DECFSZ BRA POSTINC0,0 TABLAT TEMP,1 WRITE_BYTE PROGRAM_FLASH BSF EECON1,EEPGD ;POINT TO FLASH Side 17

43 PMUcode.txt BCF EECON1,CFGS ;ACCESS FLASH BSF EECON1,WREN ;ENABLE WRITE BCF INTCON,GIE ;DISABLE INTERRUPTS H'55' MOVWF EECON2 H'AA' MOVWF EECON2 BSF EECON1,WR BSF INTCON,GIE ;ENABLE INTERUPTS DECFSZ TEMP2,1 BRA PROG_LOOP BCF EECON1,WREN ;DISABLE FLASH WRITE MOVWF MOVWF EE_STOPL READ_EE TEMP EE_STOPH READ_EE TEMP2 D'32' ;32BYTE ADDWF TEMP,1 BTFSC STATUS,C INCF TEMP2,1 STOP_LOGG_ADRL ;Check if pointer is at the end CPFSEQ TEMP,0 BRA END_LOGG STOP_LOGG_ADRH CPFSEQ TEMP2,0 BRA END_LOGG MOVWF MOVWF START_LOGG_ADRL TEMP START_LOGG_ADRH TEMP2 END_LOGG EE_STOPL ;Save pointer values to EEPROM WRITE_EE TEMP2,0 MOVWF TEMP EE_STOPH WRITE_EE RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; EE address in W in, and EE data in w out ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Side 18

44 READ_EE PMUcode.txt MOVWF EEADR BCF EECON1,EEPGD ;POINT TO EE BCF EECON1,CFGS ;ACCESS MEM BSF EECON1,RD ;EE READ EEDATA,0 RETURN WRITE_EE MOVWF MOVWF BCF BCF BSF EEADR TEMP,0 EEDATA EECON1,EEPGD EECON1,CFGS EECON1,WREN EE_WAIT BCF INTCON, GIE ;DISABLE INTERRUPTS H'55' MOVWF EECON2 H'AA' MOVWF EECON2 BSF EECON1,WR ;WRITE BSF INTCON,GIE ;ENABLE INTERRUPTS BTFSS BRA RETURN PIR2,EEIF EE_WAIT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Write to log routine ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Send STATUS Sends the latest housekeeping data;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SEND_STATUS BCF INTCON,GIE ;DISABLE INTERRUPTS D'1' ;NUMBERS OF ATTEMPTS TO SEND ON I2C MOVWF I2C_ERROR CLRF COMAND BSF FLAG,1 BCF FLAG,2 BTFSS FLAG,2 BRA CONT_STATUS STATUS_PTR_SAVE,0 MOVWF FSR0L CLRF FSR0H BRA SEND_LOOP Side 19

45 PMUcode.txt CONT_STATUS H'3E' ;Sets pointer to start value of registers MOVWF FSR0L CLRF FSR0H SEND_LOOP INDF0,0 MOVWF CONT CONVERT ;Convert a byte to BCD ADR_TNC MOVWF I2Cdata I2C_STARTS ;Send start and address BTFSC FLAG,0 ;CHECK FOR INTERRUPT BRA STOP_STATUS_SEND CONHH,0,0 ADDLW H'30' MOVWF I2Cdata SEND_BYTE ;Send byte1 BTFSC FLAG,0 ;Check if flag0 is set GOTO STOP_STATUS_SEND BTFSS FLAG,1 ;Check if flag1 is set BRA STOP_STATUS_SEND BTFSC FLAG,5 ;Check if flag5 is set BRA STOP_STATUS_SEND BTFSC FLAG,0 ;CHECK FOR INTERRUPT BRA STOP_STATUS_SEND CONH,0,0 ADDLW H'30' MOVWF I2Cdata SEND_BYTE ;Send Byte2 BTFSC FLAG,0 ;Check if flag0 is set GOTO STOP_STATUS_SEND BTFSS FLAG,1 ;Check if flag1 is set BRA STOP_STATUS_SEND BTFSC FLAG,5 ;Check if flag5 is set BRA STOP_STATUS_SEND BTFSC FLAG,0 ;CHECK FOR INTERRUPT BRA STOP_STATUS_SEND CONL,0,0 ADDLW H'30' MOVWF I2Cdata SEND_BYTE ;Send Byte3 BTFSS FLAG,0 INCF FSR0L,1 BTFSC FLAG,0 ;Check if flag0 is set GOTO STOP_STATUS_SEND BTFSS FLAG,1 ;Check if flag1 is set Side 20

46 PMUcode.txt BRA STOP_STATUS_SEND BTFSC FLAG,5 ;Check if flag5 is set BRA STOP_STATUS_SEND I2C_STOPS ;Send Stop condition on I2C bus D'50' DELAY H'5D' ;Wait for TNC to handle data CPFSGT FSR0L,0 BRA SEND_LOOP ADR_TNC MOVWF I2Cdata I2C_STARTS ;Send start and address D'13' ;Sends "Enter" on I2C MOVWF I2Cdata SEND_BYTE I2C_STOPS BSF INTCON,GIE ;ENABLE INTERRUPTS RETURN STOP_STATUS_SEND BSF FLAG,2 ;Set flag2 (Send status interrupted) FSR0L,0 MOVWF STATUS_PTR_SAVE ;Save pointers I2C_STOPS ;Send stop condition on I2C BSF INTCON,GIE ;ENABLE INTERRUPTS RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Send STATUS routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Send logg sends all logged values to ;;;; ;; the I2C data bus ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SEND_LOGG BSF FLAG,1 BTFSS FLAG,3 ;Check if sending is allowed CLRF COMAND BRA SEND_LOGG_START BCF FLAG,3 CLRF TBLPTRU EE_tempH ;Get pointers from EEPROM READ_EE MOVWF TBLPTRH EE_tempL READ_EE MOVWF TBLPTRL Side 21

47 TBLRD* BRA LOGG_LOOP PMUcode.txt SEND_LOGG_START CLRF TBLPTRU ;Initiate pointers EE_STARTH READ_EE MOVWF TBLPTRH EE_STARTL READ_EE MOVWF TBLPTRL TBLRD* ;Read from table LOGG_LOOP TABLAT,0 SEND_I2C ;Send byte on I2C BTFSS FLAG,0 ;Check for interrupt flag BRA LOGG_CONT BTFSS FLAG,1 ;Check for "no sending allowed" BRA LOGG_LOOP BSF FLAG,3 BRA END_WLOGG_NOTCOMP LOGG_CONT TBLRD*+ ;Step up table pointer STOP_LOGG_ADRL ;Check if pointer is at the end of log CPFSEQ TBLPTRL BRA LOGG_ENDCH STOP_LOGG_ADRH CPFSEQ TBLPTRH BRA LOGG_ENDCH START_LOGG_ADRL MOVWF TBLPTRL START_LOGG_ADRH MOVWF TBLPTRH LOGG_ENDCH EE_STOPH ;Check if whole log is sent READ_EE ;Read from EEPROM CPFSEQ TBLPTRH BRA LOGG_LOOP EE_STARTL READ_EE CPFSEQ TBLPTRL BRA LOGG_LOOP BRA END_WLOGG END_WLOGG ;Complete Send log TBLPTRH,0,0 ;Update the Log pointers MOVWF TEMP EE_STARTH WRITE_EE ;Save pointers to EEPROM TBLPTRL,0,0 Side 22

48 MOVWF RETURN TEMP EE_STARTL WRITE_EE PMUcode.txt END_WLOGG_NOTCOMP ;Not complete send log TBLPTRH,0,0 ;save the log pointer in temporary EE MOVWF TEMP ;addresses EE_tempH WRITE_EE TBLPTRL,0,0 MOVWF TEMP EE_tempL WRITE_EE RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of send log routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Send I2C is sending a byte of data on the bus ;;;; ;; The byte must be stored as I2Cdata ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SEND_I2C MOVWF I2CTemp BCF FLAG,0 ADR_TNC MOVWF I2Cdata I2C_STARTS BTFSC FLAG,0 ;CHECK FOR INTERRUPT RETURN ;Return if interrupt occurred I2CTemp,0,0 MOVWF I2Cdata SEND_BYTE ;Sending a byte on I2C Bus BTFSC FLAG,0 ;CHECK FOR INTERRUPT I2C_STOPS ;Send Stop condition RETURN I2C_STARTS BCF LATB,SCLP ;CLK LOW WHEN OUTPUT BCF LATB,SDAP ;DATA LOW WHEN OUTPUT BCF PORTB,SCLP BCF PORTB,SDAP BSF TRISB,SDAP BSF TRISB,SCLP NOP NOP NOP Side 23

49 PMUcode.txt NOP BCF TRISB,SDAP ;START BCF TRISB,SCLP BCF PORTB,SCLP SEND_BYTE BCF BCF BCF BCF RLCF BTFSC BSF FLAG,0 TRISB,SDAP PORTB,SDAP STATUS,C I2Cdata,1 STATUS,C TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE1 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE2 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE3 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE4 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE5 BCF TRISB,SCLP BCF TRISB,SDAP Side 24

50 BTFSC BSF STATUS,C TRISB,SDAP PMUcode.txt BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE6 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cdata,1 ;BYTE7 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP ;BYTE8 NOP NOP BCF TRISB,SCLP BCF PORTB,SCLP BSF TRISB,SDAP ;RELEASE DATA BSF TRISB,SCLP BTFSC PORTB,SDAP ;check ack GOTO ERR_I2C BCF TRISB,SCLP RETURN I2C_STOPS BCF BCF NOP NOP BSF NOP NOP BSF NOP NOP BSF RETURN TRISB,SDAP PORTB,SDAP TRISB,SCLP TRISB,SDAP TRISB,SCLP ;Stop condition ERR_I2C DECF BCF BCF I2C_ERROR,1 TRISB,SCLP PORTB,SCLP ;Handles error on I2C Side 25

51 NOP NOP BSF NOP NOP BSF BSF BTFSC GOTO I2C_ERR_WAIT RETURN TRISB,SCLP TRISB,SDAP FLAG,0 I2C_ERROR,1 STATUS,Z I2C_FAIL H'FF' DELAY PMUcode.txt I2C_FAIL BSF FLAG,5 ;Set Flag5 (Interrupt occurred) D'1' MOVWF I2C_ERROR RETURN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Send From I2C routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Delay sub routine is a delay routine that ;;;; ;; the input value in ms ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DELAY MOVWF DELAY2 ;Moves value of W to DELAY2 D'165' ;Puts the value 2FH to W MOVWF DELAY1 ;Moves W to DELAY1 LOOP1 DECFSZ DELAY1,1 ;Decreases DELAY1 with 1 GOTO LOOP1 ;Jumps to LOOP1 if DELAY1>=1 REFIL D'165' ;Moves the value 2FH to W MOVWF DELAY1 ;Puts W to DELAY1 DECFSZ DELAY2 ;Decreases DELAY2 with 1 GOTO LOOP1 ;Jumps to LOOP1 if DELAY2>=1 RETURN ;Returns from routine ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Delay routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; I2C interrupt routine reads an byte received ;;;; ;; on the I2C bus, and store it in I2C memory ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I2C_INTERUPT BSF FLAG,0 BCF PIR1,3 ;Resets the Interrupt flag Side 26

52 PMUcode.txt BCF SSPCON1,6,0 SSPBUF,0,0 BTFSS SSPSTAT,5,0 ;Check if there is a received address or data GOTO I2C_ADR H'40' CPFSLT FSR0L,0 RETFIE ;Return if pointer is out of range SSPBUF,0,0 ;Move data from I2C buffer to MOVWF POSTINC0,0 ;where the pointer0 points CMD_PAUSE ;Check if there s a Pause command received CPFSEQ COMAND RETFIE ;Return if not BSF FLAG,0 ;Set flag0 if Pause command is received RETFIE ;return from routine I2C_ADR ;Handel received address BTFSC SSPBUF,0,0 ;Check if data direction is right RESET_I2C ;Reset if wrong H'3B' ;Move start value of registers MOVWF FSR0L,0 ;put value to pointer0 SSPBUF,0,0 ;Move address MOVWF POSTINC0,0 ;Puts to register RETFIE ;Return from routine RESET_I2C RESET ;Resets the PMU ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of I2C interrupt routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Timer0 interrupt, hold track of max time ;;;; ;; to the temperature sensors, skip sensor after ;;;; ;; a max time and report an error ;;;; ;; value FF = sensor didn t answer ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIMER0_INTERUPT BCF INTCON,2 ;Clear interrupt MEM,0 CPFSEQ FSR0L GOTO STOP_TMR GOTO LOAD_TMR STOP_TMR BCF T1CON,0 ;Stops TIMER1 H'FF' MOVWF INDF0 ;Puts FF to temp ERROR_RETH,0 ;as error value Side 27

53 PMUcode.txt MOVWF TOSH ERROR_RETL,0 MOVWF TOSL CLRF TOSU LOAD_TMR READ_TABLE ;Get value from table MOVWF TMR0H INCF T0VALUE,1 INCF T0VALUE,1 READ_TABLE ;Get value from table MOVWF TMR0L INCF MEM,1 INCF T0VALUE,1 INCF T0VALUE,1 RETFIE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Interrupt routine Timer0 ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Read table is returning a value from the address;;;; ;; in the table that T0value is pointing at ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_TABLE CLRF PCLATH T0VALUE,0 MOVWF PCL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of READ LIMIT ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Convert is converting a byte to BCD values ;;;; ;; The byte must be stored as CONT and the ;;;; ;; converted values will be returned as ;;;; ;; CONHH for hundreds, CONH for tens and ;;;; ;; CONL for one values ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CONVERT CLRF CONTH ;Resets high byte CLRF CONHH ;Clears 100:s CLRF CONH ;Clears 10:s CLRF CONL ;Clears 1:s HUNDRA D'100' ;Counts hundreds SUBWF CONT,0 BTFSS STATUS,C GOTO HCONTH MOVWF CONT Side 28

54 PMUcode.txt INCF CONHH GOTO HUNDRA HCONTH MOVWF TEMP D'1' SUBWF CONTH,0 BTFSS STATUS,C GOTO TIOTAL MOVWF CONTH TEMP,0 MOVWF CONT INCF CONHH,1 GOTO HUNDRA TIOTAL ;Counts 10s D'10' SUBWF CONT,0 BTFSS STATUS,C GOTO ENTAL MOVWF CONT INCF CONH GOTO TIOTAL ENTAL ;Counts 1s CONT,0 MOVWF CONL JUSTERA ;Adjust values D'10' SUBWF CONHH,0 BTFSS STATUS,C RETURN MOVWF CONHH INCF CONHHH GOTO JUSTERA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of convert routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; END Side 29

55 text.txt ORG TMR0_VALUES ;Table for Timer0 values H'F4' H'48' H'E8' H'90' H'D5' H'3A' H'AA' H'74' H'58' H'D0' ORG LIMITS ;Tabel with limits D'000' ;I_mag min D'133' ;I_mag max 133 D'000' ;I_in min D'102' ;I_in max D'000' ;I_out min D'153' ;I_out max 153 D'000' ;I_dd min D'92' ;I_dd max 92 D'000' ;I_uhf min D'102' ;I_uhf max 102 D'000' ;I_s min D'92' ;I_s max 92 D'000' ;I_vhf min D'27' ;I_vhf max 27 D'000' ;I_ais min D'92' ;I_ais max 92 D'000' ;I_sun min D'204' ;I_sun max D'000' ;I_PAUHF MIN D'46' ;I_PAUHF MAX 46 D'168' ;U_bat min D'214' ;U_bat max D'158' ;U_dd min D'179' ;U_dd max D'115' ;U_s min D'255' ;U_s max D'140' ;U_mag min 140 D'255' ;U_mag max D'158' ;U_ais min 158 D'255' ;U_ais max D'158' ;U_uhf min 158 D'255' ;U_uhf max D'158' ;U_vhf min 158 D'179' ;U_vhf max D'51' ;U_sol min D'255' ;U_sol max H'62' ;T_bat min +10 Side 1

56 text.txt D'112' ;T_bat max +50 H'19' ;T_adcs min -20 H'96' ;T_adcs max +80 H'19' ;T_ais min -20 H'96' ;T_ais max +80 H'19' ;T_tnc min -20 H'96' ;T_tnc max +80 H'19' ;T_uhf min -20 H'96' ;T_uhf max +80 H'19' ;T_s min -20 H'96' ;T_s max +80 H'19' ;T_a min -20 H'96' ;T_a max +80 H'19' ;T_b min -20 H'96' ;T_b max +80 H'19' ;T_s min -20 H'96' ;T_s max +80 H'19' ;T_a min -20 H'96' ;T_a max +80 H'19' ;T_b min -20 H'96' ;T_b max +80 H'19' ;T_c min -20 H'96' ;T_c max +80 H'19' ;T_d min -20 H'96' ;T_d max +80 H'19' ;T_z min -20 H'96' ;T_z max +80 Side 2

57 #INCLUDE EQUN.ASM #INCLUDE TEXT.ASM #INCLUDE COMANDS.ASM #INCLUDE P18F442.INC tnc.txt ORG GOTO ORG GOTO ORG GOTO RES_V START INT_H I2C_INTERUPT INT_L TIMER0_INTERUPT ORG START_ADR START ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Initsialation of memories, register ;;;;; ;and display ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; B' ' MOVWF INTCON B' ' MOVWF INTCON2 CLRF INTCON3 CLRF ADCON0 B' ' MOVWF ADCON1 B' ' MOVWF T0CON B' ' MOVWF T1CON H'01' MOVWF FSR1H CLRF FSR1L CLRF BSR CLRF PIR1 CLRF PIR2 B' ' MOVWF PIE1 CLRF PIE2 CLRF IPR2 B' ' MOVWF RCON B' ' MOVWF SSPSTAT B' ' MOVWF SSPCON1 B' ' MOVWF SSPCON2 B' ' MOVWF TRISC CLRF TRISD ;SETS PORTD TO OUTPUTS Side 1

58 tnc.txt CLRF PORTD CLRF TRISE ;SETS PORTE TO OUTPUTS CLRF PORTE SETF TRISA ;SETS PORTA TO INPUTS B' ' MOVWF TRISB ;SETS PORTB AS IN/OUT-PUTS CLRF PORTB CLRF MEM CLRF COMAND ADR_TNC MOVWF SSPADD ;ADDRESS TO PMU ;;;;;;;;;;;;;;;;;Initsiering av display;;;;;;;;;;;;;;;;;;;;;;;;; H'10' DELAY B' ' ADRES ;Puls to display B' ' ;SETS TWO rows on display ADRES CLEAR_DISP ;CLEARS DISPLAY ;;;;;;;;;;;;;;;;;; Display initsiering slut;;;;;;;;;;;;;;;;;;;;; B' ' ;ENABLE I2C INTERUPT MOVWF IPR1 A'T' ;Writes "TIME HH:MM" to display SKRIV_CHAR A'i' SKRIV_CHAR A'm' SKRIV_CHAR A'e' SKRIV_CHAR A' ' SKRIV_CHAR A'H' SKRIV_CHAR A'H' SKRIV_CHAR A':' SKRIV_CHAR A'M' SKRIV_CHAR A'M' SKRIV_CHAR D'12' MOVWF HOUR ;Presets hour to 12 CLRF MIN ;Clears minutes CLRF SEC Side 2

59 tnc.txt TIME_SET_HOUR ;Seting hours PRINT_TIME ;Print the current time to display D'150' DELAY BTFSC PORTB,4 GOTO TIME_SET_MIN BCF STATUS,C BTFSC PORTB,5 INCF HOUR,1 D'23' BSF STATUS,C BTFSC PORTB,3 DECF HOUR,1 BTFSS STATUS,C MOVWF HOUR D'24' CPFSLT HOUR CLRF HOUR GOTO TIME_SET_HOUR TIME_SET_MIN BTFSC GOTO BCF BTFSC INCF BSF BTFSC DECF BTFSS MOVWF CPFSLT CLRF GOTO PRINT_TIME D'150' DELAY PORTB,4 MAIN_STEP STATUS,C PORTB,5 MIN,1 STATUS,C D'59' PORTB,3 MIN,1 STATUS,C MIN D'60' MIN MIN TIME_SET_MIN ;Seting minutes MAIN_STEP BTFSS PORTB,4 GOTO MAIN_STEP TIME_SEND CLEAR_MEM H'F8' MOVWF TMR0H H'62' MOVWF TMR0L BSF INTCON,5 ;ENABLE TIMER0 INTERUPT BSF T0CON,7 ;Starts Timer 0 Side 3

60 tnc.txt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Main rutin startar här;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN PRINT_TIME D'32' MOVWF I2Cdata KNAPP PRINT_TIME ;Print time to display PRINT_DISP ;Print comand on display D'10' DELAY BTFSC PORTB,3 ;Check if buttom 1 is down DECF I2Cdata,1 ;Steps down comando BTFSC PORTB,4 ;Check if buttom 2 is down GOTO KNAPP2 BTFSC PORTB,5 ;Check if buttom 3 is down INCF I2Cdata,1 ;Steps upp comando D'40' CPFSGT I2Cdata GOTO KNAPP_CH D'31' MOVWF I2Cdata KNAPP_CH D'31' CPFSLT I2Cdata GOTO KNAPP D'40' MOVWF I2Cdata GOTO KNAPP KNAPP2 SENDD CPFSEQ GOTO GOTO GOTO D'31' I2Cdata SENDD SHOW_LOGG MAIN ALT_I2C MAIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End Of Main ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Side 4

61 tnc.txt ;; SHOW LOG is a routine that prints the ;;; ;; recived values on the display ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PRINT_STOPP SUBLW BTFSC RETURN GOTO PREINC1,0 H'FE' STATUS,Z POSTDEC1,0 RET_STOP SHOW_LOGG CLRF MOVWF CLRF LOGG_LOOP SUBLW BTFSC GOTO RET_STOP CLRF MOVWF MOVWF VARV H'80' FSR1L FSR1H INDF1,0 H'FE' STATUS,Z PRINT_STOPP TBLPTRU PRES_STARTL TBLPTRL PRES_STARTH TBLPTRH PRINT_H dispaly MOVWF H'80' ADRES A'T' SKRIV_CHAR A'i' SKRIV_CHAR A'm' SKRIV_CHAR A'e' SKRIV_CHAR VARV,0 CONT CONVERT CONHH,0 SKRIV_DIGIT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT ;Print recived time to Side 5

62 tnc.txt POSTINC1,0 POSTINC1,0 SKRIV_CHAR POSTINC1,0 SKRIV_CHAR A':' SKRIV_CHAR POSTINC1,0 POSTINC1,0 SKRIV_CHAR POSTINC1,0 SKRIV_CHAR H'FF' DELAY PRINT_I ;Print Recived currents to display D'10' MOVWF TTMP,0 PRINT_I_LOOP H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'80' ADRES A'I' SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR VARV,0,0 MOVWF CONT CONVERT CONHH,0,0 SKRIV_DIGIT CONH,0,0 SKRIV_DIGIT CONL,0,0 SKRIV_DIGIT Side 6

63 tnc.txt A' ' SKRIV_CHAR POSTINC1,0 SKRIV_CHAR POSTINC1,0 SKRIV_CHAR POSTINC1,0 SKRIV_CHAR PRINT_SPACE PRINT_SPACE DECFSZ TTMP,1,0 GOTO PRINT_I_LOOP PRINT_V Prints recived Voltages to display D'8' MOVWF TTMP PRINT_V_LOOP H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'80' ADRES A'V' SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR VARV,0 MOVWF CONT CONVERT CONHH,0 SKRIV_DIGIT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT A' ' SKRIV_CHAR POSTINC1,0 Side 7

64 tnc.txt SKRIV_CHAR POSTINC1,0 SKRIV_CHAR POSTINC1,0 SKRIV_CHAR DECFSZ TTMP,1 GOTO PRINT_V_LOOP PRINT_T ;Prints recived Temperatures to display D'11' MOVWF TTMP PRINT_T_LOOP H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'80' ADRES A'T' SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR TBLRD*+ TABLAT,0 SKRIV_CHAR VARV,0 MOVWF CONT CONVERT CONHH,0 SKRIV_DIGIT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT A' ' SKRIV_CHAR POSTINC1,0,0 SKRIV_CHAR POSTINC1,0,0 SKRIV_CHAR POSTINC1,0,0 SKRIV_CHAR Side 8

65 DECFSZ GOTO MOVWF INCF GOTO TTMP,1 PRINT_T_LOOP H'80' ADRES A'E' SKRIV_CHAR PRINT_SPACE ERRORS,0 CONT CONVERT CONHH,0 SKRIV_DIGIT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT VARV,1 H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY H'FF' DELAY LOGG_LOOP tnc.txt SPACERS LOOPS MOVWF DECFSZ GOTO RETURN D'12' TEMP A' ' SKRIV_CHAR TEMP,1 LOOPS ;Prints a number of spaces ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;; ;; Print Disp prints out the present comando value to the display ;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;; PRINT_DISP H'80' Side 9

66 tnc.txt ADRES D'31' CPFSEQ I2Cdata GOTO NEXT1 GOTO PRINT_PRINT NEXT1 CMD_STATUS_DATA CPFSEQ I2Cdata GOTO NEXT2 GOTO PRINT_STAUS NEXT2 CMD_LOGG_DATA CPFSEQ I2Cdata GOTO NEXT3 GOTO PRINT_LOGG NEXT3 CMD_AIS_ON CPFSEQ I2Cdata GOTO NEXT4 GOTO PRINT_AIS_ON NEXT4 CMD_AIS_OFF CPFSEQ I2Cdata GOTO NEXT5 GOTO PRINT_AIS_OFF NEXT5 CMD_MAG_ON CPFSEQ I2Cdata GOTO NEXT6 GOTO PRINT_MAG_ON NEXT6 CMD_MAG_OFF CPFSEQ I2Cdata GOTO NEXT7 GOTO PRINT_MAG_OFF NEXT7 CMD_SBAND_ON CPFSEQ I2Cdata GOTO NEXT8 GOTO PRINT_SBAND_ON NEXT8 CMD_SBAND_OFF CPFSEQ I2Cdata GOTO NEXT9 GOTO PRINT_SBAND_OFF NEXT9 CMD_RESET CPFSEQ I2Cdata GOTO NEXT10 GOTO PRINT_RESET NEXT10 CMD_PAUSE Side 10

67 tnc.txt CPFSEQ I2Cdata GOTO NEXT11 GOTO PRINT_PAUSE NEXT11 CMD_RESUME CPFSEQ I2Cdata GOTO NEXT12 GOTO PRINT_RESUME NEXT12 RETURN PRINT_PRINT PRINTT PRINT SPACERS RETURN PRINT_STAUS SEND PRINT STATUSS PRINT SPACERS RETURN PRINT_LOGG SEND PRINT A'L' SKRIV_CHAR A'o' SKRIV_CHAR A'g' SKRIV_CHAR A'g' SKRIV_CHAR SPACERS RETURN PRINT_AIS_ON SEND PRINT AIS_ON PRINT SPACERS RETURN PRINT_AIS_OFF SEND PRINT AIS_OFF PRINT SPACERS Side 11

68 tnc.txt RETURN PRINT_MAG_ON SEND PRINT MAG_ON PRINT SPACERS RETURN PRINT_MAG_OFF SEND PRINT MAG_OFF PRINT RETURN PRINT_SBAND_ON SEND PRINT SBAND_ON PRINT SPACERS RETURN PRINT_SBAND_OFF SEND PRINT SBAND_OFF PRINT SPACERS RETURN PRINT_RESET RESETT PRINT SPACERS RETURN PRINT_PAUSE SEND PRINT PAUSE PRINT SPACERS RETURN PRINT_RESUME SEND PRINT RESUME PRINT Side 12

69 RETURN SPACERS tnc.txt CLEAR_MEM MOVWF CLRF MEM_LOOP MOVWF SUBLW BTFSS GOTO MOVWF CLRF RETURN H'80' FSR0L FSR0H H'FE' POSTINC0 FSR0H,0 H'06' STATUS,Z MEM_LOOP H'80' FSR0L FSR0H ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ALT_I2C sends data to the I2C Bus ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALT_I2C BCF INTCON,7 ADR_PMU MOVWF I2Cbyte I2C_STARTS I2Cdata,0 MOVWF I2Cbyte SEND_BYTE I2C_STOPS BSF INTCON,7 RETURN TIME_SEND BCF MOVWF MOVWF MOVWF MOVWF INTCON,7 H'00' I2Cbyte I2C_STARTS CLK_COMAND I2Cbyte SEND_BYTE d'02' I2Cbyte SEND_BYTE HOUR,0 I2Cbyte SEND_BYTE MIN,0 Side 13

70 MOVWF BSF RETURN I2Cbyte SEND_BYTE I2C_STOPS INTCON,7 tnc.txt I2C_STARTS BCF LATB,SCLP ;CLK LOW WHEN OUTPUT BCF LATB,SDAP ;DATA LOW WHEN OUTPUT BCF PORTB,SCLP BCF PORTB,SDAP BSF TRISB,SDAP BSF TRISB,SCLP NOP NOP NOP NOP BCF TRISB,SDAP ;START BCF TRISB,SCLP BCF PORTB,SCLP SEND_BYTE BCF BCF BCF RLCF BTFSC BSF TRISB,SDAP PORTB,SDAP STATUS,C I2Cbyte,1 STATUS,C TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE1 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE2 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE3 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C Side 14

71 BSF TRISB,SDAP tnc.txt BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE4 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE5 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE6 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP BCF STATUS,C RLCF I2Cbyte,1 ;BYTE7 BCF TRISB,SCLP BCF TRISB,SDAP BTFSC STATUS,C BSF TRISB,SDAP BSF TRISB,SCLP ;BYTE8 NOP NOP BCF TRISB,SCLP BCF PORTB,SCLP BSF TRISB,SDAP ;RELEASE DATA BSF TRISB,SCLP BTFSC PORTB,SDAP ;check ack GOTO ERR_I2C BCF TRISB,SCLP RETURN I2C_STOPS BCF BCF BSF NOP TRISB,SDAP PORTB,SDAP TRISB,SCLP Side 15

72 NOP BSF NOP NOP RETURN TRISB,SDAP tnc.txt ERR_I2C BCF BCF NOP NOP BSF BSF MOVWF I2C_ERR_WAIT DECFSZ GOTO RESET TRISB,SCLP PORTB,SCLP TRISB,SCLP CLEAR_DISP TRISB,SDAP A'E' SKRIV_CHAR A'R' SKRIV_CHAR A'R' SKRIV_CHAR A'O' SKRIV_CHAR A'R' SKRIV_CHAR D'22' MEM H'FF' DELAY MEM,1 I2C_ERR_WAIT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Send From I2C rutine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Delay sub routine is a delay routine that ;;;; ;; the input value in ms ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DELAY MOVWF DELAY2 ;FLYTTAR TALET I ACC TILL DELAY2 D'165' ;LÄGGER TALET 2FH I ACC MOVWF DELAY1 ;FLYTTAR ACC TILL DELAY1 LOOP1 DECFSZ DELAY1,1 ;MINSKA DELAY1 MED 1 GOTO LOOP1 ;GÅR TILL LOOP1 OM DELAY1>=1 REFIL D'165' ;FLYTTAR TALET 2FH TILL ACC MOVWF DELAY1 ;LÄGGER ACC I DELAY1 DECFSZ DELAY2 ;MINSKAR DELAY2 MED 1 GOTO LOOP1 ;GÅR TILL LOOP1 OM DELAY2>=1 Side 16

73 tnc.txt RETURN ;ÅTERGÅR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Delay routine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; I2C interupt routine reads an byte recived ;;;; ;; on the I2C bus, and store it in I2C memory ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I2C_INTERUPT BCF PIR1,3 ;NOLLAR INTERUPT FLAGGA BCF SSPCON1,6,0 BTFSS SSPSTAT,5,0 ;data/adress? GOTO I2C_DATAR SSPBUF,0,0 MOVWF POSTINC0,0 RETFIE I2C_DATAR BTFSC RETFIE SSPBUF,0,0 SSPBUF,0,0 RESET_I2C RESET_I2C RESET ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of I"C interupt rutine ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Timer 0 keeps the time in the emulator ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TIMER0_INTERUPT BCF INTCON,2 ;Clear interupt H'F8' MOVWF TMR0H H'61' MOVWF TMR0L INCF SEC,1 D'59' CPFSGT SEC GOTO RET_INT CLRF SEC INCF MIN,1 D'59' CPFSGT MIN GOTO RET_INT CLRF MIN Side 17

74 INCF CPFSGT GOTO CLRF HOUR,1 D'23' HOUR RET_INT HOUR tnc.txt RET_INT BTFSC RETFIE SEC,1 STATUS,Z TIME_SEND ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of Interupt routine Timer0 ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Read table is returning a value from the adres ;;;; ;; in the tabel that T0value is pointing at ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; READ_TABLE CLRF PCLATH T0VALUE,0 MOVWF PCL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of READ_LIMIT ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;Display rutiner;;;;;;;;;;;;;;;;;;;;;;; PRINT_TIME H'E0' ADRES HOUR,0 MOVWF CONT CONVERT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT A':' SKRIV_CHAR MIN,0 MOVWF CONT CONVERT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT A':' SKRIV_CHAR SEC,0 MOVWF CONT Side 18

75 tnc.txt CONVERT CONH,0 SKRIV_DIGIT CONL,0 SKRIV_DIGIT RETURN DISPLAY ;GOTO PRINT_UI ;GOTO PRINT_TEMPERATUR DISP_ADR,0 ADRES I2Cdata,0 MOVWF CONT CONVERT CONHH,0 ADDLW H'30' SKRIV_CHAR CONH,0 ADDLW H'30' SKRIV_CHAR CONL,0 ADDLW H'30' SKRIV_CHAR RETURN PRINT_TEMPERATUR H'80' ADRES A'T' SKRIV_CHAR A'e' SKRIV_CHAR A'm' SKRIV_CHAR A'p' SKRIV_CHAR TEMPS1 PRINT H'51' ;;;;SKA VA 51 MOVWF FSR2L CLRF FSR2H TEMP_LOOP INDF2,0 SUBLW H'FF' BZ ERRORP INDF2,0 SUBLW D'50' BN PLUS MINUS INDF2,0 Side 19

76 tnc.txt SUBLW D'50' MOVWF INDF2 MOVWF TEMPT MINL D'4' SUBWF TEMPT,1 BN MINEND DECF INDF2,1 GOTO MINL MINEND INDF2,0 MOVWF CONT CONVERT H'FD' MOVWF CONHH GOTO BCD PLUS D'50' SUBWF INDF2,1 INDF2,0 MOVWF TEMPT PLUL D'4' SUBWF TEMPT,1 BN PLUEND DECF INDF2,1 GOTO PLUL PLUEND INDF2,0 MOVWF CONT CONVERT H'FB' MOVWF CONHH GOTO BCD ERRORP H'15' MOVWF CONHH H'42' MOVWF CONH H'42' MOVWF CONL BCD PRINT_CONV INCF FSR2L,1 FSR2L,0 SUBLW H'5B' BTFSS STATUS,C RETURN FSR2L,0 SUBLW H'57' BTFSC STATUS,Z Side 20

77 tnc.txt NEW_LINE GOTO TEMP_LOOP PRINT_UI H'80' ADRES A'I' SKRIV_CHAR A'&' SKRIV_CHAR A'U' SKRIV_CHAR TEMPS1 PRINT H'40' MOVWF FSR2L CLRF FSR2H DISP_LOOP INDF2,0 MOVWF CONT CONVERT PRINT_CONV INCF FSR2L,1 FSR2L,0 SUBLW H'50' BTFSS STATUS,C RETURN SUBLW H'46' BTFSC STATUS,Z NEW_LINE GOTO DISP_LOOP PRINT MOVWF TABELL PRINT_LOOP ANROPA_TABELL ADDLW H'0' BTFSC STATUS,Z RETURN SKRIV_CHAR INCF TABELL,1 INCF TABELL,1 GOTO PRINT_LOOP ANROPA_TABELL TABELL,0 MOVWF PCL SKRIV_DIGIT Side 21

78 tnc.txt ADDLW H'30' SKRIV_CHAR BSF PORTE,1 ;SETS BIT1 PORTA=1 (RS) MOVWF PORTD ;SETS W TO PORTd PULS H'10' DELAY RETURN PULS BSF PORTE,0 ;SETS E HÖG H'08' DELAY ;WAIT FOR 3 ms BCF PORTE,0 ;SETS E LOW H'08' DELAY RETURN PRINT_SPACE RETURN H'FE' SKRIV_CHAR CLEAR_DISP H'01' ;SETS DISPLAY COMMANDO GOTO ADRES NEW_LINE H'C0' ADRES MOVWF ADRESS ;SAVE W TO ADRESS CLRF PORTE ;CLEARS PORT E ADRESS,0 ;MOVES ADRESS TO W MOVWF PORTD ;MOVES W TO PORTB H'05' ;WAIT DELAY ;5mS PULS ;SEND A PULSE H'05' ;WAIT DELAY ;5mS RETURN CONVERT CLRF CONHH ;Clears 100:s CLRF CONH ;Clears 10:s CLRF CONL ;Clears 1:s HUNDRA D'100' ;Counts hundreds SUBWF CONT,0 BTFSS STATUS,C GOTO TIOTAL MOVWF CONT Side 22

79 INCF GOTO CONHH HUNDRA tnc.txt TIOTAL ENTAL SUBWF BTFSS GOTO MOVWF INCF GOTO MOVWF RETURN D'10' CONT,0 STATUS,C ENTAL CONT CONH TIOTAL CONT,0 CONL ;Counts 10s ;Counts 1s PRINT_CONV display ADDLW ADDLW ADDLW RETURN END CONHH,0 H'30' SKRIV_CHAR CONH,0 H'30' SKRIV_CHAR CONL,0 H'30' SKRIV_CHAR ;Prints a converted value to the Side 23

80 text_tnc.txt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Tables with ASCII signs ;;; ;; for writing on dislpay ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ORG ORG ORG ORG ORG PRINTT A'P' A'r' A'i' A'n' A't' A' ' A'L' A'o' A'g' A'g' H'00' SEND A'S' A'e' A'n' A'd' A' ' H'00' STATUSS A'S' A't' A'a' A't' A'u' A's' H'00' AIS_ON A'A' A'I' A'S' A' ' A'O' A'n' H'00' AIS_OFF A'A' A'I' A'S' A' ' A'O' A'F' Side 1

81 text_tnc.txt A'F' H'00' ORG MAG_ON A'M' A'a' A'g' A'n' A'e' A't' A'o' A'm' A'e' A't' A'e' A'r' A' ' A'O' A'n' H'00' ORG MAG_OFF A'M' A'a' A'g' A'n' A'e' A't' A'o' A'm' A'e' A't' A'e' A'r' A' ' A'O' A'f' A'f' H'00' ORG SBAND_ON A'S' A'-' A'B' A'a' A'n' A'd' A' ' A'O' A'n' H'00' Side 2

82 text_tnc.txt ORG SBAND_OFF A'S' A'-' A'B' A'a' A'n' A'd' A' ' A'O' A'f' A'f' H'00' ORG RESETT A'R' A'e' A's' A'e' A't' A' ' A'P' A'M' A'U' H'00' ORG PAUSE A'P' A'a' A'u' A's' A'e' H'00' ORG RESUME A'R' A'e' A's' A'u' A'm' A'e' H'00' ORG TEXT_LIST DW H'4D4D' DW H'6E49' DW H'7455' DW H'6464' DW H'6855' DW H'6253' DW H'6856' DW H'5341' DW H'4353' Side 3

83 DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW DW H'4150' H'7442' H'6464' H'6253' H'4D4D' H'4941' H'5855' H'5856' H'4353' H'7442' H'4441' H'4941' H'4E54' H'6855' H'5253' H'4341' H'4342' H'4343' H'4344' H'435A' text_tnc.txt Side 4

84 equn.txt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Sets different memory loacation to ;;; ;; specified names and names some vaues ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RES_V EQU H'0' INT_H EQU H'8' INT_L EQU h'18' DIGPT EQU H'4' STATUS_PTR_SAVE EQU H'0A' ;Pointer for status I2Cbyte EQU H'10' ;Byte that will be sent on I2C I2C_ERROR EQU H'1A' ;Error flags for I2C OLD_TIMEH EQU H'1B' ;Saved log time high byte OLD_TIMEL EQU H'1C' ;Saved log time low byte FLAG EQU H'1D' ;Generall flaggs TEMP2 EQU H'1E' ;Temporary memory ; EQU H'1F' DELAY1 EQU H'20' ;Memory for delay loop DELAY2 EQU H'21' ;Momory for delay loop CONH EQU H'22' ;Byte for BCD 10 CONL EQU H'23' ;Byte for BCD 1 CONT EQU H'24' ;Byte for BCD input value CONHH EQU H'25' ;Byte for BCD 100s SUBSYSTEMS EQU H'26' ;Bits telling which subsytem that is turned on ; EQU H'27' TABELL EQU H'28' ;Byte for address when reading from FLASH SENSOR EQU H'29' ;Number of sensor that is read MEM EQU H'2A' ;Temporary memory TEMPT EQU H'2B' ;Temporary memory LAST_HOUR EQU H'2C' ;Memory space for saving hours LAST_MIN EQU H'2D' ;Memory space for saving minutes ; EQU H'2E' ; EQU H'2F' ; EQU H'30' TEMP EQU H'31' ;Temporary memory LIMIT_POINTER EQU H'32' ;Pointer for sensor limits ; EQU H'33' T0VALUE EQU H'34' ;Value for Timer0 ERROR_RETL EQU H'35' ;Error return address low byte ERROR_RETH EQU H'36' ;Error return address high byte I2C_POINTER EQU H'37' ;Pointer for I2C ; EQU H'38' ; EQU H'39' Side 1

85 equn.txt ; EQU H'3A' I2C_REC_ADR EQU H'3B' ;Recived address COMAND EQU H'3C' ;Recived command I2C_BYTE_NR EQU H'3D' ;Number og bytes to be recived HOUR EQU H'3E' ;Recived hour MIN EQU H'3F' ;Recived minutes IMAG EQU H'40' ;Magnetometer current IIN EQU H'41' ;Battery Input current IUT EQU H'42' ;Battery Output current IDD EQU H'43' ;Vdd Current IUHF EQU H'44' ;UHF current IS EQU H'45' ;S-band trensmitter current IVHF EQU H'46' ;VHF current IAIS EQU H'47' ;AIS current ISOL EQU H'48' ;Current from solar cells IPAUHF equ h'49' ;Curent to UHF Power amplyfier VBAT EQU H'4A' ;Battery voltage VDD EQU H'4B' ;Voltage on Vdd VS EQU H'4C' ;S-Band voltage VMAG EQU H'4D' ;Voltage to magnetometer VAIS EQU H'4E' ;Voltage to AIS VUHF EQU H'4F' ;Voltage to UHF VVHF EQU H'50' ;Voltage to VHF VSOL EQU H'51' ;Solar cells volatge TBAT EQU H'52' ;Temperature on Batteries TADCS EQU H'53' ;Temperature on ADCS TAIS EQU H'54' ;Temperature on AIS TTNC EQU H'55' ;Temperature on TNC TUHF EQU H'56' ;Temperature on UHF TS EQU H'57' ;Temperature on S-band TA EQU H'58' ;Temperature on Solar cells A-side TB EQU H'59' ;Temperature on solar cells B-side TC EQU H'5A' ;Temperature on soalr cells C-side TD EQU H'5B' ;Temperature on solar cells D-side TZ EQU H'5C' ;Temperature on solar cells Nadir-side ERRORS EQU H'5D' ;Error byte TEMPS1 EQU H'60' ;Defines address to Tables Side 2

86 equn.txt LIMITS equ H'8C' ; TMR0_VALUES EQU H'20' ; START_ADR EQU H'140' ;Address where the program begins RETADR1 EQU H'130' ;Return address for Temp routine RETADR2 EQU H'134' RETADRI2C EQU H'138' START_LOGG_ADRL EQU H'00' ;Flash logg start adres START_LOGG_ADRH EQU H'20' ;h2000 STOP_LOGG_ADRL EQU H'20' ;Flash Logg stop adres STOP_LOGG_ADRH EQU H'33' ;h3320 EE_STARTH EQU H'00' ;Memory location for pointers in EEPROM EE_STARTL EQU H'01' EE_STOPH EQU H'02' EE_STOPL EQU H'03' EE_tempL EQU H'04' EE_tempH EQU H'05' ;I2C SCLP EQU D'7' ;SCLP pin = pin7 SDAP EQU D'6' ;SDAP pin = pin6 b_dir EQU D'0' ;b_dir=0 I2CTemp EQU D'1' ;Defines byte for I2CTemp I2Cdata EQU D'0' ;Defines byte for I2Cdata Side 3

87 comands.txt ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Commandos and addresses that can be sent on the I2C bus ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CMD_STATUS_DATA EQU D'32' CMD_LOGG_DATA EQU D'33' CMD_AIS_ON EQU D'34' CMD_AIS_OFF EQU D'35' CMD_MAG_ON EQU D'36' CMD_MAG_OFF EQU D'37' CMD_SBAND_ON EQU D'38' CMD_SBAND_OFF EQU D'39' CMD_RESET EQU D'40' CMD_PAUSE EQU D'192' CMD_RESUME EQU D'193' CLK_COMAND EQU D'194' ADR_TNC EQU H'78' ;Address to TNC ADR_PMU EQU H'72' ;Address to PMU FULL_LOGG EQU D'8' VB_digpt EQU D'128' ;Battery voltage level for digipeat to be turned on VS_digpt EQU D'112' ;Solar cells voltage for digipeat to be turned on Side 1

88 P18F452.txt LIST ; P18F452.INC Standard Header File, Version 1.1 Microchip Technology, Inc. NOLIST ; This header file defines configurations, registers, and other useful bits of ; information for the PIC18F452 microcontroller. These names are taken to match ; the data sheets as closely as possible. ; Note that the processor must be selected before this file is ; included. The processor may be selected the following ways: ; 1. Command line switch: ; C:\ MPASM MYFILE.ASM /PIC18F452 ; 2. LIST directive in the source file ; LIST P=PIC18F452 ; 3. Processor Type entry in the MPASM full-screen interface ; 4. Setting the processor in the MPLAB Project Dialog ;================================================================= ========= ; ; Revision History ; ;================================================================= ========= ;Rev: Date: Details: Who: ;1.0 03/23/01 Modified C452 for F452 tr ;1.1 08/01/01 Added EECON1 bits, corrected code protect config bit inserts ;1.2 09/17/01 Corrected MAXRAM,BADRAM tr ;1.3 10/23/01 Corrected CONFIG bits/registers tr/pas ;================================================================= ========= ; ; Verify Processor ; ;================================================================= ========= IFNDEF 18F452 processor." ENDIF MESSG "Processor-header file mismatch. Verify selected ;================================================================= Side 1

89 P18F452.txt ========= ; 18Fxxx Family EQUates ;================================================================= ========= FSR0 EQU 0 FSR1 EQU 1 FSR2 EQU 2 FAST EQU 1 W EQU 0 A EQU 0 ACCESS EQU 0 BANKED EQU 1 ;================================================================= ========= ;================================================================= ========= ; 16Cxxx/17Cxxx Substitutions ;================================================================= ========= #define clrw clrf WREG ; PIC16Cxxx code substitution (WREG is addressable) #define CLRW CLRF WREG ; PIC16Cxxx code substitution (WREG is addressable) #define negw negf WREG ; PIC16Cxxx code substitution (WREG is addressable) #define NEGW NEGF WREG ; PIC16Cxxx code substitution (WREG is addressable) #define movpf movff ; PIC17Cxxx code substitution #define MOVPF F ; PIC17Cxxx code substitution #define movfp movff ; PIC17Cxxx code substitution #define P F ; PIC17Cxxx code substitution #define lcall call ; PIC17Cxxx code substitution #define L ; PIC17Cxxx code substitution #define lgoto goto ; PIC17Cxxx code substitution #define LGOTO GOTO ; PIC17Cxxx code substitution #define DDRA TRISA ; PIC17Cxxx SFR substitution #define DDRB TRISB ; PIC17Cxxx SFR substitution #define DDRC TRISC ; PIC17Cxxx SFR substitution #define DDRD TRISD ; PIC17Cxxx SFR substitution #define DDRE TRISE ; PIC17Cxxx SFR substitution ;================================================================= ========= ; ; Register Definitions ; ;================================================================= ========= Side 2

90 P18F452.txt ;----- Register Files TOSU EQU H'0FFF' TOSH EQU H'0FFE' TOSL EQU H'0FFD' STKPTR EQU H'0FFC' PCLATU EQU H'0FFB' PCLATH EQU H'0FFA' PCL EQU H'0FF9' TBLPTRU EQU H'0FF8' TBLPTRH EQU H'0FF7' TBLPTRL EQU H'0FF6' TABLAT EQU H'0FF5' PRODH EQU H'0FF4' PRODL EQU H'0FF3' INTCON EQU H'0FF2' INTCON1 EQU H'0FF2' INTCON2 EQU H'0FF1' INTCON3 EQU H'0FF0' INDF0 EQU H'0FEF' POSTINC0 EQU H'0FEE' POSTDEC0 EQU H'0FED' PREINC0 EQU H'0FEC' PLUSW0 EQU H'0FEB' FSR0H EQU H'0FEA' FSR0L EQU H'0FE9' WREG EQU H'0FE8' INDF1 EQU H'0FE7' POSTINC1 EQU H'0FE6' POSTDEC1 EQU H'0FE5' PREINC1 EQU H'0FE4' PLUSW1 EQU H'0FE3' FSR1H EQU H'0FE2' FSR1L EQU H'0FE1' BSR EQU H'0FE0' INDF2 EQU H'0FDF' POSTINC2 EQU H'0FDE' POSTDEC2 EQU H'0FDD' PREINC2 EQU H'0FDC' PLUSW2 EQU H'0FDB' FSR2H EQU H'0FDA' FSR2L EQU H'0FD9' STATUS EQU H'0FD8' TMR0H EQU H'0FD7' TMR0L EQU H'0FD6' T0CON EQU H'0FD5' Side 3

91 ;RESERVED_0FD4 EQU H'0FD4' OSCCON EQU H'0FD3' LVDCON EQU H'0FD2' WDTCON EQU H'0FD1' RCON EQU H'0FD0' TMR1H EQU H'0FCF' TMR1L EQU H'0FCE' T1CON EQU H'0FCD' TMR2 EQU H'0FCC' PR2 EQU H'0FCB' T2CON EQU H'0FCA' SSPBUF EQU H'0FC9' SSPADD EQU H'0FC8' SSPSTAT EQU H'0FC7' SSPCON1 EQU H'0FC6' SSPCON2 EQU H'0FC5' ADRESH EQU H'0FC4' ADRESL EQU H'0FC3' ADCON0 EQU H'0FC2' ADCON1 EQU H'0FC1' ;RESERVED_0FC0 EQU H'0FC0' CCPR1H EQU H'0FBF' CCPR1L EQU H'0FBE' CCP1CON EQU H'0FBD' CCPR2H EQU H'0FBC' CCPR2L EQU H'0FBB' CCP2CON EQU H'0FBA' ;RESERVED_0FB9 EQU H'0FB9' ;RESERVED_0FB8 EQU H'0FB8' ;RESERVED_0FB7 EQU H'0FB7' ;RESERVED_0FB6 EQU H'0FB6' ;RESERVED_0FB5 EQU H'0FB5' ;RESERVED_0FB4 EQU H'0FB4' TMR3H EQU H'0FB3' TMR3L EQU H'0FB2' T3CON EQU H'0FB1' ;RESERVED_0FB0 EQU H'0FB0' P18F452.txt SPBRG EQU H'0FAF' RCREG EQU H'0FAE' TXREG EQU H'0FAD' TXSTA EQU H'0FAC' Side 4

92 P18F452.txt RCSTA EQU H'0FAB' ;RESERVED_0FAA EQU H'0FAA' EEADR EQU H'0FA9' EEDATA EQU H'0FA8' EECON2 EQU H'0FA7' EECON1 EQU H'0FA6' ;RESERVED_0FA5 EQU H'0FA5' ;RESERVED_0FA4 EQU H'0FA4' ;RESERVED_0FA3 EQU H'0FA3' IPR2 EQU H'0FA2' PIR2 EQU H'0FA1' PIE2 EQU H'0FA0' IPR1 EQU H'0F9F' PIR1 EQU H'0F9E' PIE1 EQU H'0F9D' ;RESERVED_0F9C EQU H'0F9C' ;RESERVED_0F9B EQU H'0F9B' ;RESERVED_0F9A EQU H'0F9A' ;RESERVED_0F99 EQU H'0F99' ;RESERVED_0F98 EQU H'0F98' ;RESERVED_0F97 EQU H'0F97' TRISE EQU H'0F96' TRISD EQU H'0F95' TRISC EQU H'0F94' TRISB EQU H'0F93' TRISA EQU H'0F92' ;RESERVED_0F91 EQU H'0F91' ;RESERVED_0F90 EQU H'0F90' ;RESERVED_0F8F EQU H'0F8F' ;RESERVED_0F8E EQU H'0F8E' LATE EQU H'0F8D' LATD EQU H'0F8C' LATC EQU H'0F8B' LATB EQU H'0F8A' LATA EQU H'0F89' ;RESERVED_0F88 EQU H'0F88' ;RESERVED_0F87 EQU H'0F87' ;RESERVED_0F86 EQU H'0F86' ;RESERVED_0F85 EQU H'0F85' PORTE EQU H'0F84' PORTD EQU H'0F83' PORTC EQU H'0F82' Side 5

93 P18F452.txt PORTB EQU H'0F81' PORTA EQU H'0F80' ;----- STKPTR Bits STKFUL EQU H'0007' STKUNF EQU H'0006' ;----- INTCON Bits GIE EQU H'0007' GIEH EQU H'0007' PEIE EQU H'0006' GIEL EQU H'0006' TMR0IE EQU H'0005' T0IE EQU H'0005' ; For backward compatibility INT0IE EQU H'0004' INT0E EQU H'0004' ; For backward compatibility RBIE EQU H'0003' TMR0IF EQU H'0002' T0IF EQU H'0002' ; For backward compatibility INT0IF EQU H'0001' INT0F EQU H'0001' ; For backward compatibility RBIF EQU H'0000' ;----- INTCON2 Bits NOT_RBPU EQU H'0007' RBPU EQU H'0007' INTEDG0 EQU H'0006' INTEDG1 EQU H'0005' INTEDG2 EQU H'0004' TMR0IP EQU H'0002' T0IP EQU H'0002' ; For compatibility with T0IE and T0IF RBIP EQU H'0000' ;----- INTCON3 Bits INT2IP EQU H'0007' INT1IP EQU H'0006' INT2IE EQU H'0004' INT1IE EQU H'0003' INT2IF EQU H'0001' INT1IF EQU H'0000' ;----- STATUS Bits N EQU H'0004' OV EQU H'0003' Z EQU H'0002' DC EQU H'0001' Side 6

94 P18F452.txt C EQU H'0000' ;----- T0CON Bits TMR0ON EQU H'0007' T08BIT EQU H'0006' T0CS EQU H'0005' T0SE EQU H'0004' PSA EQU H'0003' T0PS2 EQU H'0002' T0PS1 EQU H'0001' T0PS0 EQU H'0000' ;----- OSCON Bits SCS EQU H'0000' ;----- LVDCON Bits IRVST EQU H'0005' LVDEN EQU H'0004' LVDL3 EQU H'0003' LVDL2 EQU H'0002' LVDL1 EQU H'0001' LVDL0 EQU H'0000' ;----- WDTCON Bits SWDTEN EQU H'0000' ;----- RCON Bits IPEN EQU H'0007' NOT_RI EQU H'0004' RI EQU H'0004' NOT_TO EQU H'0003' TO EQU H'0003' NOT_PD EQU H'0002' PD EQU H'0002' NOT_POR EQU H'0001' POR EQU H'0001' NOT_BOR EQU H'0000' BOR EQU H'0000' ;----- T1CON Bits RD16 EQU H'0007' T1CKPS1 EQU H'0005' T1CKPS0 EQU H'0004' T1OSCEN EQU H'0003' NOT_T1SYNC EQU H'0002' T1SYNC EQU H'0002' Side 7

95 P18F452.txt T1INSYNC EQU H'0002' ; For backward compatibility TMR1CS EQU H'0001' TMR1ON EQU H'0000' ;----- T2CON Bits TOUTPS3 EQU H'0006' TOUTPS2 EQU H'0005' TOUTPS1 EQU H'0004' TOUTPS0 EQU H'0003' TMR2ON EQU H'0002' T2CKPS1 EQU H'0001' T2CKPS0 EQU H'0000' ;----- SSPSTAT Bits SMP EQU H'0007' CKE EQU H'0006' D EQU H'0005' I2C_DAT EQU H'0005' NOT_A EQU H'0005' NOT_ADDRESS EQU H'0005' D_A EQU H'0005' DATA_ADDRESS EQU H'0005' P EQU H'0004' I2C_STOP EQU H'0004' S EQU H'0003' I2C_START EQU H'0003' R EQU H'0002' I2C_READ EQU H'0002' NOT_W EQU H'0002' NOT_WRITE EQU H'0002' R_W EQU H'0002' READ_WRITE EQU H'0002' UA EQU H'0001' BF EQU H'0000' ;----- SSPCON1 Bits WCOL EQU H'0007' SSPOV EQU H'0006' SSPEN EQU H'0005' CKP EQU H'0004' SSPM3 EQU H'0003' SSPM2 EQU H'0002' SSPM1 EQU H'0001' SSPM0 EQU H'0000' ;----- SSPCON2 Bits GCEN EQU H'0007' ACKSTAT EQU H'0006' Side 8

96 P18F452.txt ACKDT EQU H'0005' ACKEN EQU H'0004' RCEN EQU H'0003' PEN EQU H'0002' RSEN EQU H'0001' SEN EQU H'0000' ;----- ADCON0 Bits ADCS1 EQU H'0007' ADCS0 EQU H'0006' CHS2 EQU H'0005' CHS1 EQU H'0004' CHS0 EQU H'0003' GO EQU H'0002' NOT_DONE EQU H'0002' DONE EQU H'0002' GO_DONE EQU H'0002' ADON EQU H'0000' ;----- ADCON1 Bits ADFM EQU H'0007' ADCS2 EQU H'0006' PCFG3 EQU H'0003' PCFG2 EQU H'0002' PCFG1 EQU H'0001' PCFG0 EQU H'0000' ;----- CCP1CON Bits DC1B1 EQU H'0005' CCP1X EQU H'0005' ; For backward compatibility DC1B0 EQU H'0004' CCP1Y EQU H'0004' ; For backward compatibility CCP1M3 EQU H'0003' CCP1M2 EQU H'0002' CCP1M1 EQU H'0001' CCP1M0 EQU H'0000' ;----- CCP2CON Bits DC2B1 EQU H'0005' CCP2X EQU H'0005' ; For backward compatibility DC2B0 EQU H'0004' CCP2Y EQU H'0004' ; For backward compatibility CCP2M3 EQU H'0003' CCP2M2 EQU H'0002' CCP2M1 EQU H'0001' CCP2M0 EQU H'0000' ;----- T3CON Bits Side 9

97 P18F452.txt RD16 EQU H'0007' T3CCP2 EQU H'0006' T3CKPS1 EQU H'0005' T3CKPS0 EQU H'0004' T3CCP1 EQU H'0003' NOT_T3SYNC EQU H'0002' T3SYNC EQU H'0002' T3INSYNC EQU H'0002' ; For backward compatibility TMR3CS EQU H'0001' TMR3ON EQU H'0000' ;----- TXSTA Bits CSRC EQU H'0007' TX9 EQU H'0006' NOT_TX8 EQU H'0006' ; For backward compatibility TX8_9 EQU H'0006' ; For backward compatibility TXEN EQU H'0005' SYNC EQU H'0004' BRGH EQU H'0002' TRMT EQU H'0001' TX9D EQU H'0000' TXD8 EQU H'0000' ; For backward compatibility ;----- RCSTA Bits SPEN EQU H'0007' RX9 EQU H'0006' RC9 EQU H'0006' ; For backward compatibility NOT_RC8 EQU H'0006' ; For backward compatibility RC8_9 EQU H'0006' ; For backward compatibility SREN EQU H'0005' CREN EQU H'0004' ADDEN EQU H'0003' FERR EQU H'0002' OERR EQU H'0001' RX9D EQU H'0000' RCD8 EQU H'0000' ; For backward compatibility ;----- IPR2 Bits EEIP EQU H'0004' BCLIP EQU H'0003' LVDIP EQU H'0002' TMR3IP EQU H'0001' CCP2IP EQU H'0000' ;----- PIR2 Bits EEIF EQU H'0004' BCLIF EQU H'0003' Side 10

98 P18F452.txt LVDIF EQU H'0002' TMR3IF EQU H'0001' CCP2IF EQU H'0000' ;----- PIE2 Bits EEIE EQU H'0004' BCLIE EQU H'0003' LVDIE EQU H'0002' TMR3IE EQU H'0001' CCP2IE EQU H'0000' ;----- IPR1 Bits PSPIP EQU H'0007' ADIP EQU H'0006' RCIP EQU H'0005' TXIP EQU H'0004' SSPIP EQU H'0003' CCP1IP EQU H'0002' TMR2IP EQU H'0001' TMR1IP EQU H'0000' ;----- PIR1 Bits PSPIF EQU H'0007' ADIF EQU H'0006' RCIF EQU H'0005' TXIF EQU H'0004' SSPIF EQU H'0003' CCP1IF EQU H'0002' TMR2IF EQU H'0001' TMR1IF EQU H'0000' ;----- PIE1 Bits PSPIE EQU H'0007' ADIE EQU H'0006' RCIE EQU H'0005' TXIE EQU H'0004' SSPIE EQU H'0003' CCP1IE EQU H'0002' TMR2IE EQU H'0001' TMR1IE EQU H'0000' ;----- TRISE Bits IBF EQU H'0007' OBF EQU H'0006' IBOV EQU H'0005' PSPMODE EQU H'0004' TRISE2 EQU H'0002' Side 11

99 P18F452.txt TRISE1 EQU H'0001' TRISE0 EQU H'0000' ;----- EECON1 Bits EEPGD EQU H'0007' CFGS EQU H'0006' FREE EQU H'0004' WRERR EQU H'0003' WREN EQU H'0002' WR EQU H'0001' RD EQU H'0000' ;================================================================= ========= ; ; I/O Pin Name Definitions ; ;================================================================= ========= ;----- PORTA RA0 EQU 0 AN0 EQU 0 RA1 EQU 1 AN1 EQU 1 RA2 EQU 2 AN2 EQU 2 VREFM EQU 2 RA3 EQU 3 AN3 EQU 3 VREFP EQU 3 RA4 EQU 4 T0CKI EQU 4 RA5 EQU 5 AN4 EQU 5 SS EQU 5 LVDIN EQU 5 RA6 EQU 6 OSC2 EQU 6 CLKO EQU 6 ;----- PORTB RB0 EQU 0 INT0 EQU 0 RB1 EQU 1 INT1 EQU 1 RB2 EQU 2 INT2 EQU 2 Side 12

100 RB3 EQU 3 CCP2A EQU 3 RB4 EQU 4 RB5 EQU 5 RB6 EQU 6 RB7 EQU 7 P18F452.txt ;----- PORTC RC0 EQU 0 T1OSO EQU 0 T1CKI EQU 0 RC1 EQU 1 T1OSI EQU 1 CCP2 EQU 1 RC2 EQU 2 CCP1 EQU 2 RC3 EQU 3 SCK EQU 3 SCL EQU 3 RC4 EQU 4 SDI EQU 4 SDA EQU 4 RC5 EQU 5 SDO EQU 5 RC6 EQU 6 TX EQU 6 CK EQU 6 RC7 EQU 7 RX EQU 7 ;****DT EQU 7 ;*** Not Available due to conflict with ;*** Define Table (DT) directive ;----- PORTD RD0 EQU 0 PSP0 EQU 0 RD1 EQU 1 PSP1 EQU 1 RD2 EQU 2 PSP2 EQU 2 RD3 EQU 3 PSP3 EQU 3 RD4 EQU 4 PSP4 EQU 4 RD5 EQU 5 PSP5 EQU 5 RD6 EQU 6 PSP6 EQU 6 Side 13

101 RD7 EQU 7 PSP7 EQU 7 P18F452.txt ;----- PORTE RE0 EQU 0 RD EQU 0 AN5 EQU 0 RE1 EQU 1 WR EQU 1 AN6 EQU 1 RE2 EQU 2 CS EQU 2 AN7 EQU 2 ;================================================================= ========= ; ; RAM Definition ; ;================================================================= ========= MAXRAM H'FFF' BADRAM H'600'-H'F7F' BADRAM H'F85'-H'F88' BADRAM H'F8E'-H'F91' BADRAM H'F97'-H'F9C' BADRAM H'FA3'-H'FA5' BADRAM H'FAA' BADRAM H'FB4'-H'FB9' ;================================================================= ========= ; ; Configuration Bits ; ; Data Sheet Include File Address ; CONFIG1L = Configuration Byte 1L h ; CONFIG1H = Configuration Byte 1H h ; CONFIG2L = Configuration Byte 2L h ; CONFIG2H = Configuration Byte 2H h ; CONFIG3L = Configuration Byte 3L h ; CONFIG3H = Configuration Byte 3H h ; CONFIG4L = Configuration Byte 4L h ; CONFIG4H = Configuration Byte 4H h ; CONFIG5L = Configuration Byte 5L h ; CONFIG5H = Configuration Byte 5H h ; CONFIG6L = Configuration Byte 6L 30000ah ; CONFIG6H = Configuration Byte 6H 30000bh ; CONFIG7L = Configuration Byte 7L 30000ch Side 14

102 P18F452.txt ; CONFIG7H = Configuration Byte 7H 30000dh ; ;================================================================= ========= ;Configuration Byte 1H Options _OSCS_ON_1H EQU H'DF' ; Oscillator Switch enable _OSCS_OFF_1H EQU H'FF' _LP_OSC_1H EQU H'F8' ; Oscillator type _XT_OSC_1H EQU H'F9' _HS_OSC_1H EQU H'FA' _RC_OSC_1H EQU H'FB' _EC_OSC_1H EQU H'FC' ; External Clock w/osc2 output divide by 4 _ECIO_OSC_1H EQU H'FD' ; w/osc2 as an IO pin (RA6) _HSPLL_OSC_1H EQU H'FE' ; HS PLL _RCIO_OSC_1H EQU H'FF' ; RC w/osc2 as an IO pin (RA6) ;Configuration Byte 2L Options _BOR_ON_2L EQU H'FF' ; Brown-Out Reset enable _BOR_OFF_2L EQU H'FD' _PWRT_OFF_2L EQU H'FF' ; Power-Up Timer enable _PWRT_ON_2L EQU H'FE' _BORV_20_2L EQU H'FF' ; BOR Voltage - 2.0v _BORV_27_2L EQU H'FB' ; 2.7v _BORV_42_2L EQU H'F7' ; 4.2v _BORV_45_2L EQU H'F3' ; 4.5v ;Configuration Byte 2H Options _WDT_ON_2H EQU H'FF' ; Watch Dog Timer enable _WDT_OFF_2H EQU H'FE' _WDTPS_128_2H EQU H'FF' ; Watch Dog Timer PostScaler count _WDTPS_64_2H EQU H'FD' _WDTPS_32_2H EQU H'FB' _WDTPS_16_2H EQU H'F9' _WDTPS_8_2H EQU H'F7' _WDTPS_4_2H EQU H'F5' _WDTPS_2_2H EQU H'F3' _WDTPS_1_2H EQU H'F1' ;Configuration Byte 3H Options _CCP2MX_ON_3H EQU H'FF' ; CCP2 pin Mux enable _CCP2MX_OFF_3H EQU H'FE' ;Configuration Byte 4L Options _STVR_ON_4L EQU H'FF' ; Stack over/underflow Reset enable _STVR_OFF_4L EQU H'FE' _LVP_ON_4L EQU H'FF' ; Low-voltage ICSP enable _LVP_OFF_4L EQU H'FB' _DEBUG_ON_4L EQU H'7F' ; Backgound Debugger enable _DEBUG_OFF_4L EQU H'FF' Side 15

103 P18F452.txt ;Configuration Byte 5L Options _CP0_ON_5L EQU H'FE' ; Code protect user block enable _CP0_OFF_5L EQU H'FF' _CP1_ON_5L EQU H'FD' _CP1_OFF_5L EQU H'FF' _CP2_ON_5L EQU H'FB' _CP2_OFF_5L EQU H'FF' _CP3_ON_5L EQU H'F7' _CP3_OFF_5L EQU H'FF' ;Configuration Byte 5H Options _CPB_ON_5H EQU H'BF' ; Code protect boot block enable _CPB_OFF_5H EQU H'FF' _CPD_ON_5H EQU H'7F' ; Code protect Data EE enable _CPD_OFF_5H EQU H'FF' ;Configuration Byte 6L Options _WRT0_ON_6L EQU H'FE' ; Write protect user block enable _WRT0_OFF_6L EQU H'FF' _WRT1_ON_6L EQU H'FD' _WRT1_OFF_6L EQU H'FF' _WRT2_ON_6L EQU H'FB' _WRT2_OFF_6L EQU H'FF' _WRT3_ON_6L EQU H'F7' _WRT3_OFF_6L EQU H'FF' ;Configuration Byte 6H Options _WRTC_ON_6H EQU H'DF' ; Write protect CONFIG regs enable _WRTC_OFF_6H EQU H'FF' _WRTB_ON_6H EQU H'BF' ; Write protect boot block enable _WRTB_OFF_6H EQU H'FF' _WRTD_ON_6H EQU H'7F' ; Write protect Data EE enable _WRTD_OFF_6H EQU H'FF' ;Configuration Byte 7L Options _EBTR0_ON_7L EQU H'FE' ; Table Read protect user block enable _EBTR0_OFF_7L EQU H'FF' _EBTR1_ON_7L EQU H'FD' _EBTR1_OFF_7L EQU H'FF' _EBTR2_ON_7L EQU H'FB' _EBTR2_OFF_7L EQU H'FF' _EBTR3_ON_7L EQU H'F7' _EBTR3_OFF_7L EQU H'FF' ;Configuration Byte 7H Options _EBTRB_ON_7H EQU H'BF' ; Table Read protect boot block enable _EBTRB_OFF_7H EQU H'FF' Side 16

104 P18F452.txt ; To use the Configuration Bits, place the following lines in your source code ; in the following format, and change the configuration value to the desired ; setting (such as CP_OFF to CP_ON). These are currently commented out here ; and each CONFIG line should have the preceding semicolon removed when ; pasted into your source code. ; The following is a assignment of address values for all of the configuration ; registers for the purpose of table reads _CONFIG1L EQU H'300000' _CONFIG1H EQU H'300001' _CONFIG2L EQU H'300002' _CONFIG2H EQU H'300003' _CONFIG3L EQU H'300004' _CONFIG3H EQU H'300005' _CONFIG4L EQU H'300006' _CONFIG4H EQU H'300007' _CONFIG5L EQU H'300008' _CONFIG5H EQU H'300009' _CONFIG6L EQU H'30000A' _CONFIG6H EQU H'30000B' _CONFIG7L EQU H'30000C' _CONFIG7H EQU H'30000D' _DEVID1 EQU H'3FFFFE' _DEVID2 EQU H'3FFFFF' _IDLOC0 EQU H'200000' _IDLOC1 EQU H'200001' _IDLOC2 EQU H'200002' _IDLOC3 EQU H'200003' _IDLOC4 EQU H'200004' _IDLOC5 EQU H'200005' _IDLOC6 EQU H'200006' _IDLOC7 EQU H'200007' ;Program Configuration Register 1H ; CONFIG _CONFIG1H, _OSCS_OFF_1H & _RCIO_OSC_1H ;Program Configuration Register 2L ; CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_OFF_2L ;Program Configuration Register 2H ; CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H ;Program Configuration Register 3H ; CONFIG _CONFIG3H, _CCP2MX_ON_3H ;Program Configuration Register 4L Side 17

105 P18F452.txt ; CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L ;Program Configuration Register 5L ; CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L ;Program Configuration Register 5H ; CONFIG _CONFIG5H, _CPB_ON_5H & _CPD_OFF_5H ;Program Configuration Register 6L ; CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L ;Program Configuration Register 6H ; CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H ;Program Configuration Register 7L ; CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L ;Program Configuration Register 7H ; CONFIG _CONFIG7H, _EBTRB_OFF_7H ;ID Locations Register 0 ; IDLOCS _IDLOC0, <expression> ;ID Locations Register 1 ; IDLOCS _IDLOC1, <expression> ;ID Locations Register 2 ; IDLOCS _IDLOC2, <expression> ;ID Locations Register 3 ; IDLOCS _IDLOC3, <expression> ;ID Locations Register 4 ; IDLOCS _IDLOC4, <expression> ;ID Locations Register 5 ; IDLOCS _IDLOC5, <expression> ;ID Locations Register 6 ; IDLOCS _IDLOC6, <expression> ;ID Locations Register 7 ; IDLOCS _IDLOC7, <expression> ;Device ID registers hold device ID and revision number and can only be read ;Device ID Register 1 Side 18

106 P18F452.txt ; DEV2, DEV1, DEV0, REV4, REV3, REV2, REV1, REV0 ;Device ID Register 2 ; DEV10, DEV9, DEV8, DEV7, DEV6, DEV5, DEV4, DEV3 LIST Side 19

107 String value Real value HOUR 0,0 MIN 0,0 [ma] Equation Min (d) Max (d) Min (Value) Max (value) IMAG 0,0 <<(B8*0,489) ND IIN 0,0 <<(B9*9,804) ND IUT 0,0 <<(B10*9,804) ND IDD 0,0 <<(B11*0,489) ND IUHF 0,0 <<(B12*0,489) ND IS 0,0 <<(B13*1/0,205) ND IVHF 0,0 <<(B14*4,815) ND IAIS 0,0 <<(B15/2,044) ND ISOL 0,0 <<(B16*9,8039) ND IPAUHF 0,0 <<(B17*9,783) ND [V] Min (d) Max (d) Min (Value) Max (value) VBAT 204 4,0 <<(B19/(H19/F19)) 3,3 4, VDD 0,0 <<(B20/(H20/F20)) 3,1 3, VS 0,0 <<(B21/(H21/F21)) 4,5 ND VMAG 0,0 <<(B22/(H22/F22)) 5,5 ND VAIS 0,0 <<(B23/(H23/F23)) 3,1 3, VUHF 0,0 <<(B24/(H24/F24)) 3,1 3, VVHF 0,0 <<(B25/(H25/F25)) 3,1 3, VSOL 0,0 <<(B26/(H26/F26)) 1 ND [Celsius] TBAT -40,0 <<(((B28*0,8)+233)-273) TADCS -40,0 <<(((B29*0,8)+233)-273) TAIS -40,0 <<(((B30*0,8)+233)-273) TTNC -40,0 <<(((B31*0,8)+233)-273) TUHF -40,0 <<(((B32*0,8)+233)-273) TS -40,0 <<(((B33*0,8)+233)-273) TA -40,0 <<(((B34*0,8)+233)-273) TB -40,0 <<(((B35*0,8)+233)-273) TC -40,0 <<(((B36*0,8)+233)-273) TD TZ ERRORS -40,0 <<(((B37*0,8)+233)-273) -40,0 <<(((B38*0,8)+233)-273) Flags

108

109

110

111 Part list ncube Power PCB (all the DC/DC converters) DC/DC for 3.3V out-put Name/ component Number Order code Number at home FARNELL TPS (15) 5 (+5 on PCB) 10uH Inductor 3(15) (+5 on PCB) 4,7 uf Capacitor 3(15) (+5 on PCB) 10 uf Capacitor 3(15) (+5 on PCB) 0,1 mf cer 3(15) DC/DC for 6.5/5.5V out-put Name/ component Number Order code Number at home FARNELL MAX1896 2(10) 7 (+4 on PCB) 10uH Inductor 2(10) (+4 on PCB) Diode 0,5A 2(10) (4 on PCB) IRF7204 MOSFET 2(10) (2 on PCB) 0,1 mf cer 2(10) uf Capacitor 2(10) (+4 on PCB) 22 uf Capacitor 2(10) (+4 on PCB) 33 nf Capacitor 2(10) (+4 on PCB) 30 kohm R 2(10) kohm R 1(5) kohm R 1(5) DC/DC for 4.2V out-put Name/ component Number Order code Number at home FARNELL MAX1524 1(5) 13 (+3 on PCB) MOSFET N-type 2(10) (+4 on PCB) Diode 1A 2(10) (+2 on PCB) 33uH Inductor 2(10) (+4 on PCB) 10 uf Capacitor 1(5) (+3 on PCB) 33 uf Capacitor 1(5) (+3 on PCB) 0,1 mf cer 2(10) pf Capacitor 1(5) kohm R 1(5) kohm R 1(5) Zener 2.2V 1(5) Zener 2.0V 1(5)

112 MAX1672 Buck boost converter - 1.8V to 11V input - Maximum output current 300mA - Number of pin: 16 - External components: 9 - Idle 3.7V/126µA & 2.0V/260µA V in [V] I in [ma] V out [V] I out [ma] Efficiency 2,50 25,74 5,00 10,00 0,7770 2,50 64,4 5,00 25,18 0,7820 2,50 127,9 5,00 50,00 0,7819 2, ,99 102,5 0,7809 2,50 386,7 4,95 150,5 0,7706 2, ,94 204,1 0,7496 2, , ,6130 3,70 16,36 5,00 10,00 0,8260 3,70 41,00 5,00 25,00 0,8240 3,70 82,3 5,00 50,4 0,8276 3,70 163,3 5,00 99,7 0,8250 3,70 254,4 5,00 154,7 0,8218 3,70 343,6 4,97 208,8 0,8163 3, , ,7837 4,50 13,11 5,01 10,03 0,8518 4,50 32,86 5,01 25,14 0,8518 4, ,02 49,7 0,8530 4,50 130,3 5,02 99,1 0,8484 4,50 195,4 5,03 147,5 0,8438 4,50 263,2 5,03 197,5 0,8388 4, ,97 327,2 0,8157 5,00 11,69 5, ,8589 5,00 29,2 5,02 25,06 0,8617 5,00 59,6 5, ,8608 5, ,03 99,2 0,8603 5,00 179,8 5,04 152,4 0,8544 5,00 243,2 5,04 204,8 0,8488 5, , ,8286 Table 1: Efficiency research MAX1672 Conclusion: (-) Low efficiency (-) Low output current range (-) High input voltage (-) Large number of pins (-) Large number of external components (+) Relatively stable around 82% efficiency

113 MAX710 Buck boost converter - 1.8V to 11V input - Maximum output current 500mA - Number of pin: 16 - External components: 6 - Idle: 2.5V/220µA & 3.7V/156 µa V in [V] I in [ma] V out [V] I out [ma] Efficiency 2,48 23,8 4,98 10,00 0,8437 2,50 59,1 4,98 25,02 0,8440 2,51 117,7 4,98 50,10 0,8459 2,50 246,2 4,97 100,2 0,8097 2,50 388,4 4,96 150,6 0,7693 2, ,95 204,1 0,7234 2, ,04 303,6 0,4142 3,70 15,74 4,96 10,08 0,8590 3,70 39,07 4,97 25,16 0,8645 3,70 77,6 4,97 50,0 0,8655 3,70 155,9 4,98 100,2 0,8651 3,70 239,7 4,97 152,1 0,8523 3,71 333,7 4,96 207,7 0,8321 3, , ,7312 4,50 12,78 4, ,8659 4,50 31,98 4,98 25,18 0,8714 4,50 63,6 4,97 50,1 0,8700 4,50 127,8 4,97 100,4 0,8677 4, ,96 151,1 0,8629 4, ,96 196,5 0,8409 4, ,94 318,8 0,7936 5,00 11,43 5,04 10,01 0,8828 5,00 28,66 5,04 25,19 0,8860 5,00 75,5 5,01 49,1 0,6516 5,00 152,1 5,00 101,8 0,6693 5,00 216,2 4,98 150,6 0,6938 5,00 297,3 4,97 208,5 0,6971 5, ,93 318,9 0,7228 Table 2: Efficiency research MAX710 Conclusion: (-) Low efficiency (-) Low output current range (-) High input voltage (-) Large number of pins (-) Relatively unstable around 85% efficiency

114 (+) Small number of external components MAX1674 Step up converter - 0.7V to 5.5V input - Maximum output current 300mA - Number of pin: 8 - External components: 4 - Idle: 3.7V/35 µa & 2.5V/52 µa V inn [V] I in [ma] V out [V] I out [ma] Efficiency 1,50 39,5 4,99 10,00 0,8422 1,50 97,4 4,98 25,06 0,8542 1,50 199,3 4,96 50,50 0,8379 1, ,95 102,8 0,6511 1, ,84 153,1 0,6024 2,50 22,6 5,00 10,0 0,8850 2,50 56,2 4,99 24,99 0,8875 2,50 110,6 4,99 49,4 0,8915 2,50 224,6 4,98 98,3 0,8718 2,50 379,8 4,98 155,1 0,8135 2, ,95 218,4 0,7778 2, ,85 319,0 0,7456 3,7 15,2 5, ,8908 3,7 38,05 5,01 25,1 0,8932 3,7 75,2 5,02 49,8 0,8985 3,7 148,1 5, ,9051 3,7 233,8 5,01 155,4 0,9000 3, ,02 221,4 0,8607 3, , ,8491 Table 3: Efficiency research MAX1674 Conclusion: (=) Ok efficiency (best in or test) (- ) Low output current range (=) Ok number of pins (+) Low input voltage (+) Small number of external components The MAX 1674 Step up converter is the best converter we tested when looking on efficiency. But because of its limited output current it could only be used on the high voltage/ low current subsystems.

115 MAX1703 Buck boost converter - 0.7V to 5.5V input - Maximum output current 1500mA - Number of pin: 16 - External components: 7 - Idle: V in [V] I in [ma] V out [V] I out [ma] Efficiency 1,5 50 4, ,6653 1,5 102, ,8114 1, ,99 50,4 0,5988 1, ,98 100,1 0,6607 2, ,00 0,6667 2, ,01 25,18 0,8272 2, ,01 50,00 0,7649 2, ,02 101,5 0,7930 2, ,03 200,5 0,7004 2, ,95 303,0 0,5008 2, , ,4881 Table 4: Efficiency research MAX1703 Conclusion: (?) Efficiency unknown (up to 95% maxim) (+) High output current range (- ) Large number of pins (+) Low input voltage (=) Ok number of external components The max 1703 DC/DC converter is the only DC/DC converter that is suitable between the solar cells and the charger. This is also the converter that we were recommended to use by Maxim. During our research we have made 4 different layouts, but none of them have worked properly. The data in the table above is the only one we have; the converter malfunctioned after a while. In the problems chapter we will discuss this hi-current step up problem.

116 TPS62203 Step down converter (3.3V fixed output) - 0.7V to 6V input - Maximum output current 300mA - Number of pin: 5 - External components: 3 - Idle: 3.5V/19 & 5.0V/19mA V in [V] I in [ma] V out [V] I out [ma] Efficiency 6 6,28 3, , , , ,5 3, , , ,3 0, , ,866 Break ,34 3, , ,37 3, , ,06 3, , ,3 3, , ,2 3, , ,3 3, , ,5 2, ,857 Break ,9 3, , ,01 3, , ,9 3,320 50,2 0, ,9 3, , ,9 3, ,5 0,939 Break 150 3,5 9,91 3, ,958 3,5 24,49 3, ,970 3,5 48,1 3,284 49,6 0,968 3,5 97,6 3, ,1 0,964 3,5 121,7 3, ,9 0,960 3,5 148,7 3, ,5 0,956 3,5 200,3 3, ,951 3, , ,8 0,938 3,5 301,8 3, ,7 0,924 Table 5: Efficiency research TSP62203 Conclusion: (+) High efficiency (- ) Low output current range (+) Low number of pins (+) Low input voltage (+) Small number of external components The TSP62203 step down converter is a good DC/DC converter; it could probably be used on all subsystems that require 3.3V.

117

118

119 DLP * DLP * - DISCHARGE CHARACTERISTICS The Danionics Lithium-Ion Polymer Battery offers through a combination of high energy and power density, a polymer electrolyte and soft packaging concept distinct advantages to Original Equipment Manufacturers in the portable electronics industry. SPECIFICATIONS Name: DLP Weight: Capacity: Nominal voltage: Dimensions: 33 g +/- 2 g 1,500 mah V Thickness: 4.8 mm Width: 53 mm Length: 88 mm DLP * - CHARGE CHARACTERISTICS Note: "*" after the DLP number indicates that this cell is based on Danionics' G3 technology. DLP * - CYCLING CHARACTERISTICS FEATURES The Danionics Lithium-Ion Polymer Technology offers a high degree of design freedom. The batteries from Danionics also feature: High energy density Good cycling characteristics (min. 500 cycles) Wide functional area (-20 o C to 60 o C) High current charging characteristics Low self discharge Attractive flat prismatic form factor Low impedance Good storage performance DLP * - TEMPERATURE CHARACTERISTICS High safety - also when the battery is used wrongly

120

121

122 MICRONECTOR 200 HIGH PACKAGING DENSITY CONNECTORS MALE STRAIGHT p.c. TERMINATION TYPE T X & Y B5743 BS STYLE MALE 90 p.c. TERMINATION TYPE L BS STYLE B5743 OUTLINE DIMENSIONS MALE CONNECTORS MOUNTING DETAILS FOR MALE CONNECTORS TERMINATION TYPE L FOR MALE AND FEMALE CONNECTORS TERMINATION STYLE T, X, Y & N - OMIT 1.111/1.0mm HOLES

123 ALTERNATIVE BOARD MOUNTING FOR JACKSCREWS MP6820 & MP6821

124 MICRONECTOR 200 HIGH PACKAGING DENSITY CONNECTORS FEMALE STRAIGHT p.c. TERMINATION TYPE T & N BS STYLE B5741 OUTLINE DIMENSIONS FEMALE CRIMP TERMINATION TYPE C & D BS STYLE B5740 Preferred wire type BS G 210 (Type A) *Also suitable for use with 24 A.W.G. DEF-STAN (Part 6 Type 1) PVC NOTE: Whilst a crimp contact withdrawal tool (MP6808) is available as an optional accessory, it is only suitable for removal of ALL contacts when the moulding MUST be replaced prior to reinsertion of the contacts. MINIMUM SPACING END TO END DIMENSIONS SPACING - BOARD TO BOARD MATED CONNECTORS OUTLINE

125

126

127 PC74HC153D

128

129 4081

130 4070

131

132

133

134

135 Mikroprocessorkristall, HC49 Fabr C-MAC Kvartskristall i hermetiskt tillsluten HC49-kåpa. Kristallerna är avsedda för parallellresonans eller för serieresonans i de fall då ordet serie står i kolumnen för lastkapacitans. Kristallerna är AT-slipade för att erhålla bästa möjliga prestanda. Max drivnivå: 1 mw Max serieresistans 1,0 MHz: 2 kω 1, ,45760: 300 Ω 3, ,68640: 150 Ω 4,0 6,55360: 100 Ω 7, ,83040: 50 Ω 10,0 24,0: 35 Ω Temperaturområde för frekvensstabilitet 100 ppm: 0 till +50 C 30 och 50 ppm: 10 till +60 C 10 ppm: 20 till +70 C Max åldring: 2 ppm första året, sedan 1 ppm/år

136

137

138

PIC18 Interrupt. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

PIC18 Interrupt. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan PIC18 Interrupt Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Interrupts vs. polling Polling Continuously monitor the status of a given device Waste much

More information

; < [PROGRAM] > LIST P=18F452, R=DEC INCLUDE "p18f452.inc"

; < [PROGRAM] > LIST P=18F452, R=DEC INCLUDE p18f452.inc PROGRAM LISTING 7: MPASM EDGE DETECTION PROGRAM By Malcolm Stagg ; ; Edges Controller (EC) ; With Non-Maximal Suppression # ; [Source Code] # ; ---------------------------------- # ; By Malcolm Stagg #

More information

Interfacing PIC Microcontrollers. POWER2 Schematic. This application demonstrates output interfacing for power loads

Interfacing PIC Microcontrollers. POWER2 Schematic. This application demonstrates output interfacing for power loads Interfacing PIC Microcontrollers POWER2 Schematic This application demonstrates output interfacing for power loads The relay interface shows simple, low speed load switching The oscillator represents an

More information

Apéndice 2. Programas. PLD GAL16v8

Apéndice 2. Programas. PLD GAL16v8 Apéndice 2 Programas PLD GAL16v8 Name Daniel Ortega G; PartNo 00; Date 21/11/2005; Revision 01 ; Designer Engineer ; Company personal ; Assembly None ; Location ; Device g16v8 ; /* *************** INPUT

More information

PIC18 Timer Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

PIC18 Timer Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan PIC18 Timer Programming Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Functions of PIC18 timer Generate a time delay ( 計時器 ) Use internal clock pulse,

More information

PIC18 Timer Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

PIC18 Timer Programming. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan PIC18 Timer Programming Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.tw Functions of PIC18 timer Functions of the timer Generate a time delay As a counter

More information

Interrupts #include CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF & _MCLRE_ON & _HS_OSC RES_VECT CODE 0x0000 ; processor reset vector GOTO START ; go to beginning of program INT_VECT CODE

More information

;;;;;Macro definitions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MOVLF macro literal,dest movlw literal movwf dest endm

;;;;;Macro definitions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MOVLF macro literal,dest movlw literal movwf dest endm rzmcnt22 Senior Design Program To Direct Motors Hayden Callender list P=PIC16F877, F=INHX8M, C=160, N=77, ST=OFF, MM=OFF, R=DEC, X=OFF #include P16F877.inc config(_cp_off & _PWRTE_ON & _XT_OSC & _WDT_OFF

More information

8-Channel LED Holiday Light Dimmer - 12/30/10 copyright reserved Vince Cappellano

8-Channel LED Holiday Light Dimmer - 12/30/10 copyright reserved Vince Cappellano 8-Channel LED Holiday Light Dimmer - 12/30/10 copyright reserved Vince Cappellano Abstract: The run-up to the holiday season was filled with the traditional fun, including enjoying a variety of holiday

More information

UNIVERSITY OF NAIROBI SCHOOL OF ENGINEERING DEPARTMENT OF ELECTRICAL AND INFORMATION ENGINEERING

UNIVERSITY OF NAIROBI SCHOOL OF ENGINEERING DEPARTMENT OF ELECTRICAL AND INFORMATION ENGINEERING UNIVERSITY OF NAIROBI SCHOOL OF ENGINEERING DEPARTMENT OF ELECTRICAL AND INFORMATION ENGINEERING SOIL MOISTURE MEASUREMENT FOR IRRIGATION APPLICATION PROJECT NUMBER: 1 NAME: HASSAN ADNAN MOHAMED REG. NO:

More information

AN582. Low-Power Real Time Clock. Low-Power Real Time Clock INTRODUCTION OPERATION FIGURE 1: CLOCK BLOCK DIAGRAM

AN582. Low-Power Real Time Clock. Low-Power Real Time Clock INTRODUCTION OPERATION FIGURE 1: CLOCK BLOCK DIAGRAM Low-Power Real Time Clock Low-Power Real Time Clock AN582 INTRODUCTION This application note implements a low-power real time clock using the Timer1 module of the PIC16CXX family of processors. Timer1

More information

Phone Remote Control Unit

Phone Remote Control Unit Phone Remote Control Unit Author: Mirkov Milos Kikinda, Yugoslavia email: mmki@sezampro.yu APPLICATION OPERATION: This device is for a remote on and off switch for up to three home devices. It consists

More information

Random Phase Power Controller

Random Phase Power Controller Random Phase Power Controller Author: Borislav Goudjounov Sofia, Bulgaria email: astro@mail.techo-link.com After this procedure follows: slave address, RW bit, and max 5 bytes of data. The schematic is

More information

CMM-11E1 Development Board

CMM-11E1 Development Board CMM-11E1 Development Board Axiom Manufacturing, 1998 2813 Industrial Ln. Garland, TX 75041 Phone: 972-926-9303 Web: www.axman.com email: sales@axman.com support@axman.com TABLE OF CONTENTS 1. GETTING STARTED...

More information

CBLOCK 0X20 ENDC ;;; 虛指令, 由 MPLAB 代為管理變數

CBLOCK 0X20 ENDC ;;; 虛指令, 由 MPLAB 代為管理變數 ---------------------------------------------------------------------------- 16x16 陣列 LED 字幕機 (Matrix LED Experience) 檔案 :LEDMA_7.ASM -----------------------------------------------------------------------------

More information

AN552. Implementing Wake-up on Key Stroke SUMMARY INTRODUCTION IMPLEMENTATION PIC16CXXX. 4x4 KEYPAD INTERFACE TO PIC16CXXX. Microchip Technology Inc.

AN552. Implementing Wake-up on Key Stroke SUMMARY INTRODUCTION IMPLEMENTATION PIC16CXXX. 4x4 KEYPAD INTERFACE TO PIC16CXXX. Microchip Technology Inc. M AN552 Implementing Wake-up on Key Stroke Author: INTRODUCTION Microchip's microcontroller family are ideally suited to directly interface to a keypad. The high 4-bits of PORTB (RB7:RB4) have internal

More information

NHD-C160100DiZ-FSW-FBW

NHD-C160100DiZ-FSW-FBW NHD-C160100DiZ-FSW-FBW COG (Chip-On-Glass) Liquid Crystal Display Module NHD- Newhaven Display C160100-160 x 100 pixels DiZ- Model (I2C) F- Transflective SW- Side White LED backlight F- FSTN (+) B- 6:00

More information

RFM-003 User Manual RFM-003. User Manual 2005/06/01. Ver. 1.00C

RFM-003 User Manual RFM-003. User Manual 2005/06/01. Ver. 1.00C RFM-003 User Manual 2005/06/01 Ver. 1.00C Sunion Electronic Corporation 11F, 123-7, Shine De Rd., San Chung City, Taipei 241, Taiwan, R.O.C. TEL : +886-2-8512-1456 FAX : +886-2-8512-1457 http://www.sunion.com.tw/

More information

NHD-C160100DiZ-FSW-FBW

NHD-C160100DiZ-FSW-FBW NHD-C160100DiZ-FSW-FBW COG (Chip-On-Glass) Liquid Crystal Display Module NHD- Newhaven Display C160100-160 x 100 Pixels DiZ- Model (I²C) F- Transflective SW- Side White LED Backlight F- FSTN (+) B- 6:00

More information

Low Power Tiny Iambic Keyer

Low Power Tiny Iambic Keyer Low Power Tiny Iambic Keyer Andy Palm N1KSN This is my first project with a Texas Instruments MSP430 microcontroller, specifically the Value Line MSP430G2211 chip. This chip is supplied with the inexpensive

More information

1. Explain the architecture and technology used within FPGAs. 2. Compare FPGAs with alternative devices. 3. Use FPGA design tools.

1. Explain the architecture and technology used within FPGAs. 2. Compare FPGAs with alternative devices. 3. Use FPGA design tools. Higher National Unit Specification General information for centres Unit code: DG3P 35 Unit purpose: This Unit is designed to enable candidates to gain some knowledge and understanding of the architecture

More information

Single Phase Grid Connected Photovoltaic System

Single Phase Grid Connected Photovoltaic System Single Phase Grid Connected Photovoltaic System 1 Kavya S A, 2 Komal T, 3 Pooja A, 3 Sahana S N and 4 Mr Sachin Angadi 1 ankalakote.kavya@gmail.com Abstract Due to global environmental concerns, photovoltaic

More information

SC-6104-W5 User Manual

SC-6104-W5 User Manual SC-6104-W5 User Manual Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year, beginning from the date of delivery to the original purchaser.

More information

Design of the RFID for storage of biological information

Design of the RFID for storage of biological information Design of the RFID for storage of biological information Yu-Lee Choi *, Seok-Man Kim **, Sang-Hee Son ***, and Kyoung-Rok Cho ** Dept. of Bio and Information Technology * Chungbuk National University,

More information

Series CVE 10, CVM 10 Absolute Encoders for the CAN-Bus

Series CVE 10, CVM 10 Absolute Encoders for the CAN-Bus Series CVE 10, CVM 10 Absolute Encoders for the CAN-Bus Singleturn, Multiturn with CAN-Interface according to ISO/DIS 11898. Date 04.12.1995 I. General Description... 2 II. Hardware Description... 3 1.

More information

ĐẠI HỌC QUỐC GIA TP.HCM TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH THỰC HÀNH VI XỬ LÝ. BM Kỹ thuật Máy tính

ĐẠI HỌC QUỐC GIA TP.HCM TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH THỰC HÀNH VI XỬ LÝ. BM Kỹ thuật Máy tính ĐẠI HỌC QUỐC GIA TP.HCM TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH THỰC HÀNH VI XỬ LÝ BM Kỹ thuật Máy tính 2009 Giới thiệu Mục Lục Mục Lục... 1 Bài 1 : Giới thiệu MPLAB IDE và KIT PIC...

More information

Loops and Counters. If Statement: Ladder Logic Code:

Loops and Counters. If Statement: Ladder Logic Code: If Statement: Loops and Counters if (A == 0) then do function F1 if (A == 1) then do function F2 do function F3 Ladder Logic Code: A return statement takes you to the next line of code. This checks if

More information

AN552. Implementing Wake-up on Key Stroke SUMMARY INTRODUCTION IMPLEMENTATION PIC16CXXX. 4x4 KEYPAD INTERFACE TO PIC16CXXX. Microchip Technology Inc.

AN552. Implementing Wake-up on Key Stroke SUMMARY INTRODUCTION IMPLEMENTATION PIC16CXXX. 4x4 KEYPAD INTERFACE TO PIC16CXXX. Microchip Technology Inc. M AN552 Implementing Wake-up on Key Stroke Author: INTRODUCTION Microchip's microcontroller family are ideally suited to directly interface to a keypad. The high 4-bits of PORTB (RB7:RB4) have internal

More information

Bulk Performance Analysis of the Anchor Chips AN2131

Bulk Performance Analysis of the Anchor Chips AN2131 Bulk Performance Analysis of the Anchor Chips AN2131 Introduction The Anchor Chips EZ-USB series of USB chips incorporates features to speed the transfer of data to and from the Universal Serial Bus. These

More information

EIS ICU Software Architectural Design. Document Number: MSSL/SLB-EIS/DD006.01, 30 June 2000

EIS ICU Software Architectural Design. Document Number: MSSL/SLB-EIS/DD006.01, 30 June 2000 EIS ICU Software Architectural Design MSSL/SLB-EIS/DD006.01 1 Solar B - EIS MULLARD SPACE SCIENCE LABORATORY UNIVERSITY COLLEGE LONDON Author: K. Al-Janabi Distribution: EIS ICU Software Architectural

More information

X2-RCU (Robot Control Unit) BE-5132 User Guide V1.0

X2-RCU (Robot Control Unit) BE-5132 User Guide V1.0 X2-RCU (Robot Control Unit) BE-5132 User Guide V1.0 Thank you for purchasing this JoinMax Digital product. To understand the remarkable features of X2-RCU and the correct operation method, you re recommended

More information

Operating Instructions GENIUS Control Unit Optional: Serial Interface

Operating Instructions GENIUS Control Unit Optional: Serial Interface Operating Instructions GENIUS Control Unit Optional: Serial Interface 9-18812 96 th Avenue Surrey, BC Canada, V4N 3R1 Tel: (001) 604 607-6028 Fax: (001) 604 607-6026 e-mail: service@metal-shark.com 1 Customer

More information

CCC Wallboard Manager User Manual

CCC Wallboard Manager User Manual CCC Wallboard Manager User Manual 40DHB0002USBF Issue 2 (17/07/2001) Contents Contents Introduction... 3 General... 3 Wallboard Manager... 4 Wallboard Server... 6 Starting the Wallboard Server... 6 Administering

More information

PART NO. : WC1602A V8.1-STBLWHC06 FOR MESSRS. : PAGE: 1/7 WC1602A V8.1 -STBLWHC06 CONTENTS

PART NO. : WC1602A V8.1-STBLWHC06 FOR MESSRS. : PAGE: 1/7 WC1602A V8.1 -STBLWHC06 CONTENTS T h e L C D ( M ) S p e c i a l i s t CONTACT ADDRESS : 3F, Block 13, WangJingKeng Industrial Park, DaKan,XiLi, NanShan, Shenzhen City,China. Tel: 0086-755-83308729 Fax: 0086-755-83308659 E-mail: craig.jiang@wincomlcd.com

More information

Here only normal flight mode's functions with APM2.5 board are discussed. HIL modes and telemetry are out of the scope.

Here only normal flight mode's functions with APM2.5 board are discussed. HIL modes and telemetry are out of the scope. ArduPlane Version 2.65 This code description is based partly on APM code outline https://docs.google.com/document/d/1ocemtcq7njr- YeEroSsMPQCZNP0QvMxqYPPCJy2zZHI/edit?hl=en&pli=1 Here only normal flight

More information

This Application Note describes how to use the internal pull-up resistors present on the PSoC I/O pins when communicating as an I 2 C Bus Master.

This Application Note describes how to use the internal pull-up resistors present on the PSoC I/O pins when communicating as an I 2 C Bus Master. Communication - Using PSoC Internal Resistors for I2C Communications AN2121 Author: Jason A. Goldstein Associated Project: No Associated Part Family: CY8C25xxx, CY8C26xxx GET FREE SAMPLES HERE Software

More information

EDEXCEL NC/D ENGINEERING PROGRAMMABLE LOGIC CONTROLLERS UNIT 25 ASSIGNMENT 3 DESIGN AND OPERATIONAL CHARACTERISTICS

EDEXCEL NC/D ENGINEERING PROGRAMMABLE LOGIC CONTROLLERS UNIT 25 ASSIGNMENT 3 DESIGN AND OPERATIONAL CHARACTERISTICS EDEXCEL NC/D ENGINEERING PROGRAMMABLE LOGIC CONTROLLERS UNIT 25 ASSIGNMENT 3 DESIGN AND OPERATIONAL CHARACTERISTICS NAME: I agree to the assessment as contained in this assignment. I confirm that the work

More information

P/N SMC-100. Stepper Motor Controller Operation manual

P/N SMC-100. Stepper Motor Controller Operation manual P/N 4411-0018 Stepper Motor Controller Operation manual Manual Version 1 Revision A March 17, 1993 2 TABLE OF CONTENTS INTRODUCTION...3 FAMILIARIZATION AND SETUP...4 MANUAL OPERATION...5 Overview...5 User

More information

Galaxy 300. Operation 05/

Galaxy 300. Operation 05/ Galaxy 300 60 80 kva Operation 05/2016 www.schneider-electric.com Legal Information The Schneider Electric brand and any registered trademarks of Schneider Electric Industries SAS referred to in this guide

More information

Method for a manufacturing WIP cart for integrated factory automation systems

Method for a manufacturing WIP cart for integrated factory automation systems Method for a manufacturing WIP cart for integrated factory automation systems Disclosed is a method for a manufacturing work-in-progress (WIP) cart for integrated factory automation systems. Benefits include

More information

User Guide 1/43 USER GUIDE. V2.0 Revision

User Guide 1/43 USER GUIDE. V2.0 Revision User Guide 1/43 USER GUIDE V2.0 Revision 1.01.0 User Guide 2/43 Table Of Contents Table Of Contents Chapter 1 Dynamics Telephony Introduction 1.1 The Application 1.2 The Toolbar 1.3 Telephony Operations

More information

Agilent E1460A 64-Channel Relay Multiplexer. Data Sheet. Agilent Technologies. Description

Agilent E1460A 64-Channel Relay Multiplexer. Data Sheet. Agilent Technologies. Description Agilent E1460A 64-Channel Relay Multiplexer Data Sheet 1-Slot, C-size, register based Armature latching relay channels Configuration for testing insulation Includes QUIC easy-to-use terminal block Numerous

More information

Qwiic HAT for Raspberry Pi Hookup Guide

Qwiic HAT for Raspberry Pi Hookup Guide Page 1 of 7 Qwiic HAT for Raspberry Pi Hookup Guide Introduction This Qwiic HAT for Raspberry Pi is the quickest and easiest way to utilize SparkFun s Qwiic ecosystem while still using that Raspberry Pi

More information

AN QN908x 32k RCO Calibration. Document information

AN QN908x 32k RCO Calibration. Document information Rev. 22 December 2017 Application note Document information Info Content Keywords RCO, 32 khz, Calibration, ppm, RTC Calibration, SCA Abstract The AN describes the details of 32 khz RCO calibration

More information

13. Back-End Design Flow for HardCopy Series Devices

13. Back-End Design Flow for HardCopy Series Devices 13. Back-End esign Flow for HardCopy Series evices H51019-1.4 Introduction This chapter discusses the back-end design flow executed by the HardCopy esign Center when developing your HardCopy series device.

More information

AS Interface Master. X-gateway Interface Addendum. Doc: HMSI Rev: Connecting DevicesTM

AS Interface Master. X-gateway Interface Addendum. Doc: HMSI Rev: Connecting DevicesTM X-gateway Interface Addendum AS Interface Master Doc: HMSI-27-256 Rev: 2.20 Connecting DevicesTM HALMSTAD CHICAGO KARLSRUHE TOKYO BEIJING MILANO MULHOUSE COVENTRY PUNE COPENHAGEN HMS Industrial Networks

More information

POWER FACTOR REGULATOR. Computer-12e-xx INSTRUCTION MANUAL ( M / 02A ) (c) CIRCUTOR S.A.

POWER FACTOR REGULATOR. Computer-12e-xx INSTRUCTION MANUAL ( M / 02A ) (c) CIRCUTOR S.A. POWER FACTOR REGULATOR Computer-12e-xx INSTRUCTION MANUAL ( M 981 606 / 02A ) (c) CIRCUTOR S.A. -------- POWER FACTOR REGULATOR COMPUTER- 12e --------- Page 2 POWER FACTOR REGULATOR COMPUTER- 12e 1.- POWER

More information

Keep available whenever necessary.

Keep available whenever necessary. Model No. HEC001 series HEC003 series HEC012 series HEC002 series HEC006 series Keep available whenever necessary. This manual is copyrighted and all rights are reserved by SMC Corporation, and may not,

More information

Four Stacker Card Dispenser

Four Stacker Card Dispenser SPECIFICATION A 1 OF 32 2008. 08.18. KYT-46XXSeries Four Stacker Card Dispenser KYTronics Corp., Ltd. 3rd Floor, A-Dong, Twins Town-Bldg, 703-2, Gojan-Dong,Danwon-Gu, Ansan-City, KyungKi-Do, Korea Tel:

More information

Multi-door Networking Controller

Multi-door Networking Controller AR-76EV AR-76Ei (RS-485) (0 Base-T) Multi-door Networking Controller User s Guide Version: 7. May 6, 004 Table of Contents. Introduction ---------------------------------------------------------------------------------------------.

More information

Section 6 Bill Validator VMC/Peripheral Communication Specifications

Section 6 Bill Validator VMC/Peripheral Communication Specifications Section 6 Bill Validator VMC/Peripheral Communication Specifications 6.1 Introduction This section defines the communication bytes sent and received between a Bill Validator and the VMC. As defined in

More information

UM0925 User manual. Using the M24LR64-R datalogger reference design. Introduction

UM0925 User manual. Using the M24LR64-R datalogger reference design. Introduction User manual Using the M24LR64-R datalogger reference design Introduction The M24LR64-R is a Dual Interface EEPROM which targets a wide range of applications such as industrial or medical equipment and

More information

General Purpose RF Synthesizer Block and Control Software

General Purpose RF Synthesizer Block and Control Software General Purpose RF Synthesizer Block and Control Software Per Björklund Ulf Kylenfall, SM6GXV Department of Earth and Space Sciences Chalmers University of Technology Onsala Space Observatory SE 439 92

More information

Pascon Instruction set overview. ADDM mem1 mem2 mem3 // mem1 + mem2 => mem3. SUBM mem1 mem2 mem3 // mem1 - mem2 => mem3

Pascon Instruction set overview. ADDM mem1 mem2 mem3 // mem1 + mem2 => mem3. SUBM mem1 mem2 mem3 // mem1 - mem2 => mem3 Instruction Set for Pascon V 7.03 Arithmetic operations: ADD r1,r2,r3 // r1 + r2 => r3 SUB r1,r2,r3 // r1 - r2 => r3 MUL r1,r2,r3 // r1 * r2 => r3 DIV r1,r2,r3 // r1 / r2 => r3 ADI r data // r + data =>

More information

INTERFACE CONTROL DOCUMENT

INTERFACE CONTROL DOCUMENT STUDENTS SPACE ASSOCIATION THE FACULTY OF POWER AND AERONAUTICAL ENGINEERING WARSAW UNIVERSITY OF TECHNOLOGY INTERFACE CONTROL DOCUMENT Attitude Determination And Control System December 2016 Issue no.

More information

User s Guide. Weighing Indicator WIDRA - HF L / HF S 2000/02/11 21:21:58. No. TARE NET GROSS TOTAL

User s Guide. Weighing Indicator WIDRA - HF L / HF S 2000/02/11 21:21:58. No. TARE NET GROSS TOTAL - 9-2000/02/11 21:21:58 No. TARE NET GROSS TOTAL ----------------------------------------------- 001 0.000U1 0.034U1 0.034U1 0.034U1 DATE 2000/02/11 TIME 21:26:56 NO. 001 TARE 0.000kg NET 0.076kg GROSS

More information

A PS/2 mouse is shown above with the cover removed. The ball (upper right) rolls two plastic X and Y axles with a slotted wheel at one end.

A PS/2 mouse is shown above with the cover removed. The ball (upper right) rolls two plastic X and Y axles with a slotted wheel at one end. A PS/2 mouse is shown above with the cover removed. The ball (upper right) rolls two plastic X and Y axles with a slotted wheel at one end. The slotted wheel passes through a square slotted case containing

More information

MODBUS-RTU Applied to the XR10CX Control WATER HEATER DIGITAL OPERATING CONTROLLER

MODBUS-RTU Applied to the XR10CX Control WATER HEATER DIGITAL OPERATING CONTROLLER MODBUS-RTU Applied to the Control WATER HEATER DIGITAL OPERATING CONTROLLER PVI INDUSTRIES, LLC - Fort Worth, Texas 76111 - Web www.pvi.com - Phone 1-800-433-5654 PV500-67 03/17 Table of Contents 1. THIS

More information

U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application

U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application Copyright 2015, Smart Projects Holdings Ltd Contents Preface... 2 Drone connection and first run... 2 Before you begin...

More information

U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application

U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application U g CS for DJI Phantom 2 Vision+, Phantom 3 and Inspire 1 Mobile companion application Copyright 2015, Smart Projects Holdings Ltd Contents Preface...2 Drone connection and first run...2 Before you begin...2

More information

- In description of SUBROM routine, comment "see page 352" has been changed to "see appendix 2..."

- In description of SUBROM routine, comment see page 352 has been changed to see appendix 2... MSX2 TECHNICAL HANDBOOK ----------------------- Edited by: ASCII Systems Division Published by: ASCII Coprporation - JAPAN First edition: March 1987 Text file typed by: Nestor Soriano (Konami Man) - SPAIN

More information

UNIT Applications of Programmable Logic Controllers (SCQF level 6)

UNIT Applications of Programmable Logic Controllers (SCQF level 6) National Unit Specification: general information CODE F5H0 12 SUMMARY This Unit is designed to develop the candidate s skills in solving typical industrial related problems by the application of Programmable

More information

U g CS for DJI Phantom 2 Vision+

U g CS for DJI Phantom 2 Vision+ U g CS for DJI Phantom 2 Vision+ Mobile companion application Copyright 2016, Smart Projects Holdings Ltd Contents Preface... 2 Drone connection and first run... 2 Before you begin... 2 First run... 2

More information

Technological Training Programs

Technological Training Programs Technological Training Programs On behalf of Noaman Engineering, I would like to introduce you to our training courses. All of our courses cover Theoretical, Practical, and software implementation and

More information

U g CS for DJI. Mobile companion application. Copyright 2016, Smart Projects Holdings Ltd

U g CS for DJI. Mobile companion application. Copyright 2016, Smart Projects Holdings Ltd U g CS for DJI Mobile companion application Copyright 2016, Smart Projects Holdings Ltd Contents Preface... 3 Drone connection and first run... 3 Before you begin... 3 First run... 3 Connecting smartphone

More information

MANUAL JCE-SERIES CHAPTER

MANUAL JCE-SERIES CHAPTER MANUAL JCE-SERIES CHAPTER 1 INTRODUCTION ------------------------------ 1 2 ASSEMBLY ------------------------------ 2 3 INSTALLATION ------------------------------ 2 4 PRECAUTION ------------------------------

More information

Perfect Machinery Baby Bar Feed Operators Manual Model # PA-300S

Perfect Machinery Baby Bar Feed Operators Manual Model # PA-300S Baby Bar 1 Baby Bar Feed Operators Manual Model # PA-300S 5241 Lincoln Ave, # B-2, Cypress, CA 90630 (714) 827-8811 (714) 827-8822 Fax www.perfectmachinery.com Baby Bar 2 Table of Contents Initial Conditions

More information

SERVICE MANUAL. Model: DS-425. Edition Month Year 1 st September nd December rd April th January 2002

SERVICE MANUAL. Model: DS-425. Edition Month Year 1 st September nd December rd April th January 2002 V1.0 SERVICE MANUAL Model: DS-425 Edition Month Year 1 st September 1998 2 nd December 1998 3 rd April 2001 4 th January 2002 Shanghai Teraoka Electronic Co., Ltd. --- Technical Service Dept. Ting Lin

More information

itemp Anywhere Wireless Sensors and Cellular Gateway User s Guide

itemp Anywhere Wireless Sensors and Cellular Gateway User s Guide Error Reporting, Troubleshooting and Support For technical support and troubleshooting tips please contact GreenTech Support email: info@greentechheat.com or 855-484-2847. itemp Anywhere Wireless Sensors

More information

Classification of Real-Time Systems

Classification of Real-Time Systems Lecture (2) Classification of Real-Time Systems Prof. Kasim M. Al-Aubidy Computer Engineering Department Philadelphia University Real-Time Systems Prof. Kasim Al-Aubidy 1 Lecture Outline: Historical background.

More information

Programmable Thermostat

Programmable Thermostat Programmable Thermostat Let's develop a simple application, a programmable thermostat. The front panel will be used as a user interface. Let's define some design rules. 1. Four modes of operation for the

More information

Operating instructions. METTLER TOLEDO MultiRange Application software IND690-Batch.

Operating instructions. METTLER TOLEDO MultiRange Application software IND690-Batch. Operating instructions METTLER TOLEDO MultiRange Application software IND690-Batch www.mt.com/support Congratulations on choosing the quality and precision of METTLER TOLEDO. Proper use according to these

More information

International Journal of Scientific & Engineering Research, Volume 7, Issue 3, March ISSN

International Journal of Scientific & Engineering Research, Volume 7, Issue 3, March ISSN International Journal of Scientific & Engineering Research, Volume 7, Issue 3, March-2016 1026 LIFI BASED AUTOMATED SMART TROLLEY USING RFID V.Padmapriya 1, R.Sangeetha 2, R.Suganthi 3, E.Thamaraiselvi

More information

Network Proximity Access Control System. 701 Server. User Manual

Network Proximity Access Control System. 701 Server. User Manual Network Proximity Access Control System 701 Server User Manual Ver. 6.20 1 Table of Contents Page 1. Introduction ------------------------------------------- 2 Brief introduction of 701 Server and 701

More information

Version Software User Guide

Version Software User Guide 06 Version 0.0. Software User Guide Long Range LLC. 6 Tannery Street Franklin, NH 05 Table of Contents Introduction Features... Included... Installation 5 Migrating Your Personal Access File... 7 Set Range

More information

PDM16 & PDM32 User Manual

PDM16 & PDM32 User Manual MoTeC PDM16 & PDM32 User Manual Contents Introduction... 3 Operation... 4 Configuration...4 PDM Manager Software...4 PC Connection...4 Configuration Concepts...4 Conditions...7 Switch Inputs...7 CAN Inputs...8

More information

Wastewater Treatment Example

Wastewater Treatment Example Wastewater Treatment Example Although the IP3416 does not have a built-in PID loop function, one is easy to implement in RLL. A common use for a PID loop is in the wastewater treatment process. Figure

More information

Chapter 3. Research Design and Methodology. 3.1 Introduction. 3.2 Assumptions

Chapter 3. Research Design and Methodology. 3.1 Introduction. 3.2 Assumptions Chapter 3 Research Design and Methodology 3.1 Introduction Main objective of this research is to develop models to automate Alum and Lime dosing for water treatment plant and to predict relationships between

More information

Design for Low-Power at the Electronic System Level Frank Schirrmeister ChipVision Design Systems

Design for Low-Power at the Electronic System Level Frank Schirrmeister ChipVision Design Systems Frank Schirrmeister ChipVision Design Systems franks@chipvision.com 1. Introduction 1.1. Motivation Well, it happened again. Just when you were about to beat the high score of your favorite game your portable

More information

2517 Mark Scheme June 2005

2517 Mark Scheme June 2005 1 (a) Describe the use of three software applications the student might use as part of an integrated office system. e.g. A word processor (1) to write letters to students. (1) A spreadsheet (1) to keep

More information

Onboard Failure Logging (OBFL)

Onboard Failure Logging (OBFL) 16 CHAPTER Prerequisites for OBFL, page 16-1 Restrictions for OBFL, page 16-2 Information About OBFL, page 16-2 Default Settings for OBFL, page 16-8 Enabling OBFL, page 16-9 Configuration Examples for

More information

Optoelectronics, Inc. Xplorer Serial Interface Specification. Interface Version 3.0

Optoelectronics, Inc. Xplorer Serial Interface Specification. Interface Version 3.0 Optoelectronics, Inc. Xplorer Serial Interface Specification Interface Version 3.0 February 25, 1998 INTRODUCTION This document describes the serial interface of the Xplorer, a hand-held test receiver

More information

ST-07 Series. Bill Validators. Operation Manual

ST-07 Series. Bill Validators. Operation Manual ST-07 Series Bill Validators Operation Manual 998-999 CashCode Co. Inc. Contents Page. Overview. 3. Main Parts..... 4 3. Precautions....... 5 4. Banknote Stacking.... 5 5. Banknote Jam....... 6 6. Maintenance..........

More information

Self-oscillating Half-bridge Power IC

Self-oscillating Half-bridge Power IC Self-oscillating Half-bridge Power IC Features Integrated half-bridge 440V power MOSFET Floating channel designed for bootstrap operation Noise immunity of transient voltage Under-voltage lockout Programmable

More information

EM643FV16FU Series Low Power, 256Kx16 SRAM

EM643FV16FU Series Low Power, 256Kx16 SRAM Document Title 256K x16 bit Super Low Power and Low Voltage Full CMOS Static RAM Revision History Revision No. History Draft Date Remark 0.0 Initial Draft May 26, 2003 Preliminary 0.1 2 nd Draft Add Pb-free

More information

Model 3185E DUAL TONE DECODER INSTRUCTION MANUAL

Model 3185E DUAL TONE DECODER INSTRUCTION MANUAL Model 3185E DUAL TONE DECODER INSTRUCTION MANUAL Monroe Electronics 100 Housel Ave Lyndonville NY 14098 phone 585-765-2254 fax 585-765-9330 monroe-electronics.com Printed in USA Copyright Monroe Electronics,

More information

Operating instructions, TC543 controller.

Operating instructions, TC543 controller. Operating instructions, TC543 controller. 1 The Out light indicates that the heating element is powered. The Aux light indicates the status of an auxiliary that can be associated to the cycle steps or

More information

Galaxy 300 and Galaxy 300i

Galaxy 300 and Galaxy 300i Galaxy 300 and Galaxy 300i 10-40 kva 380/400/415 V Operation 07/2016 www.schneider-electric.com Legal Information The Schneider Electric brand and any registered trademarks of Schneider Electric Industries

More information

TF20 Tray Feeder. Instruction Manual. for JEDEC and IEC Standard Trays

TF20 Tray Feeder. Instruction Manual. for JEDEC and IEC Standard Trays for JEDEC and IEC Standard Trays Instruction Manual 096-0243-003 Data I/O assumes no liability for errors, or for any incidental, consequential, indirect, or special damages, including, without limitation,

More information

BMW Scanner 1.3.6

BMW Scanner 1.3.6 BMW Scanner 1.3.6 First of all the list of supported units is much bigger for now. At this moment software supports almost all electronic units than could be installed on "old" chassis. In main menu you

More information

MULTIPOINT EARTH LEAKAGE RELAY CBS-8 SERIES USER S MANUAL

MULTIPOINT EARTH LEAKAGE RELAY CBS-8 SERIES USER S MANUAL MULTIPOINT EARTH LEAKAGE RELAY CBS-8 SERIES USER S MANUAL ( M 981 581 / 01D) (c) CIRCUTOR S.A. --------- Central of residual current relays CBS-8 -------- Page No. 1 CBS-8 USER S MANUAL CONTENT page 1.-

More information

BOOT PROM FLASH UPDATE V880

BOOT PROM FLASH UPDATE V880 BOOT PROM FLASH UPDATE V880 Sun Fire V480 and V880 With 900 MHz CPUs May Panic or "Red State" Due to Incorrect L2 SRAM Parameter Settings in Firmware Doc ID 55480 Date 10 July 03 V880 installation process.

More information

Weighing Indicator Version April 2009

Weighing Indicator Version April 2009 XK3190-C8 Weighing Indicator User Manual Version April 2009 Manufactured by Shanghai Yaohua Weighing System Co., Ltd. Contents Chapter 1 Profile ---------------------------------------------------------------------------------------------------------------2

More information

BMC-7 CONTROLLER MANUAL

BMC-7 CONTROLLER MANUAL BMC-7 CONTROLLER MANUAL 1-1-3236-900-00 REV L May 6, 2013 *Please check with the factory for latest version of this controller manual* IMPORTANT PLEASE OBSERVE ALL MOTOR POLYGON ASSEMBLY (MPA) SPECIFICATIONS

More information

Simplified Configuration Management and Qualification Testing for CubeSats

Simplified Configuration Management and Qualification Testing for CubeSats Simplified Configuration Management and Qualification Testing for CubeSats Keith Mashburn Space Science and Engineering Laboratory Montana State University August 11, 2008 1 Agenda Overview of Configuration

More information

IRIS Serial Configuration for Galaxy Upload/Download Connections:

IRIS Serial Configuration for Galaxy Upload/Download Connections: IRIS Serial Configuration for Galaxy Upload/Download Connections: This document outlines the configuration for both the IRIS dialler and the Galaxy Panel required to perform upload/download over IP connections.

More information

ic-mb4 AN3 EMBEDDED ACCESS GUIDELINE

ic-mb4 AN3 EMBEDDED ACCESS GUIDELINE Rev A2, Page 1/8 CONTENTS FIRST BASIC COMMUNICATION SEQUENCE 1 Test the communication interface....... 1 Reset and stopping prior started BiSS master activities.................. 1 BASIC CONFIGURATION

More information

Products to be discontinued. IC for System Reset (with built-in watchdog timer) Monolithic IC MM1099. Outline. Features. Packages.

Products to be discontinued. IC for System Reset (with built-in watchdog timer) Monolithic IC MM1099. Outline. Features. Packages. IC for System Reset (with built-in watchdog timer) Monolithic IC MM1099 March 31, 2004 Outline This IC functions in a variety of CPU systems and other logic systems to generate a reset signal and reset

More information

University of Florida Department of Electrical and Computer Engineering EEL 5666 Intelligent Machines Design Laboratory

University of Florida Department of Electrical and Computer Engineering EEL 5666 Intelligent Machines Design Laboratory University of Florida Department of Electrical and Computer Engineering EEL 5666 Intelligent Machines Design Laboratory Joshua Phillips Graffiti-Bot 4-25-2001 Table of Contents Abstract...pg. 03. Introduction...pg.

More information

Operating instructions. METTLER TOLEDO MultiRange Application software IND690-FormXP.

Operating instructions. METTLER TOLEDO MultiRange Application software IND690-FormXP. Operating instructions METTLER TOLEDO MultiRange Application software IND690-FormXP www.mt.com/support Congratulations on choosing the quality and precision of METTLER TOLEDO. Proper use according to these

More information