📄 pic16f639.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by AsmDoc -->
<TITLE>
HTMLWriter
</TITLE>
<META NAME="keywords" CONTENT="HTMLWriter class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="PIC16F639";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Module PIC16F639</H2>
<HR>
<P>
This module implements the top level entity or main program loop. The decision, whether to compute a certain event or not are made here. When such an event needs to be interpreted, the correct handler function will be called.<BR><BR> Currently implemented events and their corresponding handlers:<BR> REC_EVENT - Whenever the RX line goes high, such an event will be generated<BR> MESSAGE_HANDLER - The handler function for REC_EVENTS<BR> BUTTON_EVENTS - These events are generated, when a button changes it's state (internally debounced)<BR> Button_Handler - The handler function for button events<BR> IDLE - This event will be generated, after a certain amount of time (adjustable with the TIMEOUT constant), if no other event was generated<BR> BED(internally) - The handler for IDLE events
<P>
<P>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> </CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#EVENT_REG">EVENT_REG</A></B></CODE>
<BR>
This register indicates the occurred events</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> </CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#Button_old">Button_old</A></B></CODE>
<BR>
This register is a copy of PORTA, when the last button event occured</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> </CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#EE_DATA">EE_DATA</A></B></CODE>
<BR>
Referrence to the DATA in the EEPROM.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> </CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#EE_USER">EE_USER</A></B></CODE>
<BR>
Referrence to the beginning of userspace EEPROM memory.</TD>
</TR>
</TABLE>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Function Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#INTERRUPT_SERVICE_ROUTINE">INTERRUPT_SERVICE_ROUTINE</A></B>()</CODE>
<BR>
This routine generates button, idle and message events.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE></CODE></FONT></TD>
<TD><CODE><B><A HREF="PIC16F639.html#MAIN">MAIN</A></B>()</CODE>
<BR>
This routine calls the event handlers for the various events.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="EVENT_REG"></A><H3>
EVENT_REG</H3>
<DL>
<DD> This register indicates the occurred events @bitfield N.A. | IDLE | RA5_EVENT | MSG_INTERRUPT | RA3_EVENT | RA2_EVENT | RA1_EVENT | RA0_EVENT |
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="Button_old"></A><H3>
Button_old</H3>
<DL>
<DD> This register is a copy of PORTA, when the last button event occured
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="EE_DATA"></A><H3>
EE_DATA</H3>
<DL>
<DD> Referrence to the DATA in the EEPROM. The first four bytes are the Serial number The next eight bytes are the Encryption Key
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="EE_USER"></A><H3>
EE_USER</H3>
<DL>
<DD> Referrence to the beginning of userspace EEPROM memory. The following 8 bytes are reserved for that purpose.
<P>
<DL>
</DL>
</DL>
<HR>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="INTERRUPT_SERVICE_ROUTINE"></A><H3>
INTERRUPT_SERVICE_ROUTINE</H3>
<PRE>
<B>INTERRUPT_SERVICE_ROUTINE</B>()</PRE>
<P>
<DL>
<DD> This routine generates button, idle and message events.
<P>
<P>
<DD><DL>
<DT><B>Stacklevel:</B><DD>1</DD></DL>
</DD>
</DL>
<HR>
<A NAME="MAIN"></A><H3>
MAIN</H3>
<PRE>
<B>MAIN</B>()</PRE>
<P>
<DL>
<DD> This routine calls the event handlers for the various events.
<P>
<P>
<DD><DL>
<DT><B>Used SFRs:</B><DD>OPTION_REG INTCON Delay.Returned EECON1 EEADR, EEDATA, TMR0 PORTC , _w_x_50u </DD></DL>
</DD>
<DD><DL>
<DT><B>Calls subroutines:</B><PRE> MESSAGE_HANDLER LF.Receive8 EEPROM.Write EEPROM.Read LF.Send8 LF.Send_Clamp_One AFE.SendCMDClampON SPI.Write Delay.WaitFor AFE.SendCMDClampOFF SPI.Write LF.Send_Clamp_Zero AFE.SendCMDClampON SPI.Write Delay.WaitFor AFE.SendCMDClampOFF SPI.Write RF.Send_Header Delay.start Delay.wait RF.Send_Data Delay.start Delay.wait LF.ReadBuffer AFE.Receive8 RF.SendBuffer Delay.wait_w_x_50u _w_x_50u Button_Handler
</PRE>
</DD></DL>
<DD><DL>
<DT><B>Stacklevel:</B><DD>4</DD></DL>
</DD>
<B>Flow Chart:</B><p style="position:relative;" id="MainFlow_p"><IMG SRC="./MainFlow.gif" NAME="MainFlow" BORDER="0"></p><SCRIPT type="text/javascript">window.setInterval("MainFlow_res()",100);var MainFlow_init = document.MainFlow.width ;function MainFlow_res(){try{if(MainFlow_init > parent.classFrame.innerWidth-45) document.MainFlow.width=parent.classFrame.innerWidth-45;else{ document.MainFlow.width=MainFlow_init; document.getElementById("MainFlow_p").style.left= ((parent.classFrame.innerWidth-document.MainFlow.width-45) / 2) + "px"; document.getElementById("MainFlow_p").style.width= document.MainFlow.width + "px";}}catch(Exception){}}</SCRIPT></DL>
<HR>
<!-- ========= END OF CLASS DATA ========= -->
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -