Additions from 05/04/2022: Typo in the name and fixing some dutycycles.
This commit is contained in:
parent
25068d6ae1
commit
2004e21379
3 changed files with 102 additions and 91 deletions
|
@ -34,17 +34,17 @@
|
||||||
<documentation help="" />
|
<documentation help="" />
|
||||||
<offline-documentation help="" />
|
<offline-documentation help="" />
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.25.0" />
|
<content-extension eid="atmel.asf" uuidref="Atmel.ASF" version="3.42.0" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</framework-data>
|
</framework-data>
|
||||||
</AsfFrameworkConfig>
|
</AsfFrameworkConfig>
|
||||||
<avrtool>com.atmel.avrdbg.tool.stk500</avrtool>
|
<avrtool>com.atmel.avrdbg.tool.ispmk2</avrtool>
|
||||||
<avrtoolserialnumber />
|
<avrtoolserialnumber>000200034317</avrtoolserialnumber>
|
||||||
<avrdeviceexpectedsignature>0x1E930B</avrdeviceexpectedsignature>
|
<avrdeviceexpectedsignature>0x1E930B</avrdeviceexpectedsignature>
|
||||||
<com_atmel_avrdbg_tool_stk500>
|
<com_atmel_avrdbg_tool_stk500>
|
||||||
<ToolOptions>
|
<ToolOptions>
|
||||||
<InterfaceProperties>
|
<InterfaceProperties>
|
||||||
<IspClock>125000</IspClock>
|
<IspClock>0</IspClock>
|
||||||
</InterfaceProperties>
|
</InterfaceProperties>
|
||||||
<InterfaceName>ISP</InterfaceName>
|
<InterfaceName>ISP</InterfaceName>
|
||||||
</ToolOptions>
|
</ToolOptions>
|
||||||
|
@ -68,6 +68,17 @@
|
||||||
</ToolNumber>
|
</ToolNumber>
|
||||||
<ToolName xmlns="">Simulator</ToolName>
|
<ToolName xmlns="">Simulator</ToolName>
|
||||||
</com_atmel_avrdbg_tool_simulator>
|
</com_atmel_avrdbg_tool_simulator>
|
||||||
|
<com_atmel_avrdbg_tool_ispmk2>
|
||||||
|
<ToolOptions>
|
||||||
|
<InterfaceProperties>
|
||||||
|
<IspClock>125000</IspClock>
|
||||||
|
</InterfaceProperties>
|
||||||
|
<InterfaceName>ISP</InterfaceName>
|
||||||
|
</ToolOptions>
|
||||||
|
<ToolType>com.atmel.avrdbg.tool.ispmk2</ToolType>
|
||||||
|
<ToolNumber>000200034317</ToolNumber>
|
||||||
|
<ToolName>AVRISP mkII</ToolName>
|
||||||
|
</com_atmel_avrdbg_tool_ispmk2>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
<ToolchainSettings>
|
<ToolchainSettings>
|
||||||
|
@ -104,7 +115,7 @@
|
||||||
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include</Value>
|
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.2.118\include</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcc.assembler.general.IncludePaths>
|
</avrgcc.assembler.general.IncludePaths>
|
||||||
</AvrGcc>
|
</AvrGcc>
|
||||||
</ToolchainSettings>
|
</ToolchainSettings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
@ -144,7 +155,7 @@
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcc.assembler.general.IncludePaths>
|
</avrgcc.assembler.general.IncludePaths>
|
||||||
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
|
<avrgcc.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcc.assembler.debugging.DebugLevel>
|
||||||
</AvrGcc>
|
</AvrGcc>
|
||||||
</ToolchainSettings>
|
</ToolchainSettings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -13,7 +13,7 @@ volatile unsigned char led2_state=0;
|
||||||
void led1_init(void)
|
void led1_init(void)
|
||||||
{
|
{
|
||||||
TCCR1|=(1<<CTC1)|(1<<COM1A0); //on active le mode CTC en comparant OCR1C, COM1A0 : mode toggle
|
TCCR1|=(1<<CTC1)|(1<<COM1A0); //on active le mode CTC en comparant OCR1C, COM1A0 : mode toggle
|
||||||
OCR1C=68; //d'apres retroingenieurie OCR1C=16
|
OCR1C=35; //d'apres retroingenieurie OCR1C=35
|
||||||
TCCR1|=(1<<CS10)|(1<<CS11); //on active la clock, prediv de 4
|
TCCR1|=(1<<CS10)|(1<<CS11); //on active la clock, prediv de 4
|
||||||
DDRB |= (1<<PB1);
|
DDRB |= (1<<PB1);
|
||||||
led1_state=1;
|
led1_state=1;
|
||||||
|
@ -22,7 +22,7 @@ void led1_init(void)
|
||||||
void led2_init(void)
|
void led2_init(void)
|
||||||
{
|
{
|
||||||
GTCCR|=(1<<COM1B0); //COM1B0 : mode toggle
|
GTCCR|=(1<<COM1B0); //COM1B0 : mode toggle
|
||||||
OCR1C=68; //d'apres retroingenieurie OCR1C=16
|
OCR1C=35; //d'apres retroingenieurie OCR1C=35
|
||||||
TCCR1|=(1<<CS10)|(1<<CS11); //on active la clock, prediv de 4
|
TCCR1|=(1<<CS10)|(1<<CS11); //on active la clock, prediv de 4
|
||||||
DDRB |= (1<<PB4);
|
DDRB |= (1<<PB4);
|
||||||
led2_state=1;
|
led2_state=1;
|
||||||
|
@ -44,11 +44,11 @@ void led2_stop(void)
|
||||||
|
|
||||||
void timer0_init(void)
|
void timer0_init(void)
|
||||||
{
|
{
|
||||||
TCCR0A=0x00; //Normal mode
|
TCCR0A=0x00; //Mode normal
|
||||||
TCCR0B=0x00;
|
TCCR0B=0x00;
|
||||||
TCCR0B |= (1<<CS01); //prescaling with 8
|
TCCR0B |= (1<<CS01); //divise par 8
|
||||||
TCNT0=0;
|
TCNT0=0;
|
||||||
TIMSK|=(1<<TOIE0);
|
TIMSK|=(1<<TOIE0); //Interruptions autorisees
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ ISR (TIMER0_OVF_vect) //Interrupt vector for Timer0
|
||||||
int main( void )
|
int main( void )
|
||||||
{
|
{
|
||||||
unsigned char cmd,i=0;
|
unsigned char cmd,i=0;
|
||||||
unsigned char nom_capteur[8]= {'T','u','r','k','i','s','h','Z'};
|
unsigned char nom_capteur[8]= {'C','a','t','c','h','E','y','e'};
|
||||||
unsigned char sensor_type[8]= {'C','a','t','c','h','E','y','e'};
|
unsigned char sensor_type[8]= {'I','R','O','b','s','t','a','c'};
|
||||||
uint8_t slaveAdress;//data = 0x45;
|
uint8_t slaveAdress;//data = 0x45;
|
||||||
slaveAdress = 0x01;
|
slaveAdress = 0x01;
|
||||||
MCUCR |= (1<<PUD);
|
MCUCR |= (1<<PUD);
|
||||||
|
|
Loading…
Add table
Reference in a new issue