ELT SENSOR
USER Guide of U-ART for S-300L/S-300L-3V/ T-110L/T-110L-3V
Ver. 20160719A
38,400bps Baud Rate
1 Bit Stop Bit
No Parity Parity Bit
8 Bits Number of Bits
⃝ U-ART Specification
none Flow Control
6 byte CO2 density string D1~D6
Carriage Return : 0x0D CR
ppm string ppm
Line feed : 0x0A LF
Space : 0x20 SP
D6 D5 D4 D3 D2 D1 SP ‘P’ ‘P’ ‘M’ CR LF
⃝ U-ART Data Format
0≤VIL≤0.8, 2.0≤VIH≤ VDD, 0≤VOL≤0.4, 2.4≤VOH≤ VDD (Volt) for S-300/T-110
0≤VIL≤0.4, 2≤VIH≤VDD, 0≤VOL≤0.4, 2.4≤VOH≤VDD (Volt) for S-300-3V/T-110-3V
▶ TTL Level Voltage
1/10
2/30
CMD01 MCDL(10min. Recalibration) Start Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'M' 'C' 'D' 'L' 'S' 0x03
CMD03 Recalibration Value Deletion Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'C' 'L' 'E' A' 'R' 0x03
⃝ MCDL Command Set
HOST SENSOR
CMD01: MCDL Start Command
Response String ("MCDL_START¥r¥n")
After 15/25sec, S-300L-3V/T-110L-3V
save data to EEPROM within 10sec.
The result data saved to
EEPROM within 10sec.
CMD03: Recalibration Value Deletion Command
Response String ("RECAL_CLEAR¥r¥n")
Wait 1min.
after boot
The default data restored to
EEPROM within 10sec.
⃝ MCDL Control Sequence
2/10
3/30
CMD11 ACDL(Automatic Recalibration) Start Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 ‘A' 'C' 'D' 'L' 'S' 0x03
CMD12 ACDL(1Automatic Recalibration) End Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 ‘A' 'C' 'D' 'L' 'E' 0x03
CMD13 Recalibration Value Deletion Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'C' 'L' 'E' A' 'R' 0x03
⃝ ACDL Command Set
HOST SENSOR
CMD11: ACDL Start Command
Response String (“ACDL_START¥r¥n")
CMD12: ACDL Stop Command
Response String (“ACDL_STOP¥r¥n")
After
7days.
The result data saved to
EEPROM within 10sec.
CMD13: Recalibration Value Deletion Command
Response String ("RECAL_CLEAR¥r¥n")
Wait 1min.
after boot
The default data restored to
EEPROM within 10sec.
⃝ ACDL Control Sequence
3/10
⃝ ALARM Command Set HOST SENSOR
CMD05: Low Limit Value Setting Command of Alarm
Response String (“ALARM_LOW=B5_Bn¥r¥n")
⃝ ALARM Control Sequence
CMD05 Set the Low Limit Value of ALARM
Position B5-Bn Bn+1
Value
B0
0x02
B1 B2 B3 B4
'A' 'L' 'M' 'L' Low PPM(ex:"700") 0x03
CMD06 Set the High Limit Value of ALARM
Position B5-Bn Bn+1
Value
B0
0x02
B1 B2 B3 B4
'A' 'L' 'M' 'H' High PPM(ex:"1000") 0x03
CMD07 Set the Protection Time of ALARM
Position B5-Bn Bn+1
Value
B0
0x02
B1 B2 B3 B4
'A' 'L' 'M' 'P' Time(ex:"600") [sec] 0x03
Response : ex) "ALARM_LOW=700¥r¥n"
Response : ex) "ALARM_HIGH=1000¥r¥n"
Response : ex) "ALARM_PROTECT=120¥r¥n"
CMD08 Write the setting value
Position B6
Value
B0
0x02
B1 B2 B3 B4
'A' 'L' 'M' 'W' 0x03
B5
'R'
CMD09 Read the set value
Position B6
Value
B0
0x02
B1 B2 B3 B4
'A' 'L' 'M' 'R' 0x03
B5
'D'
Response : ex) "ALARM_WRITE¥r¥n"
Response : ex) "ALARM_PROTECT=120¥r¥n"
"ALARM_LOW=700¥r¥n"
"ALARM_HIGH=1000¥r¥n"
CMD06: High Limit Value Setting Command of Alarm
Response String (“ALARM_HIGH=B5_Bn¥r¥n")
CMD07: Protection Time Setting Command of Alarm
Response String (“ALARM_PROTECT=B5_Bn¥r¥n")
CMD08: Writing the Set Value Command of Alarm
Response String (“ALARM_WRITE¥r¥n")
CMD09: Reading the Set Value Command of Alarm
Response String (“ALARM_PROTECT=B5_Bn¥r¥n")
Response String (“ALARM_LOW=B5_Bn¥r¥n")
Response String (“ALARM_HIGH=B5_Bn¥r¥n")
* On finish of CMD05/06/07, Write Command (CMD08) should be sent to keep the changed set value for alarm by Power on.
4/10
⃝ Sleep Mode Start Command
HOST SENSOR
Normal Mode
⃝ SLEEP/AWAKE Control Sequence
CMD21 Sleep Mode Start (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'S' 'L' 'E' 'E' 'P' 0x03
CMD22 Wake-up Command , Ending the Sleep Mode) (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'A' 'W' 'A' 'K' 'E' 0x03
CMD21: Start of Sleep Mode Command
” Response String ("SLEEP¥r¥n")
CMD22: Wake-up Command, Ending Sleep mode
Response String ("WAKE_UP¥r¥n")
CO2 Concentration Data-1
CO2 Concentration Data-2
CO2 Concentration Data-N
⃝ Wake-up Command
5/10
⃝ Target PPM Start Command HOST SENSOR
⃝ TARGET PPM
CMD23 Target PPM Command (Host->Sensor)
Position B0 B1 B2 B3 B4 B5 B6
Value 0x02 'T' 'P' 'P' 'M' 0x20 1
CMD23: Start of Target Command
”
Response String ("TPPMr¥n")
6/10
Target PPM Command (Host->Sensor)
B11 B12 B13 B14 B15 B16
0x20 0x20 4 0 0 0x03
B10
>
B9
0
B8
0
B7
0
예) Target PPM 1000 ppm -> 400 ppm
Total 17 bytes 'TPPM' + Current ppm + '>' + Target ppm Current ppm : 5 Digit. Target ppm : 5 Digit. Target values reflects takes about more than 6 seconds after
command
⃝ Recommendations
Directive use range for minimize error to effective sensor value
PPM RANGE : 0 - 2000 ppm Target to up : 1000 ppm within differences, ex, 400 -> 1400(max) Target to down: 300 ppm within differences, ex 1000 -> 700(min)
Currently supported model
S300 3V, T110 3V
Packet
Period of Sampling
Data
POWER MODE
3 or 5 seconds 3 or 5 seconds
Current
Normal Mode Normal Mode Sleep Mode
Peak State
'Sleep-
Command
‘Wake-up
Command
Data N-1 Data N+1 Data N Data N
Sleep State
Normal State
Time
Lamp Turn On Lamp Turn On
⃝ Timing Diagram of Sleep
7/10
B. Pseudo code of UART Parser
8/10
Pseudo Code-1/3
//Circular Queue #define MAX_QUEUE_SIZE 20 char RxQueue[MAX_QUEUE_SIZE]; int QueWRPos=0; int QueRDPos=0; UARTx_ISR() { int iTmp; //..... iTmp=QueWRPos+1; if(iTmp>=MAX_QUEUE_SIZE){iTmp=0;}else{;} if(iTmp!=QueRDPos) {//Non-Overflow RxQueue[QueWRPos]=RXDATA; QueWRPos=iTmp; } else{;} //Overflow -> Discard data //..... } void UARTx_Process(void); int RXParser(void); void main() { while(1) { //..... UARTx_Process(); //..... } }
#define MAX_PACKET_SIZE 15 char RxBuff[MAX_PACKET_SIZE]; int RxWRPos=0; void UARTx_Process(void) { char cTmp; while(QueWRPos!=QueRDPos) { //Serialization cTmp=RxQueue[QueRDPos]; QueRDPos++; if(QueRDPos>=MAX_QUEUE_SIZE){QueRDPos=0;}else{;} RxBuff[RxWRPos]=cTmp; RxWRPos++; //0x0A=End of Packet if(cTmp==0x0A) { RxParser(); RxWRPos=0; return; } //Discard data on overflow else if(RxWRPos>=MAX_PACKET_SIZE) { RxWRPos=0; } else{;} }//End of While }
9/10
Pseudo Code-2/3
// Packet format : [D6][D5][D4][D3][D2][D1][SP]['p']['p']['m'][0x0D][0x0A] int RXParser(void) { int iPos,LP01; char *pSrcBuff; long RetPPM; //The data type is depend on MCU if(RxWRPos<7){return(-1);}else{;} //Minimum packet : [D1][SP]['p']['p']['m'][0x0D][0x0A] iPos=RxWRPos-7; pSrcBuff=&RxBuff[iPos]; if((pSrcBuff[1]!=0x20)|| (pSrcBuff[2]!='p')|| (pSrcBuff[3]!='p')|| (pSrcBuff[4]!='m')|| (pSrcBuff[5]!=0x0D)|| (pSrcBuff[6]!=0x0A)) { return(-1); }else{;} pSrcBuff[1]=0; //Insert the termination character in [SP] //Search the first character of PPM string pSrcBuff=NULL; for(LP01=0;LP01<=iPos;LP01++) { if(RxBuff[LP01]!=0x20) { pSrcBuff=&RxBuff[LP01]; break; }else{;} } if(pSrcBuff==NULL){return(-1);}else{;} RetPPM=atol(pSrcBuff); //or atoi(pSrcBuff) return(0); }
10/10
Pseudo Code-3/3