Problem with comparison.
/Designs/Measuring_instruments/RMDS01C/DOC/SRC/img/Sync_prototype.JPG
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Designs/Measuring_instruments/RMDS01C/DOC/SRC/RMDS.en.tex
0,0 → 1,131
\documentclass[12pt,a4paper,oneside]{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{pdfpages}
\textwidth 16cm \textheight 25cm
\topmargin -1.3cm
\oddsidemargin 0cm
\pagestyle{empty}
\begin{document}
\title{SDR meteor detector}
\author{Jakub Kákona, kaklik@mlab.cz }
\maketitle
 
\begin{abstract}
Construction of software defined radio meteor detector with possibility of advanced signal processing.
\end{abstract}
 
\begin{figure} [htbp]
\begin{center}
\includegraphics [width=80mm] {./img/meteor_detector_station.JPG}
\end{center}
\end{figure}
 
\begin{figure} [b]
\includegraphics [width=25mm] {./img/SDRX01B_QRcode.png}
\end{figure}
 
\newpage
\tableofcontents
 
\section{Technical parameters}
\begin{table}[htbp]
\begin{center}
\begin{tabular}{|c|c|p{5cm}|}
\hline
\multicolumn{1}{|c|}{Parameter} & \multicolumn{1}{|c|}{Value} & \multicolumn{1}{|c|}{Note} \\ \hline
Powering voltage for analogue part & $\pm$12V & 50mA \\ \hline
Powering voltage for digital part & +5V & 300mA \\ \hline
Bias of optional LNA & 9V & 500 mA maximum \footnote{Fused by 750mA on the reciver board} \\ \hline
Frequency range & 0,5 - 200 MHz & Usually working at 143.05 MHz \\ \hline
Gain & 90dB & Selectable by jumper and LNA configuration \\ \hline
Self noise number & $<$ 30dB & \\ \hline
\end{tabular}
\end{center}
\end{table}
 
\newpage
\section{Introduction}
 
The detection of meteors by radio is most readily accomplished by a method known as "forward scatter". This technique usually exploits the existence of a VHF radio transmitter intended for some other purpose (such as historically analogue radio or TV broadcasting) and which is preferably situated some way beyond the optical horizon so that the direct signal does not desensitise the receiving equipment. The radio signal reflects mainly from the ionised meteor trail as it forms and dissipates, causing a brief signal to be heard on or close to the transmitter frequency. The trails form in the ionosphere (i.e., the upper atmosphere) at a height of about 100 $\pm$ 20 km.
 
Direct reflection from the meteoroid itself is not so readily detected. Meteoroids are not necessarily reflective at radio frequencies, they are usually small (0.05 - 200mm) and they generally enter the ionosphere at supersonic velocities. Thus the direct signal is usually weak; and the initial Doppler shift is large, making it difficult to associate the signal with the transmitter. Sometimes however, a Doppler shifted signal is observed to slew onto or across the transmitter frequency at the beginning of the detection event. This is the reflection from the ball of plasma surrounding the meteoroid (as opposed to the trail left behind), and is known as the "head echo".
 
The term "radar" is sometimes used to describe the forward scatter detection method. Note however, that 'radar' is an acronym for 'radio direction and ranging' and so, although distance and direction information can be extracted from data aggregated from an array of receivers, a single receiver installation does not constitute a radar system. A single receiver can only strictly report an estimate of the number of meteoroids which enter the ionosphere in the region illuminated by the chosen radio transmitter. Other interesting aspects of the meteor strike can be inferred from the recorded signals, but apparently obvious information, such as the relationship between signal strength and meteoroid mass is complicated by issues such as signal polarisation, trajectory and transmitter coverage.
One advantage of radio detection is that it works when the sky is light or when the sky is dark but overcast. By choosing a sufficiently powerful host transmitter, it also possible to record meteors which are too faint for the human eye even in the darkest and clearest conditions. A figure of between 2 and 10 times as many meteors as can be seen by visual observation under ideal conditions is sometimes quoted; but this must depend on the transmitter power and radiation pattern.
 
\section{Description of construction}
 
This construction of radio meteor detector uses France GRAVES space-surveillance radar. The radar has transmitting power of several megawatts at frequency 143.05 MHz.
 
\subsection{Antenna}
The detector station usually uses modified ground plane antenna. Adjusted in angle of 30$^\circ$ to East this configuration seems to be optimal to detecting stations in the Czech Republic.
 
\begin{figure} [htbp]
\begin{center}
\includegraphics [width=80mm] {./img/GP143MHz.JPG}
\end{center}
\caption{Antenna used at detection station}
\end{figure}
 
The received signal from antenna is amplified by specially constructed LNA. This step is needed for feeding the signal trough relative long (several metres) coax RG58. Construction of LNA01A is described on MLAB project site.
 
\subsection{SDR receiver}
 
The SDR receiver used is MLAB system SDRX01B direct sampling receiver. This receiver has ideal performance for UHF and lower band radioastronomy. So this receiver can be used even for radio meteor detection.
 
\begin{figure} [htbp]
\begin{center}
\includegraphics [width=80mm] {./img/meteor-detector_receiver.JPG}
\end{center}
\caption{Example of meteor detector receiver setup}
\end{figure}
 
 
\begin{figure} [htbp]
\begin{center}
\includegraphics [width=150mm] {./img/zakladni_schema.png}
\end{center}
\caption{Schematic drawing of complete meteor detector}
\end{figure}
 
 
\subsection{Time synchronisation}
 
Time synchronisation has crucial importance in any modern science measurement. There is possibility of using many synchronisation techniques. Such as NTP or GPS (see for our article at for our experiences)
 
Suggested method for time synchronisation of a measuring station depends on level of desired information which would be obtained from meteor reflection event.
 
For example: If we need hour count data only. We can use PC system time without any synchronisation. But if we have one more station and we would like to compare data with another stations then NTP syncing would be good choice. Highest level is trail parameters determination which need true radar signal processing and most precise time synchronisation which could be achieved by GPS receiver.
 
\begin{figure}[htbp]
\begin{center}
\includegraphics [width=150mm] {./img/colorgram.png}
\end{center}
\caption{Example of measured hourly count of meteor showers}
\end{figure}
 
\section{Software setup}
 
For simple PC based monitor station we are using SpectrumLab software with our configuration and detection script.
 
Local oscillator of SDRX01B is a CLKGEN01B module with frequency tuning controller PIC18F4550v01A can be set up from PC or can be programmed for fixed start up frequency. If fixed start up frequency is correctly saved the only step for tuning the LO is provide power trough USB cable from PC and then press the RESET button of tuning microcomputer module. After that the LO shout be tuned on saved start up frequency. This frequency can be changed by
 
\begin{thebibliography}{99}
\bibitem{Spectrum_lab}{Spectrum Lab}
\href{http://www.qsl.net/dl4yhf/spectra1.html}{http://www.qsl.net/dl4yhf/spectra1.html}
 
\bibitem{Radio_meteor_detection}{Radio Meteor Detection}
\href{http://www.gb2nlo.org/index.php/articles/meteordet}{http://www.gb2nlo.org/index.php/articles/meteordet}
 
\bibitem{meteor_distance}{Meteor distance parameters}
\href{http://www.amsmeteors.org/richardson/distance.html}{http://www.amsmeteors.org/richardson/distance.html}
 
 
 
 
\end{thebibliography}
\end{document}
/Designs/Measuring_instruments/RMDS01C/DOC/RMDS.en.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Designs/Measuring_instruments/RMDS01C/PrjInfo.txt
0,0 → 1,16
[InfoShortDescription.en]
Radio Meteor Detection Station with GPS
 
[InfoShortDescription.cs]
Stanice pro radiovou detekci meteorů s GPS
 
[InfoLongDescription.en]
 
Radio meteor trail detection set. It is upgraded by GPS time and frequency synchronization to determining itner-station reflection variation and doppler shift.
 
[InfoLongDescription.cs]
 
Set pro radiovou detekci meteorů. Je rozšířen o časovou synchronizaci a kmitočtovou stabilizaci LO k určení variací a doplerovského posunu odrazu přijatého několika stanicemi.
 
 
[End]
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.c
0,0 → 1,101
#include "main.h"
 
 
#define LED PIN_E1
#define CE PIN_E2
 
int16 count;
 
int8 rcv_buf[0x10]; // I2C receive buffer
int8 snd_buf[0x10]; // I2C send buffer
 
int8 buffer[0x10]; // I2C buffer
int8 address;
 
const char cmd[40]={0xB5, 0x62, 0x06, 0x31, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x80, 0x84, 0x1E, 0x00, 0xE0, 0xC8, 0x10, 0x00, 0x40, 0x42, 0x0F, 0x00, 0xA0, 0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0x12, 0x03};
 
#INT_SSP
void ssp_interupt ()
{
BYTE incoming, state;
 
state = i2c_isr_state();
if(state < 0x80) //Master is sending data
{
incoming = i2c_read();
if(state == 1) //First received byte is address
{
address = incoming;
if (incoming == 2)
{
buffer[0]=make8(count,0);
buffer[1]=make8(count,1);
}
}
if(state == 2) //Second received byte is data
buffer[address] = incoming;
}
if(state == 0x80) //Master is requesting data
{
i2c_write(buffer[address]);
}
}
 
 
#int_TIMER2 // every 10 ms
void TIMER2_isr(void)
{
output_low(CE);
count=get_timer1();
set_timer1(0);
output_high(CE);
}
 
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
// setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
// setup_wdt(WDT_144MS);
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);
setup_timer_2(T2_DIV_BY_16,196,16);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
delay_ms(1000);
int n;
for (n=0;n<40;n++)
{
putc(cmd[n]);
}
 
printf("cvak...\r\n");
// snd_buf[2]=0x55;
// snd_buf[3]=0xAA;
set_timer1(0);
enable_interrupts(INT_SSP);
// enable_interrupts(INT_TIMER2);
enable_interrupts(GLOBAL);
 
while(true)
{
output_high(LED);
output_low(LED);
set_timer1(0);
output_high(CE);
delay_ms(999);
delay_us(966);
output_low(CE);
count=get_timer1();
printf("count: %Lu %X %X %X %X\r\n",count, buffer[0],buffer[1],buffer[2],buffer[3]);
}
}
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.err
0,0 → 1,4
>>> Warning 202 "Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC887\main.h" Line 19(5,8): Variable never used: rs232_errors
>>> Warning 202 "main.c" Line 9(6,13): Variable never used: rcv_buf
Memory usage: ROM=10% RAM=18% - 22%
0 Errors, 2 Warnings.
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.esym
0,0 → 1,432
D G "__PCM__" 0 0 ""4.106""
D G "__DEVICE__" 0 0 ""
D G "__DATE__" 0 0 ""01-II-14""
D G "__TIME__" 0 0 ""20:13:30"" "Standard Header file for the PIC16F887 device ////////////////"
d G "PIN_A0" 2 20 "40"
d G "PIN_A1" 2 21 "41"
d G "PIN_A2" 2 22 "42"
d G "PIN_A3" 2 23 "43"
d G "PIN_A4" 2 24 "44"
d G "PIN_A5" 2 25 "45"
d G "PIN_A6" 2 26 "46"
d G "PIN_A7" 2 27 "47"
d G "PIN_B0" 2 29 "48"
d G "PIN_B1" 2 30 "49"
d G "PIN_B2" 2 31 "50"
d G "PIN_B3" 2 32 "51"
d G "PIN_B4" 2 33 "52"
d G "PIN_B5" 2 34 "53"
d G "PIN_B6" 2 35 "54"
d G "PIN_B7" 2 36 "55"
d G "PIN_C0" 2 38 "56"
d G "PIN_C1" 2 39 "57"
d G "PIN_C2" 2 40 "58"
d G "PIN_C3" 2 41 "59"
d G "PIN_C4" 2 42 "60"
d G "PIN_C5" 2 43 "61"
d G "PIN_C6" 2 44 "62"
d G "PIN_C7" 2 45 "63"
d G "PIN_D0" 2 47 "64"
d G "PIN_D1" 2 48 "65"
d G "PIN_D2" 2 49 "66"
d G "PIN_D3" 2 50 "67"
d G "PIN_D4" 2 51 "68"
d G "PIN_D5" 2 52 "69"
d G "PIN_D6" 2 53 "70"
d G "PIN_D7" 2 54 "71"
d G "PIN_E0" 2 56 "72"
d G "PIN_E1" 2 57 "73"
d G "PIN_E2" 2 58 "74"
d G "PIN_E3" 2 59 "75"
d G "FALSE" 2 62 "0"
d G "TRUE" 2 63 "1"
d G "BYTE" 2 65 "int8"
d G "BOOLEAN" 2 66 "int1"
d G "getc" 2 68 "getch"
d G "fgetc" 2 69 "getch"
d G "getchar" 2 70 "getch"
d G "putc" 2 71 "putchar"
d G "fputc" 2 72 "putchar"
d G "fgets" 2 73 "gets"
d G "fputs" 2 74 "puts"
d G "WDT_FROM_SLEEP" 2 79 "3"
d G "WDT_TIMEOUT" 2 80 "11"
d G "MCLR_FROM_SLEEP" 2 81 "19"
d G "MCLR_FROM_RUN" 2 82 "27"
d G "NORMAL_POWER_UP" 2 83 "25"
d G "BROWNOUT_RESTART" 2 84 "26"
d G "T0_INTERNAL" 2 91 "0"
d G "T0_EXT_L_TO_H" 2 92 "32"
d G "T0_EXT_H_TO_L" 2 93 "48"
d G "T0_DIV_1" 2 95 "8"
d G "T0_DIV_2" 2 96 "0"
d G "T0_DIV_4" 2 97 "1"
d G "T0_DIV_8" 2 98 "2"
d G "T0_DIV_16" 2 99 "3"
d G "T0_DIV_32" 2 100 "4"
d G "T0_DIV_64" 2 101 "5"
d G "T0_DIV_128" 2 102 "6"
d G "T0_DIV_256" 2 103 "7"
d G "T0_8_BIT" 2 106 "0"
d G "RTCC_INTERNAL" 2 108 "0" "The following are provided for compatibility"
d G "RTCC_EXT_L_TO_H" 2 109 "32" "with older compiler versions"
d G "RTCC_EXT_H_TO_L" 2 110 "48"
d G "RTCC_DIV_1" 2 111 "8"
d G "RTCC_DIV_2" 2 112 "0"
d G "RTCC_DIV_4" 2 113 "1"
d G "RTCC_DIV_8" 2 114 "2"
d G "RTCC_DIV_16" 2 115 "3"
d G "RTCC_DIV_32" 2 116 "4"
d G "RTCC_DIV_64" 2 117 "5"
d G "RTCC_DIV_128" 2 118 "6"
d G "RTCC_DIV_256" 2 119 "7"
d G "RTCC_8_BIT" 2 120 "0"
d G "WDT_18MS" 2 132 "8"
d G "WDT_36MS" 2 133 "9"
d G "WDT_72MS" 2 134 "10"
d G "WDT_144MS" 2 135 "11"
d G "WDT_288MS" 2 136 "12"
d G "WDT_576MS" 2 137 "13"
d G "WDT_1152MS" 2 138 "14"
d G "WDT_2304MS" 2 139 "15"
d G "WDT_ON" 2 143 "0x4100"
d G "WDT_OFF" 2 144 "0"
d G "WDT_DIV_16" 2 145 "0x100"
d G "WDT_DIV_8" 2 146 "0x300"
d G "WDT_DIV_4" 2 147 "0x500"
d G "WDT_DIV_2" 2 148 "0x700"
d G "WDT_TIMES_1" 2 149 "0x900" "Default"
d G "WDT_TIMES_2" 2 150 "0xB00"
d G "WDT_TIMES_4" 2 151 "0xD00"
d G "WDT_TIMES_8" 2 152 "0xF00"
d G "WDT_TIMES_16" 2 153 "0x1100"
d G "WDT_TIMES_32" 2 154 "0x1300"
d G "WDT_TIMES_64" 2 155 "0x1500"
d G "WDT_TIMES_128" 2 156 "0x1700"
d G "T1_DISABLED" 2 162 "0"
d G "T1_INTERNAL" 2 163 "5"
d G "T1_EXTERNAL" 2 164 "7"
d G "T1_EXTERNAL_SYNC" 2 165 "3"
d G "T1_CLK_OUT" 2 167 "8"
d G "T1_DIV_BY_1" 2 169 "0"
d G "T1_DIV_BY_2" 2 170 "0x10"
d G "T1_DIV_BY_4" 2 171 "0x20"
d G "T1_DIV_BY_8" 2 172 "0x30"
d G "T1_GATE" 2 174 "0x40"
d G "T1_GATE_INVERTED" 2 175 "0xC0"
d G "T2_DISABLED" 2 180 "0"
d G "T2_DIV_BY_1" 2 181 "4"
d G "T2_DIV_BY_4" 2 182 "5"
d G "T2_DIV_BY_16" 2 183 "6"
d G "CCP_OFF" 2 189 "0"
d G "CCP_CAPTURE_FE" 2 190 "4"
d G "CCP_CAPTURE_RE" 2 191 "5"
d G "CCP_CAPTURE_DIV_4" 2 192 "6"
d G "CCP_CAPTURE_DIV_16" 2 193 "7"
d G "CCP_COMPARE_SET_ON_MATCH" 2 194 "8"
d G "CCP_COMPARE_CLR_ON_MATCH" 2 195 "9"
d G "CCP_COMPARE_INT" 2 196 "0xA"
d G "CCP_COMPARE_RESET_TIMER" 2 197 "0xB"
d G "CCP_PWM" 2 198 "0xC"
d G "CCP_PWM_PLUS_1" 2 199 "0x1c"
d G "CCP_PWM_PLUS_2" 2 200 "0x2c"
d G "CCP_PWM_PLUS_3" 2 201 "0x3c"
d G "CCP_PWM_H_H" 2 206 "0x0c"
d G "CCP_PWM_H_L" 2 207 "0x0d"
d G "CCP_PWM_L_H" 2 208 "0x0e"
d G "CCP_PWM_L_L" 2 209 "0x0f"
d G "CCP_PWM_FULL_BRIDGE" 2 211 "0x40"
d G "CCP_PWM_FULL_BRIDGE_REV" 2 212 "0xC0"
d G "CCP_PWM_HALF_BRIDGE" 2 213 "0x80"
d G "CCP_SHUTDOWN_ON_COMP1" 2 215 "0x100000"
d G "CCP_SHUTDOWN_ON_COMP2" 2 216 "0x200000"
d G "CCP_SHUTDOWN_ON_COMP" 2 217 "0x300000"
d G "CCP_SHUTDOWN_ON_INT0" 2 218 "0x400000"
d G "CCP_SHUTDOWN_ON_COMP1_INT0" 2 219 "0x500000"
d G "CCP_SHUTDOWN_ON_COMP2_INT0" 2 220 "0x600000"
d G "CCP_SHUTDOWN_ON_COMP_INT0" 2 221 "0x700000"
d G "CCP_SHUTDOWN_AC_L" 2 223 "0x000000"
d G "CCP_SHUTDOWN_AC_H" 2 224 "0x040000"
d G "CCP_SHUTDOWN_AC_F" 2 225 "0x080000"
d G "CCP_SHUTDOWN_BD_L" 2 227 "0x000000"
d G "CCP_SHUTDOWN_BD_H" 2 228 "0x010000"
d G "CCP_SHUTDOWN_BD_F" 2 229 "0x020000"
d G "CCP_SHUTDOWN_RESTART" 2 231 "0x80000000"
d G "CCP_PULSE_STEERING_A" 2 233 "0x01000000"
d G "CCP_PULSE_STEERING_B" 2 234 "0x02000000"
d G "CCP_PULSE_STEERING_C" 2 235 "0x04000000"
d G "CCP_PULSE_STEERING_D" 2 236 "0x08000000"
d G "CCP_PULSE_STEERING_SYNC" 2 237 "0x10000000"
d G "SPI_MASTER" 2 245 "0x20"
d G "SPI_SLAVE" 2 246 "0x24"
d G "SPI_L_TO_H" 2 247 "0"
d G "SPI_H_TO_L" 2 248 "0x10"
d G "SPI_CLK_DIV_4" 2 249 "0"
d G "SPI_CLK_DIV_16" 2 250 "1"
d G "SPI_CLK_DIV_64" 2 251 "2"
d G "SPI_CLK_T2" 2 252 "3"
d G "SPI_SS_DISABLED" 2 253 "1"
d G "SPI_SAMPLE_AT_END" 2 255 "0x8000"
d G "SPI_XMIT_L_TO_H" 2 256 "0x4000"
d G "UART_ADDRESS" 2 262 "2"
d G "UART_DATA" 2 263 "4"
d G "UART_AUTODETECT" 2 264 "8"
d G "UART_AUTODETECT_NOWAIT" 2 265 "9"
d G "UART_WAKEUP_ON_RDA" 2 266 "10"
d G "UART_SEND_BREAK" 2 267 "13"
d G "NC_NC_NC_NC" 2 273 "0x00"
d G "NC_NC" 2 274 "0x00"
d G "CP1_A0_A3" 2 277 "0x00090080"
d G "CP1_A1_A3" 2 278 "0x000A0081"
d G "CP1_B3_A3" 2 279 "0x00880082"
d G "CP1_B1_A3" 2 280 "0x00280083"
d G "CP1_A0_VREF" 2 281 "0x00010084"
d G "CP1_A1_VREF" 2 282 "0x00020085"
d G "CP1_B3_VREF" 2 283 "0x00800086"
d G "CP1_B1_VREF" 2 284 "0x00200087"
d G "CP1_OUT_ON_A4" 2 286 "0x00000020"
d G "CP1_INVERT" 2 287 "0x00000010"
d G "CP1_ABSOLUTE_VREF" 2 288 "0x20000000"
d G "CP2_A0_A2" 2 291 "0x00058000"
d G "CP2_A1_A2" 2 292 "0x00068100"
d G "CP2_B3_A2" 2 293 "0x00848200"
d G "CP2_B1_A2" 2 294 "0x00248300"
d G "CP2_A0_VREF" 2 295 "0x00018400"
d G "CP2_A1_VREF" 2 296 "0x00028500"
d G "CP2_B3_VREF" 2 297 "0x00808600"
d G "CP2_B1_VREF" 2 298 "0x00208700"
d G "CP2_OUT_ON_A5" 2 300 "0x00002000"
d G "CP2_INVERT" 2 301 "0x00001000"
d G "CP2_ABSOLUTE_VREF" 2 302 "0x10000000"
d G "CP2_T1_SYNC" 2 305 "0x01000000"
d G "CP2_T1_GATE" 2 306 "0x02000000"
d G "VREF_LOW" 2 315 "0xa0"
d G "VREF_HIGH" 2 316 "0x80"
d G "OSC_31KHZ" 2 322 "1"
d G "OSC_125KHZ" 2 323 "0x11"
d G "OSC_250KHZ" 2 324 "0x21"
d G "OSC_500KHZ" 2 325 "0x31"
d G "OSC_1MHZ" 2 326 "0x41"
d G "OSC_2MHZ" 2 327 "0x51"
d G "OSC_4MHZ" 2 328 "0x61"
d G "OSC_8MHZ" 2 329 "0x71"
d G "OSC_INTRC" 2 330 "1"
d G "OSC_NORMAL" 2 331 "0"
d G "OSC_STATE_STABLE" 2 333 "4"
d G "OSC_31KHZ_STABLE" 2 334 "2"
d G "ADC_OFF" 2 342 "0" "ADC Off"
d G "ADC_CLOCK_DIV_2" 2 343 "0x100"
d G "ADC_CLOCK_DIV_8" 2 344 "0x40"
d G "ADC_CLOCK_DIV_32" 2 345 "0x80"
d G "ADC_CLOCK_INTERNAL" 2 346 "0xc0" "Internal 2-6us"
d G "sAN0" 2 350 "1" "| A0"
d G "sAN1" 2 351 "2" "| A1"
d G "sAN2" 2 352 "4" "| A2"
d G "sAN3" 2 353 "8" "| A3"
d G "sAN4" 2 354 "16" "| A5"
d G "sAN5" 2 355 "32" "| E0"
d G "sAN6" 2 356 "64" "| E1"
d G "sAN7" 2 357 "128" "| E2"
d G "sAN8" 2 358 "0x10000" "| B2"
d G "sAN9" 2 359 "0x20000" "| B3"
d G "sAN10" 2 360 "0x40000" "| B1"
d G "sAN11" 2 361 "0x80000" "| B4"
d G "sAN12" 2 362 "0x100000" "| B0"
d G "sAN13" 2 363 "0x200000" "| B5"
d G "NO_ANALOGS" 2 364 "0" "None"
d G "ALL_ANALOG" 2 365 "0x1F00FF" "A0 A1 A2 A3 A5 E0 E1 E2 B0 B1 B2 B3 B4 B5"
d G "VSS_VDD" 2 368 "0x0000" "| Range 0-Vdd"
d G "VSS_VREF" 2 369 "0x1000" "| Range 0-Vref"
d G "VREF_VREF" 2 370 "0x3000" "| Range Vref-Vref"
d G "VREF_VDD" 2 371 "0x2000" "| Range Vref-Vdd"
d G "ADC_START_AND_READ" 2 375 "7" "This is the default if nothing is specified"
d G "ADC_START_ONLY" 2 376 "1"
d G "ADC_READ_ONLY" 2 377 "6"
d G "L_TO_H" 2 389 "0x40"
d G "H_TO_L" 2 390 "0"
d G "GLOBAL" 2 392 "0x0BC0"
d G "INT_RTCC" 2 393 "0x000B20"
d G "INT_RB" 2 394 "0x01FF0B08"
d G "INT_EXT_L2H" 2 395 "0x50000B10"
d G "INT_EXT_H2L" 2 396 "0x60000B10"
d G "INT_EXT" 2 397 "0x000B10"
d G "INT_AD" 2 398 "0x008C40"
d G "INT_TBE" 2 399 "0x008C10"
d G "INT_RDA" 2 400 "0x008C20"
d G "INT_TIMER1" 2 401 "0x008C01"
d G "INT_TIMER2" 2 402 "0x008C02"
d G "INT_CCP1" 2 403 "0x008C04"
d G "INT_CCP2" 2 404 "0x008D01"
d G "INT_SSP" 2 405 "0x008C08"
d G "INT_BUSCOL" 2 406 "0x008D08"
d G "INT_EEPROM" 2 407 "0x008D10"
d G "INT_TIMER0" 2 408 "0x000B20"
d G "INT_OSC_FAIL" 2 409 "0x008D80"
d G "INT_COMP" 2 410 "0x008D20"
d G "INT_COMP2" 2 411 "0x008D40"
d G "INT_ULPWU" 2 412 "0x008D04"
d G "INT_RB0" 2 413 "0x0010B08"
d G "INT_RB1" 2 414 "0x0020B08"
d G "INT_RB2" 2 415 "0x0040B08"
d G "INT_RB3" 2 416 "0x0080B08"
d G "INT_RB4" 2 417 "0x0100B08"
d G "INT_RB5" 2 418 "0x0200B08"
d G "INT_RB6" 2 419 "0x0400B08"
d G "INT_RB7" 2 420 "0x0800B08"
D G "LED" 0 4 "PIN_E1"
D G "CE" 0 5 "PIN_E2"
V G "count" 0 7 "int16"
V G "rcv_buf" 0 9 "int8[16]" "I2C receive buffer"
V G "snd_buf" 0 10 "int8[16]" "I2C send buffer"
V G "buffer" 0 12 "int8[16]" "I2C buffer"
V G "address" 0 13 "int8"
V G "cmd" 0 15 "int8[40]"
F G "ssp_interupt" 0 18 "void()"
V L "incoming" 0 20 "int8"
V L "state" 0 20 "int8"
C L "ssp_interupt" 0 24 1 "FUNCTION"
C L "ssp_interupt" 0 24 1 "FUNCTION"
C L "ssp_interupt" 0 24 1 "FUNCTION"
C L "ssp_interupt" 0 24 1 "FUNCTION"
F G "TIMER2_isr" 0 49 "void()"
F G "MAIN" 0 58 "void()"
C L "MAIN" 0 24 1 "FUNCTION"
C L "MAIN" 0 24 1 "FUNCTION"
V L "n" 0 72 "int8"
C L "MAIN" 0 24 1 "FUNCTION"
F B "reset_cpu" 0 0
F B "abs" 1 0
F B "sleep_ulpwu" 1 0
F B "sleep" 0 0
F B "delay_cycles" 1 0
F B "read_bank" 2 0
F B "write_bank" 3 0
F B "shift_left" 2 2
F B "shift_right" 2 2
F B "rotate_left" 2 0
F B "rotate_right" 2 0
F B "_mul" 2 0
F B "memset" 3 0
F B "isamoung" 2 0
F B "isamong" 2 0
F B "bit_set" 2 0
F B "bit_clear" 2 0
F B "bit_test" 2 0
F B "toupper" 1 0
F B "tolower" 1 0
F B "swap" 1 0
F B "printf" 1 255
F B "fprintf" 1 255
F B "sprintf" 1 255
F B "make8" 2 0
F B "make16" 2 0
F B "make32" 1 255
F B "label_address" 1 1
F B "goto_address" 1 0
F B "_va_arg" 1 0
F B "offsetofbit" 2 2
F B "enable_interrupts" 1 0
F B "disable_interrupts" 1 0
F B "interrupt_active" 1 0
F B "clear_interrupt" 1 0
F B "jump_to_isr" 1 0
F B "ext_int_edge" 1 2
F B "read_eeprom" 1 0
F B "write_eeprom" 2 0
F B "read_program_eeprom" 1 0
F B "write_program_eeprom" 2 0
F B "write_program_memory" 4 0
F B "write_program_memory8" 4 0
F B "read_program_memory" 4 0
F B "read_program_memory8" 4 0
F B "erase_program_eeprom" 1 0
F B "strcpy" 2 0
F B "memcpy" 3 0
F B "strstr100" 2 0
F B "output_high" 1 0
F B "output_low" 1 0
F B "input" 1 0
F B "input_state" 1 0
F B "output_float" 1 0
F B "output_drive" 1 0
F B "output_bit" 1 1
F B "output_toggle" 1 0
F B "output_a" 1 0
F B "output_b" 1 0
F B "output_c" 1 0
F B "output_d" 1 0
F B "output_e" 1 0
F B "input_a" 0 0
F B "input_b" 0 0
F B "input_c" 0 0
F B "input_d" 0 0
F B "input_e" 0 0
F B "set_tris_a" 1 0
F B "set_tris_b" 1 0
F B "set_tris_c" 1 0
F B "set_tris_d" 1 0
F B "set_tris_e" 1 0
F B "get_tris_a" 0 0
F B "get_tris_b" 0 0
F B "get_tris_c" 0 0
F B "get_tris_d" 0 0
F B "get_tris_e" 0 0
F B "input_change_a" 0 0
F B "input_change_b" 0 0
F B "input_change_c" 0 0
F B "input_change_d" 0 0
F B "input_change_e" 0 0
F B "port_b_pullups" 1 0
F B "setup_counters" 2 0
F B "setup_wdt" 1 0
F B "restart_cause" 0 0
F B "restart_wdt" 0 0
F B "get_rtcc" 0 0
F B "set_rtcc" 1 0
F B "get_timer0" 0 0
F B "set_timer0" 1 0
F B "setup_comparator" 1 0
F B "setup_port_a" 1 0
F B "setup_adc_ports" 1 0
F B "setup_adc" 1 0
F B "set_adc_channel" 1 0
F B "read_adc" 0 1
F B "adc_done" 0 0
F B "setup_timer_0" 1 0
F B "setup_vref" 1 0
F B "setup_timer_1" 1 0
F B "get_timer1" 0 0
F B "set_timer1" 1 0
F B "setup_timer_2" 3 0
F B "get_timer2" 0 0
F B "set_timer2" 1 0
F B "setup_ccp1" 1 2
F B "set_pwm1_duty" 1 0
F B "setup_ccp2" 1 0
F B "set_pwm2_duty" 1 0
F B "setup_oscillator" 1 2
F B "setup_spi" 1 0
F B "spi_read" 0 1
F B "spi_write" 1 0
F B "spi_data_is_in" 0 0
F B "setup_spi2" 1 0
F B "spi_read2" 0 1
F B "spi_write2" 1 0
F B "spi_data_is_in2" 0 0
F B "brownout_enable" 1 0
F B "delay_ms" 1 0
F B "delay_us" 1 0
F B "putchar" 1 2
F B "puts" 1 2
F B "getch" 0 1
F B "gets" 1 3
F B "kbhit" 0 1
F B "set_uart_speed" 1 3
F B "setup_uart" 1 3
F B "i2c_read" 0 2
F B "i2c_write" 1 2
F B "i2c_start" 0 2
F B "i2c_stop" 0 1
F B "i2c_isr_state" 0 1
F B "i2c_slaveaddr" 1 2
F B "i2c_poll" 0 1
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.h
0,0 → 1,25
#include <16F887.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOWRT //Program memory not write protected
#FUSES BORV40 //Brownout reset at 4.0V
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors)
 
//NOTE: Must declare MASTER before SLAVE, i2c_isr_state() returns 0
// when MASTER is the most recent #use i2c
//#use i2c(MASTER, sda=PIN_C1, scl=PIN_C0, stream=I2CM)
#use i2c(SLAVE, Fast, sda=PIN_C4, scl=PIN_C3, force_hw, address=0xA0)
 
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.hex
0,0 → 1,103
:1000000002308A001C2A0000FF00030E8301A100B9
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A600831383128C30F7
:100030008400801C1D288C1834288C308400801D7E
:1000400023288C193728220884002308F700240865
:10005000F8002508F9002608FA0020088A00210E79
:100060008300FF0E7F0E09008A110A12B0288A1140
:100070000A1266280A108A100A118207B5346234FF
:100080000634313420340034003400340034003479
:100090003234003400340034803484341E3400346C
:1000A000E034C83410340034403442340F34003467
:1000B000A034863401340034003400340034003479
:1000C000F734003400340034123403348316941AA5
:1000D00071288312DC018316141D71288312DC172A
:1000E000831683125C08DC0AE80068087F3C031C66
:1000F000952814138C1D7A2813081416E700680B32
:100100008B286708DB006708023C031D8B28290841
:10011000CB002A08CC006808023C031D95284B3010
:100120005B0784008313670880006808803C031D18
:10013000AC284B305B07840083130008E900690892
:10014000EA006A08930014168C1183161418A62866
:10015000F8018312141AF80A8C118A110A12232842
:1001600083160911831209110F08FA000E08F7000F
:100170000F087A02031DB4287708A9007A08AA009C
:100180008F018E0183160911831209158C108A11B3
:100190000A122328633BE1352E17AE060A00E33727
:1001A0007537741DA012CC3AA0125810252CA0123D
:1001B0005810252C0D0500005F30840083130008C3
:1001C0000319EF280630F800F701F70BE528F80BC4
:1001D000E4287B30F700F70BEB28800BE2280800BF
:1001E000831603178C170C140000000083120C08F0
:1001F0007F39031936290313DE0003170D08031393
:10020000DF0003170F080313E0005E080C1E062929
:1002100099005F0803178D000313600803178F0010
:1002200083168C170C140000000083120C0D0E0DA9
:100230007F39031936290313DE0003170D08031352
:10024000DF0003170F080313E0005E080C1E2629C9
:1002500099005F0803178D000313600803178F00D0
:100260008D0A03198F0A0313F028031703138A1149
:100270000A129C2A0330DF02031C48295F308400E5
:10028000831300080319482946294629800B45296C
:100290008A110A12C12A831603178C170C14000046
:1002A000000003187B2983120C087F390313DF0039
:1002B00003170D080313E00003170F080313E100F1
:1002C0005F080C1E61299900600803178D00031355
:1002D000610803178F0083168C170C1400000000B0
:1002E00083120313DE0B75297829831603177B29E4
:1002F0009B298316031783120C0D0E0D7F390313F0
:10030000DF0003170D080313E00003170F080313A2
:10031000E1005F080C1E8A299900600803178D0010
:100320000313610803178F008D0A03198F0A031046
:100330000313DE0B4B298A110A12DD2AE601040899
:10034000E5006610831B66145F0EF038E100E107DC
:10035000E23EE200323EE4005F080F39E207E207C6
:10036000E407E93EE300E307E3075E0E0F39E30726
:10037000E407E30DE40DE409E40D5E080F39E4073A
:10038000E10D0730E0000A30E407E303031CC42951
:10039000E307E203031CC829E207E103031CCC299D
:1003A000E107E003031CD029603084008313073089
:1003B0006505651384076430040203196517000896
:1003C000F700031DEB29651BEB29651AF329E519D5
:1003D000EB292030EE29E51565123030F707770854
:1003E0000C1EF0299900840A651FDB298A110A1264
:1003F000E42ADF1B0C2A0F30F7005E0EF7050A30E7
:1004000077020318062A3030F707082A5F08F70733
:1004100077080C1E092A99000F30DE050A305E02AB
:100420000318142A3030162ADF135F08DE075E082F
:100430000C1E182A99000800840183131F308305BD
:1004400083160317871508300313990002309A00AA
:10045000A6309800903083129800A81528088316BB
:10046000870083122816280883168700A03093007F
:10047000363083129400831603170908C0398900A7
:1004800003131F129F120030031788008312870185
:10049000880189010313A701FF30A8000330DC00A5
:1004A000831603170908C039890003131F129F120E
:1004B000003003178800831203131F1083160108EE
:1004C000C739083881000730831290007830F8006F
:1004D00006389200C430831692008312281528082B
:1004E000831687008312970183169B019C010130BC
:1004F0009D00831203178701880189018316031366
:10050000970104308312DE00FA30DF00DC20DE0BBE
:10051000842ADD015D08273C031C952A5D083A20EA
:100520000C1E902A9900DD0A8A2ACA3003178D0012
:1005300000308F000313F0285530BD00AA30BE00F4
:100540008F018E0183168C15C03083128B048316A5
:1005500089108312891483168910831289108F01E0
:100560008E0183160911831209150930DE006F30E0
:10057000DF00DC20DE0BB72A0630DE00A030DF0013
:100580003A29DE0BBE2A83160911831209110F08BE
:10059000FA000E08F7000F087A02031DC72A770831
:1005A000A9007A08AA00CF3003178D0000308F0011
:1005B000031007300313DE004B29103084002A0893
:1005C000DF002908DE009E2920300C1EE52A990054
:1005D0004B08DE003730DF00F92120300C1EEE2AF8
:1005E00099004C08DE003730DF00F92120300C1E66
:1005F000F72A99004D08DE003730DF00F92120305E
:100600000C1E002B99004E08DE003730DF00F92168
:100610000D300C1E092B99000A300C1E0D2B990071
:04062000A72A6300A2
:04400E00F22CFF3F52
:00000001FF
;PIC16F887
;CRC=C1DB CREATED="01-II-14 20:13"
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.lst
0,0 → 1,588
CCS PCM C Compiler, Version 4.106, 47914 01-II-14 20:13
 
Filename: Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC887\main.lst
 
ROM used: 786 words (10%)
Largest free fragment is 2048
RAM used: 67 (18%) at main() level
80 (22%) worst case
Stack: 2 worst case (1 in main + 1 for interrupts)
 
*
0000: MOVLW 02
0001: MOVWF 0A
0002: GOTO 21C
0003: NOP
0004: MOVWF 7F
0005: SWAPF 03,W
0006: CLRF 03
0007: MOVWF 21
0008: MOVF 0A,W
0009: MOVWF 20
000A: CLRF 0A
000B: MOVF 04,W
000C: MOVWF 22
000D: MOVF 77,W
000E: MOVWF 23
000F: MOVF 78,W
0010: MOVWF 24
0011: MOVF 79,W
0012: MOVWF 25
0013: MOVF 7A,W
0014: MOVWF 26
0015: BCF 03.7
0016: BCF 03.5
0017: MOVLW 8C
0018: MOVWF 04
0019: BTFSS 00.1
001A: GOTO 01D
001B: BTFSC 0C.1
001C: GOTO 034
001D: MOVLW 8C
001E: MOVWF 04
001F: BTFSS 00.3
0020: GOTO 023
0021: BTFSC 0C.3
0022: GOTO 037
0023: MOVF 22,W
0024: MOVWF 04
0025: MOVF 23,W
0026: MOVWF 77
0027: MOVF 24,W
0028: MOVWF 78
0029: MOVF 25,W
002A: MOVWF 79
002B: MOVF 26,W
002C: MOVWF 7A
002D: MOVF 20,W
002E: MOVWF 0A
002F: SWAPF 21,W
0030: MOVWF 03
0031: SWAPF 7F,F
0032: SWAPF 7F,W
0033: RETFIE
0034: BCF 0A.3
0035: BCF 0A.4
0036: GOTO 0B0
0037: BCF 0A.3
0038: BCF 0A.4
0039: GOTO 066
.................... #include "main.h"
.................... #include <16F887.h>
.................... //////// Standard Header file for the PIC16F887 device ////////////////
.................... #device PIC16F887
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES MCLR //Master Clear pin enabled
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NOCPD //No EE protection
.................... #FUSES NOBROWNOUT //No brownout reset
.................... #FUSES IESO //Internal External Switch Over mode enabled
.................... #FUSES FCMEN //Fail-safe clock monitor enabled
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
.................... #FUSES NODEBUG //No Debug mode for ICD
.................... #FUSES NOWRT //Program memory not write protected
.................... #FUSES BORV40 //Brownout reset at 4.0V
....................
.................... #use delay(clock=20000000)
*
00DC: MOVLW 5F
00DD: MOVWF 04
00DE: BCF 03.7
00DF: MOVF 00,W
00E0: BTFSC 03.2
00E1: GOTO 0EF
00E2: MOVLW 06
00E3: MOVWF 78
00E4: CLRF 77
00E5: DECFSZ 77,F
00E6: GOTO 0E5
00E7: DECFSZ 78,F
00E8: GOTO 0E4
00E9: MOVLW 7B
00EA: MOVWF 77
00EB: DECFSZ 77,F
00EC: GOTO 0EB
00ED: DECFSZ 00,F
00EE: GOTO 0E2
00EF: RETURN
*
013A: MOVLW 03
013B: SUBWF 5F,F
013C: BTFSS 03.0
013D: GOTO 148
013E: MOVLW 5F
013F: MOVWF 04
0140: BCF 03.7
0141: MOVF 00,W
0142: BTFSC 03.2
0143: GOTO 148
0144: GOTO 146
0145: GOTO 146
0146: DECFSZ 00,F
0147: GOTO 145
0148: BCF 0A.3
0149: BCF 0A.4
014A: GOTO 2C1 (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors)
....................
.................... //NOTE: Must declare MASTER before SLAVE, i2c_isr_state() returns 0
.................... // when MASTER is the most recent #use i2c
.................... //#use i2c(MASTER, sda=PIN_C1, scl=PIN_C0, stream=I2CM)
.................... #use i2c(SLAVE, Fast, sda=PIN_C4, scl=PIN_C3, force_hw, address=0xA0)
*
00A1: MOVF 6A,W
00A2: MOVWF 13
00A3: BSF 14.4
00A4: BCF 0C.3
00A5: BSF 03.5
00A6: BTFSC 14.0
00A7: GOTO 0A6
00A8: CLRF 78
00A9: BCF 03.5
00AA: BTFSC 14.4
00AB: INCF 78,F
....................
....................
....................
....................
.................... #define LED PIN_E1
.................... #define CE PIN_E2
....................
.................... int16 count;
....................
.................... int8 rcv_buf[0x10]; // I2C receive buffer
.................... int8 snd_buf[0x10]; // I2C send buffer
....................
.................... int8 buffer[0x10]; // I2C buffer
.................... int8 address;
....................
.................... const char cmd[40]={0xB5, 0x62, 0x06, 0x31, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x80, 0x84, 0x1E, 0x00, 0xE0, 0xC8, 0x10, 0x00, 0x40, 0x42, 0x0F, 0x00, 0xA0, 0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0x12, 0x03};
....................
.................... #INT_SSP
.................... void ssp_interupt ()
.................... {
.................... BYTE incoming, state;
....................
.................... state = i2c_isr_state();
*
0066: BSF 03.5
0067: BTFSC 14.5
0068: GOTO 071
0069: BCF 03.5
006A: CLRF 5C
006B: BSF 03.5
006C: BTFSS 14.2
006D: GOTO 071
006E: BCF 03.5
006F: BSF 5C.7
0070: BSF 03.5
0071: BCF 03.5
0072: MOVF 5C,W
0073: INCF 5C,F
0074: MOVWF 68
....................
.................... if(state < 0x80) //Master is sending data
0075: MOVF 68,W
0076: SUBLW 7F
0077: BTFSS 03.0
0078: GOTO 095
.................... {
.................... incoming = i2c_read();
0079: BCF 14.6
007A: BTFSS 0C.3
007B: GOTO 07A
007C: MOVF 13,W
007D: BSF 14.4
007E: MOVWF 67
.................... if(state == 1) //First received byte is address
007F: DECFSZ 68,W
0080: GOTO 08B
.................... {
.................... address = incoming;
0081: MOVF 67,W
0082: MOVWF 5B
.................... if (incoming == 2)
0083: MOVF 67,W
0084: SUBLW 02
0085: BTFSS 03.2
0086: GOTO 08B
.................... {
.................... buffer[0]=make8(count,0);
0087: MOVF 29,W
0088: MOVWF 4B
.................... buffer[1]=make8(count,1);
0089: MOVF 2A,W
008A: MOVWF 4C
.................... }
.................... }
.................... if(state == 2) //Second received byte is data
008B: MOVF 68,W
008C: SUBLW 02
008D: BTFSS 03.2
008E: GOTO 095
.................... buffer[address] = incoming;
008F: MOVLW 4B
0090: ADDWF 5B,W
0091: MOVWF 04
0092: BCF 03.7
0093: MOVF 67,W
0094: MOVWF 00
....................
....................
.................... }
.................... if(state == 0x80) //Master is requesting data
0095: MOVF 68,W
0096: SUBLW 80
0097: BTFSS 03.2
0098: GOTO 0AC
.................... {
.................... i2c_write(buffer[address]);
0099: MOVLW 4B
009A: ADDWF 5B,W
009B: MOVWF 04
009C: BCF 03.7
009D: MOVF 00,W
009E: MOVWF 69
009F: MOVF 69,W
00A0: MOVWF 6A
.................... }
.................... }
....................
....................
*
00AC: BCF 0C.3
00AD: BCF 0A.3
00AE: BCF 0A.4
00AF: GOTO 023
.................... #int_TIMER2 // every 10 ms
.................... void TIMER2_isr(void)
.................... {
.................... output_low(CE);
00B0: BSF 03.5
00B1: BCF 09.2
00B2: BCF 03.5
00B3: BCF 09.2
.................... count=get_timer1();
00B4: MOVF 0F,W
00B5: MOVWF 7A
00B6: MOVF 0E,W
00B7: MOVWF 77
00B8: MOVF 0F,W
00B9: SUBWF 7A,W
00BA: BTFSS 03.2
00BB: GOTO 0B4
00BC: MOVF 77,W
00BD: MOVWF 29
00BE: MOVF 7A,W
00BF: MOVWF 2A
.................... set_timer1(0);
00C0: CLRF 0F
00C1: CLRF 0E
.................... output_high(CE);
00C2: BSF 03.5
00C3: BCF 09.2
00C4: BCF 03.5
00C5: BSF 09.2
.................... }
....................
....................
00C6: BCF 0C.1
00C7: BCF 0A.3
00C8: BCF 0A.4
00C9: GOTO 023
.................... void main()
.................... {
*
021C: CLRF 04
021D: BCF 03.7
021E: MOVLW 1F
021F: ANDWF 03,F
0220: BSF 03.5
0221: BSF 03.6
0222: BSF 07.3
0223: MOVLW 08
0224: BCF 03.6
0225: MOVWF 19
0226: MOVLW 02
0227: MOVWF 1A
0228: MOVLW A6
0229: MOVWF 18
022A: MOVLW 90
022B: BCF 03.5
022C: MOVWF 18
022D: BSF 28.3
022E: MOVF 28,W
022F: BSF 03.5
0230: MOVWF 07
0231: BCF 03.5
0232: BSF 28.4
0233: MOVF 28,W
0234: BSF 03.5
0235: MOVWF 07
0236: MOVLW A0
0237: MOVWF 13
0238: MOVLW 36
0239: BCF 03.5
023A: MOVWF 14
023B: BSF 03.5
023C: BSF 03.6
023D: MOVF 09,W
023E: ANDLW C0
023F: MOVWF 09
0240: BCF 03.6
0241: BCF 1F.4
0242: BCF 1F.5
0243: MOVLW 00
0244: BSF 03.6
0245: MOVWF 08
0246: BCF 03.5
0247: CLRF 07
0248: CLRF 08
0249: CLRF 09
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
*
0250: BSF 03.5
0251: BSF 03.6
0252: MOVF 09,W
0253: ANDLW C0
0254: MOVWF 09
0255: BCF 03.6
0256: BCF 1F.4
0257: BCF 1F.5
0258: MOVLW 00
0259: BSF 03.6
025A: MOVWF 08
.................... setup_adc(ADC_OFF);
025B: BCF 03.5
025C: BCF 03.6
025D: BCF 1F.0
.................... // setup_spi(SPI_SS_DISABLED);
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
025E: BSF 03.5
025F: MOVF 01,W
0260: ANDLW C7
0261: IORLW 08
0262: MOVWF 01
.................... // setup_wdt(WDT_144MS);
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);
0263: MOVLW 07
0264: BCF 03.5
0265: MOVWF 10
.................... setup_timer_2(T2_DIV_BY_16,196,16);
0266: MOVLW 78
0267: MOVWF 78
0268: IORLW 06
0269: MOVWF 12
026A: MOVLW C4
026B: BSF 03.5
026C: MOVWF 12
.................... setup_ccp1(CCP_OFF);
026D: BCF 03.5
026E: BSF 28.2
026F: MOVF 28,W
0270: BSF 03.5
0271: MOVWF 07
0272: BCF 03.5
0273: CLRF 17
0274: BSF 03.5
0275: CLRF 1B
0276: CLRF 1C
0277: MOVLW 01
0278: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);
0279: BCF 03.5
027A: BSF 03.6
027B: CLRF 07
027C: CLRF 08
027D: CLRF 09
.................... setup_vref(FALSE);
027E: BSF 03.5
027F: BCF 03.6
0280: CLRF 17
....................
.................... delay_ms(1000);
0281: MOVLW 04
0282: BCF 03.5
0283: MOVWF 5E
0284: MOVLW FA
0285: MOVWF 5F
0286: CALL 0DC
0287: DECFSZ 5E,F
0288: GOTO 284
.................... int n;
.................... for (n=0;n<40;n++)
0289: CLRF 5D
028A: MOVF 5D,W
028B: SUBLW 27
028C: BTFSS 03.0
028D: GOTO 295
.................... {
.................... putc(cmd[n]);
028E: MOVF 5D,W
028F: CALL 03A
0290: BTFSS 0C.4
0291: GOTO 290
0292: MOVWF 19
.................... }
0293: INCF 5D,F
0294: GOTO 28A
....................
.................... printf("cvak...\r\n");
0295: MOVLW CA
0296: BSF 03.6
0297: MOVWF 0D
0298: MOVLW 00
0299: MOVWF 0F
029A: BCF 03.6
029B: GOTO 0F0
.................... snd_buf[2]=0x55;
029C: MOVLW 55
029D: MOVWF 3D
.................... snd_buf[3]=0xAA;
029E: MOVLW AA
029F: MOVWF 3E
....................
.................... set_timer1(0);
02A0: CLRF 0F
02A1: CLRF 0E
.................... enable_interrupts(INT_SSP);
02A2: BSF 03.5
02A3: BSF 0C.3
.................... // enable_interrupts(INT_TIMER2);
.................... enable_interrupts(GLOBAL);
02A4: MOVLW C0
02A5: BCF 03.5
02A6: IORWF 0B,F
....................
.................... while(true)
.................... {
....................
.................... output_high(LED);
02A7: BSF 03.5
02A8: BCF 09.1
02A9: BCF 03.5
02AA: BSF 09.1
.................... output_low(LED);
02AB: BSF 03.5
02AC: BCF 09.1
02AD: BCF 03.5
02AE: BCF 09.1
.................... set_timer1(0);
02AF: CLRF 0F
02B0: CLRF 0E
.................... output_high(CE);
02B1: BSF 03.5
02B2: BCF 09.2
02B3: BCF 03.5
02B4: BSF 09.2
.................... delay_ms(999);
02B5: MOVLW 09
02B6: MOVWF 5E
02B7: MOVLW 6F
02B8: MOVWF 5F
02B9: CALL 0DC
02BA: DECFSZ 5E,F
02BB: GOTO 2B7
.................... delay_us(966);
02BC: MOVLW 06
02BD: MOVWF 5E
02BE: MOVLW A0
02BF: MOVWF 5F
02C0: GOTO 13A
02C1: DECFSZ 5E,F
02C2: GOTO 2BE
.................... output_low(CE);
02C3: BSF 03.5
02C4: BCF 09.2
02C5: BCF 03.5
02C6: BCF 09.2
.................... count=get_timer1();
02C7: MOVF 0F,W
02C8: MOVWF 7A
02C9: MOVF 0E,W
02CA: MOVWF 77
02CB: MOVF 0F,W
02CC: SUBWF 7A,W
02CD: BTFSS 03.2
02CE: GOTO 2C7
02CF: MOVF 77,W
02D0: MOVWF 29
02D1: MOVF 7A,W
02D2: MOVWF 2A
....................
.................... printf("count: %Lu %X %X %X %X\r\n",count, buffer[0],buffer[1],buffer[2],buffer[3]);
02D3: MOVLW CF
02D4: BSF 03.6
02D5: MOVWF 0D
02D6: MOVLW 00
02D7: MOVWF 0F
02D8: BCF 03.0
02D9: MOVLW 07
02DA: BCF 03.6
02DB: MOVWF 5E
02DC: GOTO 14B
02DD: MOVLW 10
02DE: MOVWF 04
02DF: MOVF 2A,W
02E0: MOVWF 5F
02E1: MOVF 29,W
02E2: MOVWF 5E
02E3: GOTO 19E
02E4: MOVLW 20
02E5: BTFSS 0C.4
02E6: GOTO 2E5
02E7: MOVWF 19
02E8: MOVF 4B,W
02E9: MOVWF 5E
02EA: MOVLW 37
02EB: MOVWF 5F
02EC: CALL 1F9
02ED: MOVLW 20
02EE: BTFSS 0C.4
02EF: GOTO 2EE
02F0: MOVWF 19
02F1: MOVF 4C,W
02F2: MOVWF 5E
02F3: MOVLW 37
02F4: MOVWF 5F
02F5: CALL 1F9
02F6: MOVLW 20
02F7: BTFSS 0C.4
02F8: GOTO 2F7
02F9: MOVWF 19
02FA: MOVF 4D,W
02FB: MOVWF 5E
02FC: MOVLW 37
02FD: MOVWF 5F
02FE: CALL 1F9
02FF: MOVLW 20
0300: BTFSS 0C.4
0301: GOTO 300
0302: MOVWF 19
0303: MOVF 4E,W
0304: MOVWF 5E
0305: MOVLW 37
0306: MOVWF 5F
0307: CALL 1F9
0308: MOVLW 0D
0309: BTFSS 0C.4
030A: GOTO 309
030B: MOVWF 19
030C: MOVLW 0A
030D: BTFSS 0C.4
030E: GOTO 30D
030F: MOVWF 19
.................... }
0310: GOTO 2A7
.................... }
0311: SLEEP
 
Configuration Fuses:
Word 1: 2CF2 HS NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
Word 2: 3FFF NOWRT BORV40
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.sta
0,0 → 1,59
 
ROM used: 786 (10%)
786 (10%) including unused fragments
 
1 Average locations per line
16 Average locations per statement
 
RAM used: 67 (18%) at main() level
80 (22%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
102 50 100 main.c
26 0 0 main.h
423 0 0 C:\Program Files\PICC\devices\16F887.h
----- -----
551 50 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 20 3 1 @delay_ms1
0 17 2 1 @delay_us1
Inline 1 @I2C_WRITE_1
0 44 6 0 @const78
0 74 9 4 453 4.3 ssp_interupt
0 26 3 0 78 1.6 TIMER2_isr
0 246 31 1 1017 5.3 MAIN
0 5 1 0 @const88
0 74 9 3 @PSTRINGC7_9600_62_63
0 13 2 0 @const90
0 83 11 4 @PSTRINGCN7_9600_62_63
0 91 12 9 @PRINTF_LU_9600_62_63
0 35 4 2 @PRINTF_X_9600_62_63
 
Program metrics:
Functions 3
Statements 50
Comments 96
Volume (V) 1896
Difficilty (D) 10.5
Effort to implement (E) 19912
Time to implement (T) 18 minutes
Est Delivered Bugs (B) 0
Cyclomatic Complexity 6
Maintainability (MI) 122
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-00039 54 0
0003A-007FF 728 1262
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
 
 
 
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.sym
0,0 → 1,141
004 @WRITE_PROGRAM_MEMORY8.P1
004-005 @READ_PROGRAM_MEMORY8.P2
015 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
01B CCP_2_LOW
01B CCP_2
01C CCP_2_HIGH
020 @INTERRUPT_AREA
021 @INTERRUPT_AREA
022 @INTERRUPT_AREA
023 @INTERRUPT_AREA
024 @INTERRUPT_AREA
025 @INTERRUPT_AREA
026 @INTERRUPT_AREA
027 rs232_errors
028 @TRIS_C
029-02A count
02B-03A rcv_buf
03B-04A snd_buf
04B-05A buffer
05B address
05C @I2C_STATE
05D MAIN.n
05E-05F @PRINTF_LU_9600_62_63.P1
05E @PRINTF_X_9600_62_63.P2
05E @PSTRINGCN7_9600_62_63.P3
05E MAIN.@SCRATCH1
05E @PSTRINGC7_9600_62_63.@SCRATCH1
05F @PRINTF_X_9600_62_63.P1
05F @delay_ms1.P2
05F @delay_us1.P3
05F @PSTRINGC7_9600_62_63.@SCRATCH2
05F @PSTRINGCN7_9600_62_63.@SCRATCH1
060 @PSTRINGC7_9600_62_63.@SCRATCH3
060 @PSTRINGCN7_9600_62_63.@SCRATCH2
060 @PRINTF_LU_9600_62_63.@SCRATCH1
061 @PSTRINGCN7_9600_62_63.@SCRATCH3
061 @PRINTF_LU_9600_62_63.@SCRATCH2
062 @PRINTF_LU_9600_62_63.@SCRATCH3
063 @PRINTF_LU_9600_62_63.@SCRATCH4
064 @PRINTF_LU_9600_62_63.@SCRATCH5
065 @PRINTF_LU_9600_62_63.@SCRATCH6
066 @PRINTF_LU_9600_62_63.@SCRATCH7
067 ssp_interupt.incoming
068 ssp_interupt.state
069 ssp_interupt.@SCRATCH1
06A @I2C_WRITE_1.P1
06A ssp_interupt.@SCRATCH2
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07F @INTERRUPT_AREA
0FF @INTERRUPT_AREA
107.6 C1OUT
108.6 C2OUT
10D-10E @READ_PROGRAM_MEMORY8.P1
10D-10E @WRITE_PROGRAM_MEMORY8.P2
17F @INTERRUPT_AREA
1FF @INTERRUPT_AREA
27F @INTERRUPT_AREA
2FF @INTERRUPT_AREA
37F @INTERRUPT_AREA
3FF @INTERRUPT_AREA
47F @INTERRUPT_AREA
4FF @INTERRUPT_AREA
57F @INTERRUPT_AREA
5FF @INTERRUPT_AREA
67F @INTERRUPT_AREA
6FF @INTERRUPT_AREA
77F @INTERRUPT_AREA
7FF @INTERRUPT_AREA
87F @INTERRUPT_AREA
8FF @INTERRUPT_AREA
97F @INTERRUPT_AREA
9FF @INTERRUPT_AREA
A7F @INTERRUPT_AREA
AFF @INTERRUPT_AREA
B7F @INTERRUPT_AREA
BFF @INTERRUPT_AREA
C7F @INTERRUPT_AREA
CFF @INTERRUPT_AREA
D7F @INTERRUPT_AREA
DFF @INTERRUPT_AREA
E7F @INTERRUPT_AREA
EFF @INTERRUPT_AREA
F7F @INTERRUPT_AREA
FFF @INTERRUPT_AREA
 
ROM Allocation:
00DC @delay_ms1
013A @delay_us1
00A1 @I2C_WRITE_1
003A cmd
0066 ssp_interupt
00B0 TIMER2_isr
021C MAIN
00CA @const88
00F0 @PSTRINGC7_9600_62_63
00CF @const90
014B @PSTRINGCN7_9600_62_63
019E @PRINTF_LU_9600_62_63
01F9 @PRINTF_X_9600_62_63
021C @cinit
 
 
User Memory space:
 
User Memory space:
 
Project Directory:
Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC887\
 
Project Files:
main.c
main.h
C:\Program Files\PICC\devices\16F887.h
 
Units:
Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC887\main (main)
 
Compiler Settings:
Processor: PIC16F887
Pointer Size: 16
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: UNSIGNED: 1,8,16
Float,Double: 32,32
 
Output Files:
Errors: main.err
Ext Symbols: main.esym
INHX8: main.hex
Symbols: main.sym
List: main.lst
Debug/COFF: main.cof
Project: main.PJT
Call Tree: main.tre
Statistics: main.sta
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.tre
0,0 → 1,17
ÀÄmain
ÃÄMAIN 0/246 Ram=1
³ ÃÄ??0??
³ ÃÄ@delay_ms1 0/20 Ram=1
³ ÃÄ@const78 0/44 Ram=0
³ ÃÄ@PSTRINGC7_9600_62_63 0/74 Ram=3
³ ÃÄ@delay_ms1 0/20 Ram=1
³ ÃÄ@delay_us1 0/17 Ram=1
³ ÃÄ@PSTRINGCN7_9600_62_63 0/83 Ram=4
³ ÃÄ@PRINTF_LU_9600_62_63 0/91 Ram=9
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÀÄ@PRINTF_X_9600_62_63 0/35 Ram=2
ÃÄssp_interupt 0/74 Ram=4
³ ÀÄ@I2C_WRITE_1 (Inline) Ram=1
ÀÄTIMER2_isr 0/26 Ram=0
/Designs/Measuring_instruments/RMDS01C/meteor_detector_Small.JPG
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property