<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7018786310714626625</id><updated>2024-09-15T22:13:00.961-07:00</updated><category term="ARM"/><category term="embedded"/><category term="GCC"/><category term="OpenOCD"/><category term="Cetan"/><category term="Codesourcery"/><category term="Eco"/><category term="Linux"/><category term="Marathon"/><category term="Shell"/><category term="Toolchain"/><category term="diesel"/><category term="engine"/><category term="tutorial"/><category term="AVR"/><category term="Asm"/><category term="Camshaft"/><category term="Crankshaft"/><category term="EFI"/><category term="IR"/><category term="IRQ"/><category term="ISR"/><category term="Infrared"/><category term="Position"/><category term="RPM"/><category term="Revolution"/><category term="Rotation"/><category term="STM32"/><category term="Sensor"/><category term="Simulator"/><category term="Speed"/><category term="assembler"/><category term="bare-metal"/><category term="blink led"/><category term="control"/><category term="fasm"/><category term="fasmarm"/><category term="hello world"/><category term="interrupt"/><category term="programming"/><category term="reflective"/><category term="tachometer"/><category term="what processor to start with"/><title type='text'>EFI, Embedded Systems, and Stuff</title><subtitle type='html'>Electronic Fuel Injection.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-8812628529453871943</id><published>2012-10-24T04:09:00.002-07:00</published><updated>2012-10-25T01:21:02.744-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Camshaft"/><category scheme="http://www.blogger.com/atom/ns#" term="Crankshaft"/><category scheme="http://www.blogger.com/atom/ns#" term="engine"/><category scheme="http://www.blogger.com/atom/ns#" term="Position"/><category scheme="http://www.blogger.com/atom/ns#" term="Revolution"/><category scheme="http://www.blogger.com/atom/ns#" term="Rotation"/><category scheme="http://www.blogger.com/atom/ns#" term="RPM"/><category scheme="http://www.blogger.com/atom/ns#" term="Sensor"/><category scheme="http://www.blogger.com/atom/ns#" term="Simulator"/><category scheme="http://www.blogger.com/atom/ns#" term="Speed"/><title type='text'>Camshaft position wheel simulator</title><content type='html'>&lt;b&gt;This time a post strictly related to the topic of EFI&#39;s.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Here is a thing I did some time ago. It is a portable simulator of a revolting camshaft.&amp;nbsp;Time to show it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYeSyeoQMxpacNLmEkGd-9GVTsdlv0dtYdS92PhqNHjkskgNMxLAKwtzB4N5R-zvep9rbr3LRd99-Y3qcGtjVMY1b2W2Et8WJ3fB5aIvrNuybBJmeD_DieHIRcOhn470if4E67DMYtgbr5/s1600/miniatura.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYeSyeoQMxpacNLmEkGd-9GVTsdlv0dtYdS92PhqNHjkskgNMxLAKwtzB4N5R-zvep9rbr3LRd99-Y3qcGtjVMY1b2W2Et8WJ3fB5aIvrNuybBJmeD_DieHIRcOhn470if4E67DMYtgbr5/s1600/miniatura.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
First, wheels were cut from a 2mm thick steel sheet with a water-jet according to a CAD drawing. It is a decent method of cutting, quite precise. The cut surface is a bit rugged and you can clearly see that the edge is not exactly the right angle, but anyway this method was way better here than plasma or laser cut. You can see some rusty marks caused by the fluid used during cutting.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5xyUxQOB01laS5EV5EE4-4G5GjXP7uFubDdSHaeQxqZkgh4fIXqy4VyU6YsaKOTB6IZ5TQw3UZmFLtXUw9YCmGM7HcDgMmy6MDeJGBN5QNNMSFhsygWFHKkZBwkl00MMaq7SGwMGAYAkn/s1600/20111205013.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5xyUxQOB01laS5EV5EE4-4G5GjXP7uFubDdSHaeQxqZkgh4fIXqy4VyU6YsaKOTB6IZ5TQw3UZmFLtXUw9YCmGM7HcDgMmy6MDeJGBN5QNNMSFhsygWFHKkZBwkl00MMaq7SGwMGAYAkn/s320/20111205013.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I cleaned the wheels and painted them later on:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNS1hNi1EMp50X4W9gfQuS78Y1rwD-xTwNeEmjSXAXjoAfcrqV0Ug1Bhr224fS7ktIzVOi_XpkYBEshP0M7MV2jjoay5IOaFmAqS9z1eI4Dsdt29fTgp5rNnZIYMFIynQ7og6nkde4z7N/s1600/20111226019.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioNS1hNi1EMp50X4W9gfQuS78Y1rwD-xTwNeEmjSXAXjoAfcrqV0Ug1Bhr224fS7ktIzVOi_XpkYBEshP0M7MV2jjoay5IOaFmAqS9z1eI4Dsdt29fTgp5rNnZIYMFIynQ7og6nkde4z7N/s320/20111226019.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Assembling the wheels on the motor shaft was quite a challenging part. I decided to cut a thread on the shaft and lock the wheel on the shaft with two nuts. I used a hand thread die cause I had no access to a lathe:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0MIy-OOxBjjVy5Z1QE44x9koFMUZ_YHeNrZoe2TpxQ0ScNT2xvxeq19pwChm4-U7kPidAj1wnDangQJz1ZClXDceUjmP1yV5ZkhTl5pRHD-G_dyd6qDWlrp5U7O4FguC8mqLhQL7tzV7D/s1600/20110313011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0MIy-OOxBjjVy5Z1QE44x9koFMUZ_YHeNrZoe2TpxQ0ScNT2xvxeq19pwChm4-U7kPidAj1wnDangQJz1ZClXDceUjmP1yV5ZkhTl5pRHD-G_dyd6qDWlrp5U7O4FguC8mqLhQL7tzV7D/s320/20110313011.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The job was very tough, the material of the shaft is very hard and I did not manage to cut the thread perfectly even. The result was good enough though:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbygW07Pesbh_v2SaBKulfFIDlIVFJ-NZN0Qs3-AFTkGeM51JojWS8pDZDHQcB1jWT8b84jq2qAzTLhxeujVV_VP-GAKeQpOYT42CMjwPP5O-dDxkv6BC-tTskEfcU4aIhWEbs9VS-7VfS/s1600/DSCN3509.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbygW07Pesbh_v2SaBKulfFIDlIVFJ-NZN0Qs3-AFTkGeM51JojWS8pDZDHQcB1jWT8b84jq2qAzTLhxeujVV_VP-GAKeQpOYT42CMjwPP5O-dDxkv6BC-tTskEfcU4aIhWEbs9VS-7VfS/s320/DSCN3509.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The sensor that senses wheel movement is an induction anti-lock braking system&amp;nbsp;sensor, taken from a Polish car called &quot;Polonez&quot; ;) The assembled device looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_6qmYZDLy7_-dohP5UjzUPhDY9BY3MF-g2nHDP1ft_NbDF-d9YzvLa5Hk40mPq3OHnR2R_ZhzpiYw3Ub4XbzHgu8lsYfZAtOSFKPBTZemcg16fg46XY5oiXaUIgzRL5sKp833-JJmJdL/s1600/DSCN3585.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq_6qmYZDLy7_-dohP5UjzUPhDY9BY3MF-g2nHDP1ft_NbDF-d9YzvLa5Hk40mPq3OHnR2R_ZhzpiYw3Ub4XbzHgu8lsYfZAtOSFKPBTZemcg16fg46XY5oiXaUIgzRL5sKp833-JJmJdL/s320/DSCN3585.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
And here is the oscillogram of the working device. You can see peaks are not even. That is because the axis of the thread does not cover the axis of the shaft close enough. That causes deviations of the spinning movement. This should not be the problem since the thing that interests us the most are the points where signal crosses through zero. The gap between peaks is a missing tooth that marks the position of the wheel.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj3z8Un1HRY4XmISgLyb9AvOv6oLpE1O-EzQ0jlO_vDx_BJ-ih7-MVIm5F31uQpwjAYc5PIhB8JWNkbxcr_Ly6J4SwkEYrEMAI-Sody_0r3g1jXVJFo4xYlSxxWcIDmPbgd-DLZ3xv2vSu/s1600/Untitled2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj3z8Un1HRY4XmISgLyb9AvOv6oLpE1O-EzQ0jlO_vDx_BJ-ih7-MVIm5F31uQpwjAYc5PIhB8JWNkbxcr_Ly6J4SwkEYrEMAI-Sody_0r3g1jXVJFo4xYlSxxWcIDmPbgd-DLZ3xv2vSu/s320/Untitled2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/8812628529453871943/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2012/10/camshaft-position-sensor-simulator.html#comment-form' title='Komentarze (1)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8812628529453871943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8812628529453871943'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2012/10/camshaft-position-sensor-simulator.html' title='Camshaft position wheel simulator'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYeSyeoQMxpacNLmEkGd-9GVTsdlv0dtYdS92PhqNHjkskgNMxLAKwtzB4N5R-zvep9rbr3LRd99-Y3qcGtjVMY1b2W2Et8WJ3fB5aIvrNuybBJmeD_DieHIRcOhn470if4E67DMYtgbr5/s72-c/miniatura.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-8701543204589105707</id><published>2012-05-31T00:55:00.001-07:00</published><updated>2013-09-21T11:05:41.663-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="Asm"/><category scheme="http://www.blogger.com/atom/ns#" term="assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="bare-metal"/><category scheme="http://www.blogger.com/atom/ns#" term="blink led"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="fasm"/><category scheme="http://www.blogger.com/atom/ns#" term="fasmarm"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="hello world"/><category scheme="http://www.blogger.com/atom/ns#" term="interrupt"/><category scheme="http://www.blogger.com/atom/ns#" term="IRQ"/><category scheme="http://www.blogger.com/atom/ns#" term="ISR"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenOCD"/><category scheme="http://www.blogger.com/atom/ns#" term="STM32"/><title type='text'>ARM (STM32) - Blink Led and Interrupt Service Routine in ASM</title><content type='html'>&lt;b&gt;UPDATE: No need to use GCC linker.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most beginners tutorials in MCU&#39;s do not show how to set up and handle interrupts, and most of tutorials do not show how to code in ASM. Here is a complete tutorial showing how to blink a LED with STM32, set up IRQ and do that in ASM. Assembler is really simple and logic, just bare in mind that almost whatever you write in ASM will be translated straight to machine code. That&#39;s the whole secret.&lt;br /&gt;
&lt;br /&gt;
First of all: I love FASM. It&#39;s very clear, simple and powerful. Programming huge, modern chips that run without any OS in ASM could be exhausting (there are almost no libraries and macro-instructions that could help out writing bare-metal code - maybe it should be created?) but it allows to understand how the chip works. Let&#39;s give it a try:&lt;br /&gt;
&lt;br /&gt;
OS: Windows 7&lt;br /&gt;
Compiler: FASMARM&amp;nbsp;&lt;a href=&quot;http://arm.flatassembler.net/&quot;&gt;download from here&lt;/a&gt;&lt;br /&gt;
Linker: LD from CodeSourcery none EABI GCC&lt;br /&gt;
Processor: STM32f103RB&lt;br /&gt;
Development board configuration: GPIOA P0 - button which couples to + VCC, P2 LED - hi state activates it.&lt;br /&gt;
&lt;br /&gt;
Code:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7C2vNUxLBmliHODfz45AdEMtcepoAYnl_4mdEWEcdKD8Kq2aKZNx8mkNt9LHocHNIF8-kwK0a9TiYsXGDh1Bj9ZRle3c9KfupABRVXK14U3tKHvolfjww5Svyj6iKCJBP_Ado-xO0Xdz2/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; format elf                     ; Output format.  
 processor    37DA2FEh          ; Instruction encoding that fits our processor.  
 thumb                          ; This processor supports only thumb instruction set.  
 include &#39;vector_macro.inc&#39;     ; Include file with some helpful macros dealing  
                                ; with vector table.  
 section &quot;.text&quot;  
 org 08000000h                  ; Offset address. Both this and placing code in  
                                ; section with an offset is necessary.  
 ; Begining of what goes into flash memory:  
         dw   Stack_Pointer            ; Stack pointer  
         vector _Start                 ; Reset vector  
         vector _NMI_handler           ; Some essential vectors  
         vector _HardFault_handler     ;  
         vector _MemManage_handler     ;  
         vector _BusFault_handler      ;  
         vector _UsageFault_handler    ;  
         default_handler 15            ; Skip 15 unused vectors  
         vector _EXTI_Line0            ; Our handler&#39;s address  

 _Start:  
         movlit r6, RCC_APB2ENR  
         movs r0, 4h                   ; GPIOA clock enable.  
         str r0, [r6]  

         movlit r6, GPIOA_CRL  
         movlit r0, 0x44444144         ; GPIOA config: P0 floating input  
         str r0, [r6]                  ; P2 - 10MHz output.

         movlit r6, EXTI               ; EXTI line 0 not masked.  
         movlit r0, 0x00000001  
         str r0, [r6]  

         movlit r6, (EXTI + 8)         ; EXTI0 rising trigger selected.  
         movlit r0, 0x00000001  
         str r0, [r6]  

         movlit r6, NVIC               ; Interrupt set enable.  
         movlit r0, 0x40  
         str r0, [r6]  

 ; Values stored in the GPIO output register:  
         movs r2, 0                    ; Turn off LED  
         movs r3, 4h                   ; Turn on LED  
         movlit r6, GPIOA_ODR          ; Point to PortA output data register.  

 loop:                                 ; Infinite loop. Turning the LED on and off.  
         str r2, [r6]                  ; Clear Port A, pin 2, turning on LED.  
         movlit r1, LEDDELAY  
 delay1:  
         subs r1, 1  
         bne delay1  
         str r3, [r6]                  ; Set Port A, pin 2, turning off LED.  
         movlit r1, LEDDELAY  
 delay2:  
         subs r1, 1  
         bne delay2  
         b loop  

 _EXTI_Line0:                          ; EXTI0 IRQ handler.  
         push {r6}                     ; Let&#39;s save whatever we modify on the stack.  
         push {r3}  
         push {r0}

         movlit r6, (EXTI + 0x14)      ; Clear pending IRQ. Otherwise the IRQ would be  
         movlit r0, 1                  ; permanently serviced.  
         str r0, [r6]  

         movlit r6, GPIOA_ODR          ; Point to PortA output data register.  
         str r3, [r6]                  ; Set Port A, pin 2, turning on LED.  

         add r9, 1                     ; When the exception takes place, r9 is being  
                                       ; incremented.  
         pop {r0}
         pop {r3}  
         pop {r6}  

         bx lr                         ; Branch to the address stored in link register.  

 _dummy:   
 _NMI_handler:   
 _HardFault_handler:   
 _MemManage_handler:   
 _BusFault_handler:   
 _UsageFault_handler:  
 _Default_handler:  
            add r0, 1                  ; In case of fault r0 is being incremented  
            b _dummy   
 ; Peripherals addresses:  
     GPIOA_CRL       =  0x40010800  
     GPIOA_ODR       =  0x4001080C  
     RCC_APB2ENR     =  0x40021018  
     EXTI            =  0x40010400  
     AFIO            =  0x40010000  
     NVIC            =  0xE000E100  

 ; Some config:  
     Stack_Pointer   =  0x20005000  
     LEDDELAY        = 1000000    
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
This is our code. First of all we put a couple of directives informing assembler how the code should be processed. We include a file with&amp;nbsp;macro-definitions (it will be discussed later on). The very first thing that needs to be in the memory is the stack pointer. The second thing is the entry address where execution starts. First thing we do during the actual code execution is peripherals configuration. &lt;i&gt;loop&lt;/i&gt;&amp;nbsp;is an infinite loop that turns the led on and off.&amp;nbsp;&lt;i&gt;_EXTI_Line0&lt;/i&gt;&amp;nbsp;is a label defining our ISR.&lt;br /&gt;
&lt;br /&gt;
Save the source in a file called&amp;nbsp;&lt;i&gt;example.ASM&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
File with some macro-definitions:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7C2vNUxLBmliHODfz45AdEMtcepoAYnl_4mdEWEcdKD8Kq2aKZNx8mkNt9LHocHNIF8-kwK0a9TiYsXGDh1Bj9ZRle3c9KfupABRVXK14U3tKHvolfjww5Svyj6iKCJBP_Ado-xO0Xdz2/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; macro vector name {dw name + 1}  
 macro default_handler repeat  
 {  
     rept repeat  
     {  
         dw _Default_handler + 1  
     \}  
 }       
 macro movlit reg,const {   
     local  .const,.skip   
     ldr   reg,[.const]   
     b    .skip   
     align  4   
   .const:   
     dw   const   
   .skip:   
 }  
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Macro &lt;i&gt;vector&lt;/i&gt;&amp;nbsp;creates a label. Adding one to the address is essential cause in Thumb state every address loaded into memory must have LSB set. Macro &lt;i&gt;default_handler&lt;/i&gt;&amp;nbsp;creates a certain number of labels referring to a label named&amp;nbsp;_Default_handler. It&#39;s necessary to skip unused vectors. Macro &lt;i&gt;movlit&lt;/i&gt;&amp;nbsp;is a way to load a const value into a register. Save the macro-definition file in the same place where the source file is and name it&lt;i&gt; vector_macro.inc&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Time for the linker script:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7C2vNUxLBmliHODfz45AdEMtcepoAYnl_4mdEWEcdKD8Kq2aKZNx8mkNt9LHocHNIF8-kwK0a9TiYsXGDh1Bj9ZRle3c9KfupABRVXK14U3tKHvolfjww5Svyj6iKCJBP_Ado-xO0Xdz2/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; SECTIONS  
 {  
     . = 0x08000000; /* start of flash */  
     .text : { *(.text)  }  
        
     .data :  
     {   
      *(.data)   
      *(.rom)  
     }  
      
     . = 0x20000000;  /*start of internal RAM */ 
     .ram : { *(.ram) }  
     .bss :  
     {  
      *(.bss)  
      *(.ram)  
     }   
 }                   
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Save the linker script in &lt;i&gt;link.ld&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Compile the ASM source file. Your output is an object file called &lt;i&gt;example.O &lt;/i&gt;Now we need to link the object file to create an executable file that could be loaded into flash memory. Use command:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ arm-none-eabi-ld -v -T link.ld -o example.elf example.o&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Once we get the output file we can burn it. I&#39;m using OpenOCD 0.5.0 and &lt;/span&gt;&lt;a href=&quot;http://www.distortec.com/&quot; style=&quot;font-family: inherit;&quot;&gt;JTAG-lock-pick&lt;/a&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;which is fully&amp;nbsp;&lt;/span&gt;compatible with Amontec JTAGkey. Run OpenOCD&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;with:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ openocd -f /interface/jtagkey.cfg -f /target/stm32f1x.cfg&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
In a new console window connect with openocd server on port 4444:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;telnet localhost 4444&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Stop the core with:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;reset halt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
Move the &lt;i&gt;example.elf&lt;/i&gt;&amp;nbsp;file to your home folder and burn it in the flash memory:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;flash write_image erase example.elf&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;After a&amp;nbsp;&lt;/span&gt;successful&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;download to chip you can start debugging the program. Button pressing causes External IRQ being serviced. To prove it reset the core:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;reset&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
stop it:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;halt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;check the current register state:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;reg&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
resume the core:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;resume&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Trigger the interrupt by pressing the button and stop the core one more time:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;halt&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Check the register state:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;reg&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;you can see that R9 has been incremented during our ISR.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Use &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;step&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;command during halted to watch a single instruction being executed and use &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mdw&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;i&gt;address_number&amp;nbsp;&lt;/i&gt;to read a word from a certain address. Have fun!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;Update:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
To load the image without linking you need to change the line&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7C2vNUxLBmliHODfz45AdEMtcepoAYnl_4mdEWEcdKD8Kq2aKZNx8mkNt9LHocHNIF8-kwK0a9TiYsXGDh1Bj9ZRle3c9KfupABRVXK14U3tKHvolfjww5Svyj6iKCJBP_Ado-xO0Xdz2/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;
 format elf

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;pre style=&quot;background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7C2vNUxLBmliHODfz45AdEMtcepoAYnl_4mdEWEcdKD8Kq2aKZNx8mkNt9LHocHNIF8-kwK0a9TiYsXGDh1Bj9ZRle3c9KfupABRVXK14U3tKHvolfjww5Svyj6iKCJBP_Ado-xO0Xdz2/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;
 format binary as &#39;bin&#39;

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
in the source file. Compile it with FASMARM. Fire up OpenOCD and load the image with:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;flash write_image erase &lt;i&gt;name_of_the_file.bin &lt;/i&gt;0x8000000&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;The number in the command indicates the address where the flash memory begins - change it for different chips.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/8701543204589105707/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2012/05/arm-stm32-blink-led-and-interrupt.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8701543204589105707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8701543204589105707'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2012/05/arm-stm32-blink-led-and-interrupt.html' title='ARM (STM32) - Blink Led and Interrupt Service Routine in ASM'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-3814690134449209963</id><published>2012-05-23T16:59:00.001-07:00</published><updated>2012-05-28T04:03:47.057-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="Infrared"/><category scheme="http://www.blogger.com/atom/ns#" term="IR"/><category scheme="http://www.blogger.com/atom/ns#" term="reflective"/><category scheme="http://www.blogger.com/atom/ns#" term="tachometer"/><title type='text'>IR reflective tachometer</title><content type='html'>I had an urgent need to build a simple tachometer. I decided to build one I have already made (although it&#39;s avr based) and share the result with you. The project is based on the one that could be found here:&amp;nbsp;&lt;a href=&quot;http://www.forbot.pl/forum/topics61/miernik-predkosci-obrotow-silnika-vt4924.htm&quot;&gt;http://www.forbot.pl/...24.htm&lt;/a&gt;&amp;nbsp;This link contains schematic and both source code and compiled binary file.&amp;nbsp;I just added a 7660s negative voltage converter for LCD polarization.&lt;br /&gt;
&lt;br /&gt;
The IR diode flashes to the rotating element. Once the passing field is black, the IR beam is not being reflected. When it&#39;s white, IR reflects, goes back to the phototransistor and activates its current flow. The processor detects the event of white field passing and counts the events, divides by time and displays the result in revolutions per minute.&lt;br /&gt;
&lt;br /&gt;
Phototransistor and an IR diode in one housing. Heat-shrink minimizes IR beam leaks:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6kjj5DhY6zKd69-x0PzgYYivSHR2nD3npFGOSLjt-iQ6Gf-FXXuD27RgKVw62Uetvi4L_kip3U-FR07iC8NbhwjNJioDie9irF-qjwsqqPfKF6P084_F2z5iu49Y1YNkS0IKnrvwnCOG-/s1600/DSCN3611.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6kjj5DhY6zKd69-x0PzgYYivSHR2nD3npFGOSLjt-iQ6Gf-FXXuD27RgKVw62Uetvi4L_kip3U-FR07iC8NbhwjNJioDie9irF-qjwsqqPfKF6P084_F2z5iu49Y1YNkS0IKnrvwnCOG-/s320/DSCN3611.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
IR can&#39;t be seen normally, but it&#39;s cool how the camera-eye allows us to watch it. Check out your remote controller.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHoHmDsptb9nneDDeCF4PokXrOU24qjhhCZ2QyENKhelWrLlAFIVRnE_fBT6kAypCx6E1-WDlFR5Hgohe6Zn9uUsGA57AuuUcbxl9xwyUUArjPDGQJFCCYM1weHtx8LTfIEu5nC4Z8DGQ9/s1600/DSCN3613.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHoHmDsptb9nneDDeCF4PokXrOU24qjhhCZ2QyENKhelWrLlAFIVRnE_fBT6kAypCx6E1-WDlFR5Hgohe6Zn9uUsGA57AuuUcbxl9xwyUUArjPDGQJFCCYM1weHtx8LTfIEu5nC4Z8DGQ9/s320/DSCN3613.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
How it works:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;object class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://i.ytimg.com/vi/E0OS_K06P6o/0.jpg&quot; height=&quot;266&quot; width=&quot;320&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/E0OS_K06P6o?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata&quot; /&gt;







&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;







&lt;embed width=&quot;320&quot; height=&quot;266&quot;  src=&quot;http://www.youtube.com/v/E0OS_K06P6o?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
If you would like to build one, be aware that you should pull-up reset pin to VCC. Otherwise uC could be unstable.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/3814690134449209963/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2012/05/ir-reflective-tachometer.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/3814690134449209963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/3814690134449209963'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2012/05/ir-reflective-tachometer.html' title='IR reflective tachometer'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6kjj5DhY6zKd69-x0PzgYYivSHR2nD3npFGOSLjt-iQ6Gf-FXXuD27RgKVw62Uetvi4L_kip3U-FR07iC8NbhwjNJioDie9irF-qjwsqqPfKF6P084_F2z5iu49Y1YNkS0IKnrvwnCOG-/s72-c/DSCN3611.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-7065504156118433260</id><published>2012-05-21T15:13:00.001-07:00</published><updated>2012-10-24T04:40:07.640-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cetan"/><category scheme="http://www.blogger.com/atom/ns#" term="diesel"/><category scheme="http://www.blogger.com/atom/ns#" term="Eco"/><category scheme="http://www.blogger.com/atom/ns#" term="Marathon"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Great success!</title><content type='html'>The Shell Eco Marathon race is over. And the result is very satisfying. Our team with an extremely tight budget passed technical inspection, finished the race (many teams were disqualified because their vehicles exceeded fuel limit for the race or just broke down). Our achievement was the 3rd place in general classification of Urban Diesel&amp;nbsp;category. It&#39;s the best place any Polish team ever gained in any category. Plans for the next race: get more $$ from sponsors and upgrade the vehicle. Having more money, we could make marvels.</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/7065504156118433260/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2012/05/great-success.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/7065504156118433260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/7065504156118433260'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2012/05/great-success.html' title='Great success!'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-6564864927193696654</id><published>2012-04-16T13:43:00.002-07:00</published><updated>2012-05-28T04:04:18.561-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cetan"/><category scheme="http://www.blogger.com/atom/ns#" term="diesel"/><category scheme="http://www.blogger.com/atom/ns#" term="Eco"/><category scheme="http://www.blogger.com/atom/ns#" term="Marathon"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>What takes my time (Update 15.05.2012)</title><content type='html'>I&#39;ve been still for a couple of months due to a whole bunch of work at the University. Right now, I&#39;m involved in a couple of projects, including&amp;nbsp;my engineering degree project (controller for a exhaust wide-band oxygen sensor) and a project of a vehicle for the Shell&#39;s Eco Marathon. Our team is constructing the vehicle called &quot;Cetan&quot;. It is&amp;nbsp;supposed&amp;nbsp;to compete in SEM&#39;s &quot;Urban&quot;&amp;nbsp;category. It will be powered by a 211ccm diesel engine. Here you go for a movie:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;object class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://i.ytimg.com/vi/pg_kw2TST1M/0.jpg&quot; height=&quot;266&quot; width=&quot;320&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/pg_kw2TST1M?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata&quot; /&gt;



&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;



&lt;embed width=&quot;320&quot; height=&quot;266&quot;  src=&quot;http://www.youtube.com/v/pg_kw2TST1M?version=3&amp;f=user_uploads&amp;c=google-webdrive-0&amp;app=youtube_gdata&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;
The construction is made mostly of fiberglass and aluminium. The total weight of the vehicle must not exceed 205kg. Check out the photos:&lt;br /&gt;
Hood:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uPFtGCSLDEHhmqILrq0viQGaxhVfM4SF491GjKYnqSv3YqFZYvauTv2svUW95upvNRFVcNIySrBQP4w4GbC8cCElShPQqmch_8COLDTqxWktYdkcnyY2GQKeVfNoRHYO0k-QIBMFcfDI/s1600/20120416099.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uPFtGCSLDEHhmqILrq0viQGaxhVfM4SF491GjKYnqSv3YqFZYvauTv2svUW95upvNRFVcNIySrBQP4w4GbC8cCElShPQqmch_8COLDTqxWktYdkcnyY2GQKeVfNoRHYO0k-QIBMFcfDI/s320/20120416099.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Suspension:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSZrGfdaRNrCKg8kkYk42rlJmuvRTzXqILN9Nu75491jm7dFlbU_jpopBc9B0BnIPmkmI_UbLgB5vvaLAXJuGzjvdIQr-WYo5BzRosNh9UF8kKqVhUrbn743w2dmk2A_qIXoByl3oHXkPw/s1600/20120416098.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSZrGfdaRNrCKg8kkYk42rlJmuvRTzXqILN9Nu75491jm7dFlbU_jpopBc9B0BnIPmkmI_UbLgB5vvaLAXJuGzjvdIQr-WYo5BzRosNh9UF8kKqVhUrbn743w2dmk2A_qIXoByl3oHXkPw/s320/20120416098.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Frame:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRrhhQgzHNLrbr4UvWrQyu044xRsz3-Lg-C2QU2eYNheyZsMEi5RtZ9rLHf0dRCRWC7hQpkr0aXeQVENhLW9RBfm3nL627scUaqMQXmMkeci33KXi9ERWdHL_Jcakf_EfQZbsaNjnOg-7x/s1600/20120416097.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRrhhQgzHNLrbr4UvWrQyu044xRsz3-Lg-C2QU2eYNheyZsMEi5RtZ9rLHf0dRCRWC7hQpkr0aXeQVENhLW9RBfm3nL627scUaqMQXmMkeci33KXi9ERWdHL_Jcakf_EfQZbsaNjnOg-7x/s320/20120416097.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgobErpW5zyIEd4OoztXdg_9AspxLFEOwlo7GtMXwjW052M_F5CQkG8nAe6ZgJB6xb8vzwizHtcTgpRUckWFQS5dJ3RRrA33yXiS5dlCQmlYqXyUw4JsuRxtU4jKTZ6RKjcMraaGmO5tM5-/s1600/20120416096.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgobErpW5zyIEd4OoztXdg_9AspxLFEOwlo7GtMXwjW052M_F5CQkG8nAe6ZgJB6xb8vzwizHtcTgpRUckWFQS5dJ3RRrA33yXiS5dlCQmlYqXyUw4JsuRxtU4jKTZ6RKjcMraaGmO5tM5-/s320/20120416096.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Rear:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0eugC4asvoNRymIXk5Jv1lJ_fAJINjuMfeAPxWPQZu56VS4sKqp92dwZwdaNZ5Di_eo4QGRJwhvGr9aAxYVTjFL6Eo-IczZzfY4RJSY9a3t5h_chto2To8xsUbUR8TtLnOBylCnwRB53h/s1600/20120416095.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0eugC4asvoNRymIXk5Jv1lJ_fAJINjuMfeAPxWPQZu56VS4sKqp92dwZwdaNZ5Di_eo4QGRJwhvGr9aAxYVTjFL6Eo-IczZzfY4RJSY9a3t5h_chto2To8xsUbUR8TtLnOBylCnwRB53h/s320/20120416095.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioYZrX1JrybwsomIwaV8Tjwpe50r8mvYS27LV3hydROoyeT8ZD1zPDeXliwyPd4AckPeXSiUDNcrIu6vDi4NcE1ZHbv0nN7MYje8BveVJqoJ0skMedGae-yRHPeIIjjsqajCH1u45UoSy9/s1600/20120416094.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioYZrX1JrybwsomIwaV8Tjwpe50r8mvYS27LV3hydROoyeT8ZD1zPDeXliwyPd4AckPeXSiUDNcrIu6vDi4NcE1ZHbv0nN7MYje8BveVJqoJ0skMedGae-yRHPeIIjjsqajCH1u45UoSy9/s320/20120416094.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Keep your fingers crossed for our project :)&lt;br /&gt;
&lt;br /&gt;
Update:&lt;br /&gt;
Last night we nearly finished the project and our team with no rest head out to Rotterdam. We had to struggle with a tight budget, therefore we might have problems passing inspection - (Urban category vehicle&amp;nbsp;must have nearly every&amp;nbsp;functionality&amp;nbsp;a regular car does).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjli2NTAGbPvuYwEg7Mb4UlTfdfoXgn8uf6MdtD9thVfN5C0JaiIYiG868ZWHnZLDsYQZ0Ft12D2JE3lUaI-2R9PY5jEJvGXDhFv2K_AzC-nODNsRGg0_VbrOCsb570fmhS2DDxQvqu1ops/s1600/20110124182.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjli2NTAGbPvuYwEg7Mb4UlTfdfoXgn8uf6MdtD9thVfN5C0JaiIYiG868ZWHnZLDsYQZ0Ft12D2JE3lUaI-2R9PY5jEJvGXDhFv2K_AzC-nODNsRGg0_VbrOCsb570fmhS2DDxQvqu1ops/s320/20110124182.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2woBaI4zmd9prLn706RLHgX180E9wg9Y_3lOrcLMt8BhACm-pPtqQ-HsdxrWaTUUchCaMlDT-_j54bLGpA1dfFkSYZIUA0jD0Eb_jsexWeH45NrH1F7jFGE410JZ512Gq8Tc6fdAWCbtb/s1600/20110124176.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2woBaI4zmd9prLn706RLHgX180E9wg9Y_3lOrcLMt8BhACm-pPtqQ-HsdxrWaTUUchCaMlDT-_j54bLGpA1dfFkSYZIUA0jD0Eb_jsexWeH45NrH1F7jFGE410JZ512Gq8Tc6fdAWCbtb/s320/20110124176.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGMzy2AEN7aaRm_756NDD8Y0SW3Zfm103JMdkRgn37BvLpmCIOkgxnNVo-8pxi10xJY_DZXEWuGLBUlAGblmoQaU6FPVriGTagLzVX2-V_y61biVagSMDZ3lrMFJp4yLecy2j61APJ4SN-/s1600/20110125189.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGMzy2AEN7aaRm_756NDD8Y0SW3Zfm103JMdkRgn37BvLpmCIOkgxnNVo-8pxi10xJY_DZXEWuGLBUlAGblmoQaU6FPVriGTagLzVX2-V_y61biVagSMDZ3lrMFJp4yLecy2j61APJ4SN-/s320/20110125189.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/6564864927193696654/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2012/04/what-takes-my-time.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/6564864927193696654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/6564864927193696654'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2012/04/what-takes-my-time.html' title='What takes my time (Update 15.05.2012)'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2uPFtGCSLDEHhmqILrq0viQGaxhVfM4SF491GjKYnqSv3YqFZYvauTv2svUW95upvNRFVcNIySrBQP4w4GbC8cCElShPQqmch_8COLDTqxWktYdkcnyY2GQKeVfNoRHYO0k-QIBMFcfDI/s72-c/20120416099.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-8148548231541330662</id><published>2011-11-17T15:07:00.003-08:00</published><updated>2012-05-31T01:15:24.593-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="Codesourcery"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenOCD"/><category scheme="http://www.blogger.com/atom/ns#" term="Toolchain"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>ARM GCC Toolchain for Linux - Part 2.</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://openefi.blogspot.com/2011/11/arm-gcc-toolchain-for-linux-part-1.html&quot;&gt;Part 1.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;IDE&lt;/b&gt;.&lt;br /&gt;
We&#39;ll use Eclipse. You can download it from &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;www.eclipse.org&lt;/a&gt;. Be sure you choose the &quot;Eclipse IDE for C/C++ Developers&quot;. Current release is Indigo. Eclipse does not require installation just un-tar it to the desired destination. Run Eclipse, enter path to the workspace, be careful it must not contain any whitespaces due to compiler problems. Mark that it&#39;s the default destination and confirm. On the next screen choose Workbench. Create a new project: &lt;i&gt;File-&amp;gt;New-&amp;gt;C Project&amp;nbsp;&lt;/i&gt;name it, choose the type:&lt;i&gt; (Makefile project &amp;gt; Empty Project &amp;gt; -- Other Toolchain --) &lt;/i&gt;and click Finish. Before doing anything go to &lt;i&gt;Project&lt;/i&gt; and unmark:&amp;nbsp;&lt;i&gt;Build Automatically&lt;/i&gt; and in&amp;nbsp;&lt;i&gt;Project-&amp;gt;Clean&lt;/i&gt; unmark:&amp;nbsp;&lt;i&gt;Start a built immediately&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s tell Eclipse the path to Codesourcery&#39;s.&amp;nbsp;&lt;i&gt;Project-&amp;gt;Properties-&amp;gt;C/C++ Build-&amp;gt;Settings&lt;/i&gt; chose &lt;i&gt;GNU Elf Parser&lt;/i&gt; and input paths to specified files, e.g.:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/opt/sourcery/bin/arm-none-eabi-addr2line&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/opt/sourcery/bin/arm-none-eabi-c++filt&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
There is a problem in Eclipse Indigo with system environment variables. We need to specify a path on our own.&amp;nbsp;&lt;i&gt;Project-&amp;gt;Properties-&amp;gt;C/C++ Build-&amp;gt;Environment-&amp;gt;Add&lt;/i&gt; name it &quot;PATH&quot;. As the value put semicolon spaced paths to binutils and CS&#39;s compiler. Mine value looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/sourcery/bin&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Eclipse + OpenOCD + GDB.&lt;/b&gt;&lt;br /&gt;
To get it work we need two plugins. You can install add-ons with &lt;i&gt;Help-&amp;gt;Install new software&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
The first one is &quot;Eclipse C/C++ GDB Hardware Debugging&quot;.&amp;nbsp;Go to &lt;i&gt;Help-&amp;gt;Install New Software&lt;/i&gt;. Input download directory to the proper dialog:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;http://download.eclipse.org/tools/cdt/releases/indigo/&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;CDT Optional Features -&amp;gt; C/C++ GDB Hardware Debugging&lt;/i&gt; click Install.&lt;br /&gt;
&lt;br /&gt;
The second one is Zylin. Download directory:&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;http://opensource.zylin.com/zylincdt&lt;/span&gt;&lt;br /&gt;
select &quot;Zylin Embedded CDT&quot; click install. A couple months ago Zylin repository was abandoned but now everything seems to work well.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Running OpenOCD with Eclipse.&lt;/b&gt;&lt;br /&gt;
You can run external tools with Eclipse with one click of a button.&lt;br /&gt;
&lt;i&gt;Run -&amp;gt; External Tools -&amp;gt; External Tools Configurations -&amp;gt; New&lt;/i&gt;&lt;br /&gt;
Name it depending of your config. IE: &quot;JTAG-Pick-Lock + OpenOCD 0.5 + STM32&quot;&lt;br /&gt;
Enter the path to OpenOCD. Mine is:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/usr/local/bin/openocd&lt;/span&gt;&lt;br /&gt;
Arguments:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;-f interface/jtagkey.cfg -f target/stm32f1x.cfg&lt;/span&gt;&lt;br /&gt;
When finish click &quot;Run&quot;.&lt;br /&gt;
&lt;br /&gt;
The final step is creating a debugging profile, so you can enter debugging mode just with a click of the bug button. Go to:&lt;br /&gt;
&lt;i&gt;Run -&amp;gt; Debug Configuration&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Create a new configuration by double-clicking &quot;GDB Hardware Debugging&quot;.Configuration is bounded to the project. You need to specify path to your project and specify executable that will be debugged. Last thing to do in this tab is changing GDB (DFS) Hardware Debugging Launcher. Click select other, mark &quot;Use configuration specific setting&quot; and choose &quot;Standard GDB Hardware Debugging Launcher&quot;&lt;br /&gt;
&lt;br /&gt;
Go to tab named Debugger and specify path to CS&#39;s GDB. Mine path:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/opt/sourcery/bin/arm-none-eabi-gdb&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Find a dialog box called &quot;Port number&quot; and enter value 3333&lt;br /&gt;
&lt;br /&gt;
Go to tab Startup, unmark &quot;Reset and Delay&quot;, unmark &quot;Halt&quot;. Enter initialization commands to the dialog:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;monitor reset halt&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Mark &quot;Set breakpoint at:&quot; and enter &lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;main&lt;/span&gt;&lt;br /&gt;
to the associated dialog.&lt;br /&gt;
&lt;br /&gt;
Mark &quot;Resume&quot;.&lt;br /&gt;
&lt;br /&gt;
This is it. To start your debugging session click &quot;Debug&quot;.&lt;br /&gt;
Have fun!</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/8148548231541330662/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2011/11/arm-gcc-toolchain-for-linux-part-2.html#comment-form' title='Komentarze (1)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8148548231541330662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8148548231541330662'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2011/11/arm-gcc-toolchain-for-linux-part-2.html' title='ARM GCC Toolchain for Linux - Part 2.'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-8853317172572057960</id><published>2011-11-16T13:58:00.001-08:00</published><updated>2013-02-17T04:59:20.260-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="Codesourcery"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="OpenOCD"/><category scheme="http://www.blogger.com/atom/ns#" term="Toolchain"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>ARM GCC Toolchain for Linux - Part 1.</title><content type='html'>This post is inspired by Freddie Chopin&#39;s tutorial showing how to install and configure a free IDE for programming/debugging ARM chips with no output limit. It&#39;s available on &lt;a href=&quot;http://www.freddiechopin.info/&quot;&gt;www.freddiechopin.info&lt;/a&gt; Since it&#39;s for Windows, a bit outdated and in Polish I decided to brief it here.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;IMPORTANT UPDATE (17.02.2013): After completing reading the tutorial, before downloading any software please go to page &lt;a href=&quot;http://www.freddiechopin.info/en/articles/35-arm/87-bleeding-edge-toolchain-o-co-chodzi&quot;&gt;http://www.freddiechopin.info/en/articles/35-arm/87-bleeding-edge-toolchain-o-co-chodzi&lt;/a&gt; and consider using Freddie&#39;s toolchain instead the one from CodeSourcery (Mentor).&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
System: Debian Squeeze 2.6.32-5-686.&lt;br /&gt;
JTAG-Pick-Lock (Amontec JTAG-Key)&lt;br /&gt;
Target: STM32&lt;br /&gt;
&lt;br /&gt;
We&#39;ll be using Eclipse as IDE, Sourcery G++ Lite as toolchain, OpenOCD as debugger.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Codesourcery&lt;/b&gt; &lt;br /&gt;
Download from &lt;a href=&quot;http://www.mentor.com/&quot;&gt;http://www.mentor.com/&lt;/a&gt;&amp;nbsp;Search for &quot;Sourcery G++ Lite for ARM EABI&quot;. Since it&#39;s a bit tricky to find it, here is a direct link for current release: &lt;a href=&quot;https://sourcery.mentor.com/sgpp/lite/arm/portal/release1802&quot;&gt;https://sourcery.mentor.com/sgpp/lite/arm/portal/release1802&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Install with:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ sudo sh&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The installer will ask if you want to modify PATH. Confirm this. After installation check if it succeed. Create file main.c with simple code:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;int main(void)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Try to compile it with:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ arm-none-eabi-gcc main.c&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you get something like:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/opt/sourcery/bin/../lib/gcc/arm-none-eabi/4.5.2/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008018&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and compiler outputs file a.out everything should be ok.&lt;br /&gt;
&lt;br /&gt;
IF your system PATH still isn&#39;t updated you need to edit /etc/profile. Add&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export PATH=$PATH:/your/path/to/sourcery/bin&lt;/span&gt;&lt;br /&gt;
to the file. Go back to previous step to check if everything works.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;OpenOCD&lt;/b&gt;&lt;br /&gt;
Current version of OpenOCD is 0.5.0. Download it form &lt;a href=&quot;http://openocd.sourceforge.net/&quot;&gt;http://openocd.sourceforge.net/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Jtag-Pick-Lock (Amontec Jtag-Key) is FT2232 based. Basically you have to install libftdi-dev and compile OpenOCD with:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ sudo ./configure --enable-ft2232_libftdi --enable-usbprog &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ make &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ make install&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Smooth and easy. Check if it installed correctly:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ openocd --version&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Check if it works:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ sudo openocd -f interface/jtagkey.cfg -f target/stm32f1x.cfg&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
OpenOCD should respond like this:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Open On-Chip Debugger 0.5.0 (2011-11-15-22:39)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Licensed under GNU GPL v2&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;For bug reports, read&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;http://openocd.berlios.de/doc/doxygen/bugs.html&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Info : only one transport option; autoselect &#39;jtag&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;1000 kHz&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;adapter_nsrst_delay: 100&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;jtag_ntrst_delay: 100&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cortex_m3 reset_config sysresetreq&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Info : clock speed 1000 kHz&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Info : stm32.cpu: hardware has 6 breakpoints, 4 watchpoints&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If it does work, you need to add a rule that will allow regular users to use the dongle. Create a file:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/etc/udev/rules.d/45.jtagkey.rules&lt;/span&gt;&lt;br /&gt;
that contains:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SYSFS{idVendor}==&quot;0403&quot;, MODE=&quot;666&quot;, GROUP=&quot;users&quot;&lt;/span&gt;&lt;br /&gt;
(vendor depends on JTAG you use). Save and add your user to the chosen group.&lt;br /&gt;
&lt;br /&gt;
Now you can debug from regular user&#39;s account, yay!</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/8853317172572057960/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2011/11/arm-gcc-toolchain-for-linux-part-1.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8853317172572057960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/8853317172572057960'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2011/11/arm-gcc-toolchain-for-linux-part-1.html' title='ARM GCC Toolchain for Linux - Part 1.'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-1579536599231029994</id><published>2011-09-22T02:13:00.000-07:00</published><updated>2011-11-16T14:26:05.254-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="control"/><category scheme="http://www.blogger.com/atom/ns#" term="EFI"/><category scheme="http://www.blogger.com/atom/ns#" term="engine"/><title type='text'>How simplest EFI works.</title><content type='html'>&lt;div&gt;&lt;b&gt;Let&#39;s start from scratch.&amp;nbsp;How the engine works.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;We&#39;ll consider a four stroke spark ignition engine.&amp;nbsp;Fuel contains energy. By burning fuels we release energy from fuel. Burning fuel is hot - therefore we release the energy on the way of heat. A combustion engine is a machine, that converts energy that fuel contains, into work. To do that we need to put a mixture of fuel and air into the engine, compress it and ignite. Exploding mixture will push the piston. In a four stroke engine, the whole cycle is done in two crankshaft revolutions. It goes like this:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Intake. The intake valve opens (thanks to the camshaft). Fuel and air mixture is sucked into the cylinder while the piston goes down. At the end of a intake stroke the intake valve closes.&lt;/li&gt;
&lt;li&gt;Compression. Both intake and exhaust valves are closed. The piston goes up compressing the air-fuel mixture. Before the piston reaches the top dead center (TDC), spark plug ignites the mixture.&lt;/li&gt;
&lt;li&gt;Work. Combusting mixture pushes the piston down. That&#39;s how force is generated. Naturally both valves are closed.&lt;/li&gt;
&lt;li&gt;Exhaust. Burned fuel converts into exhaust gases. We need to remove them before the new cycle beginns. Exhaust valve opens and the piston goes up pushing exhaust gases out.&lt;/li&gt;
&lt;/ol&gt;&lt;div&gt;&lt;b&gt;How is the air fuel mixture created?&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Few years back carburetor did the job. Nowadays fuel is sprayed by injectors to the manifold, where it mixes with the air. What the EFI does is calculating time of opening fuel injector. The longer it sprays, the more fuel goes into the cylinder.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;There is an important parameter called AFR. It means &quot;Air Fuel Ratio&quot;. Petrol AFR is 14,7. That means that 1 mass unit of fuel needs 14,7 mass units of air to burn completely. Basically AFR higher than 14,7 is lean mixture, lower than 14,7 is rich mixture.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The lean mixture gives a better fuel efficiency. When the amount of oxygen&amp;nbsp;exceeds the needed value to complete burn, petrol particles can find oxygen particles easier. There is a great chance that all particles of petrol will be burned therefore we get good fuel efficiency. However there is no way that all the oxygen particles burn so we get less power. Combusting lean mixture generates more heat. It is dangerous for the engine. The other danger thing is knocking. It&amp;nbsp;occurs&amp;nbsp;earlier on lean mixtures.&lt;/li&gt;
&lt;li&gt;The rich mixture gives more power. There is more fuel than could be burned by the amount of oxygen in cylinder so there is a great chance, that all air will be burned. We use all air in cylinder in order to produce a maximum output. Rich mixture burns in lower temperature (I&#39;ll probably cover this in future) - which is very desirable, furthermore the possibility of knocking is minimized.&lt;/li&gt;
&lt;li&gt;Stoichiometric mixture (AFR = 14,7) &amp;nbsp;is a compromise between the rich and lean mixture. The oxygen sensing in exhaust gases can be used to help keeping stoichiometric AFR.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Ignition.&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Air fuel mixture is ignited by spark plug. Basically mixture is ignited before TDC. It takes a while before mixture burns out. In order to get highest pressure in the optimal point of&amp;nbsp;crankshaft&amp;nbsp;revolution we need to&amp;nbsp;ignite&amp;nbsp;it before TDC. (In some cases of huge load, spark advance must be retarded to near of TDC). The more spark&amp;nbsp;advance&amp;nbsp;we apply, the more power and better fuel efficiency we get, but igniting to soon results in detonations (knocking).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;In the old, mechanical ignition systems there was a fixed point of ignition. Nowadays electronic circuits can modify the spark advance on the fly depending on conditions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;b&gt;So what does the engine controller do?&lt;/b&gt;&lt;br /&gt;
The simplest controller just controls amount of fuel and spark advance. Basically:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The more load, the more fuel.&lt;/li&gt;
&lt;li&gt;The more rotation speed, the more fuel.&lt;/li&gt;
&lt;li&gt;The more load, the more spark timing retardation.&lt;/li&gt;
&lt;li&gt;The more rotation speed, the more spark timing advance.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;Maps.&lt;/b&gt;&lt;br /&gt;
Information about injection time and spark advance are stored in maps. In most cases these are 3D maps that show a function of chosen parameter in domain of load and engine speed.&amp;nbsp;Now we know how it works, don&#39;t we? ECU measures engine speed and load, checks values in maps and sets proper injection time and spark advance. But how to measure engine speed and load?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;RPM - Engine speed.&lt;/b&gt;&lt;br /&gt;
There are two common ways of measuring engine speed. The first way utilizes magnetic induction while the second one utilizes Hall effect. In both cases sensors are attached near to a sprocket wheel which spins dependently to crankshaft (in most cases it&#39;s attached to camshaft). When a tooth passes the sensor, it generates an electrical signal. The ECU measures time between the signals and simple computing gives time that one revolution takes and later number of revolutions per minute.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Load.&lt;/b&gt;&lt;br /&gt;
Engine load depends on how much air fuel mixture goes into the cylinder. Simply - the load is controlled by the throttle. The wider it opens the more load gets to the engine and the engine load increases. How to measure volume of air getting to the engine?&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;You can measure air velocity. Engine load depends on air mass velocity. Air velocity and it&#39;s density is measured by thermo-anemometer, so called MAF (mass airflow sensor).&lt;/li&gt;
&lt;li&gt;You can measure absolute pressure in manifold. When the throttle is closed in manifold arises big&amp;nbsp;under-pressure, when throttle is wide opened under-pressure almost&amp;nbsp;disappears. &amp;nbsp;Knowing the value of absolute pressure and air temperature in manifold, we can predict what mass of air can get to the cylinder. MAP (manifold absolute pressure) sensor converts value of absolute pressure to an electrical signal, that ECU can interpret.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Seems simple? Yay, it is. But in fact these aren&#39;t all things ecu must know to work properly.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Crankshaft position.&lt;/b&gt;&lt;br /&gt;
ECU must know when the piston reaches which position and in which cycle, so it can decide when to start the fuel injection and when to ignite the spark. Position is measured similarly to the engine speed and it can be measured with the same device - a sprocket wheel and a sensor. Difference between speed and position measuring is that the speed must be measured a few times per revolution (RPM can be suddenly changed - that&#39;s why there are many teeth on the wheel). But the ECU couldn&#39;t figure position from a regular sprocket, that&#39;s why one tooth is removed from the sprocket wheel. When the sensor passes larger space between teeth than regular one, ecu knows that it just passed a determined position. Now figure out why &quot;positioning&quot; sprocket must be attached directly to the camshaft and not the crankshaft?&lt;br /&gt;
Answer: crankshaft spins two times every time the camshaft makes one spin.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/1579536599231029994/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2011/09/what-consists-of-simplest-efi.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/1579536599231029994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/1579536599231029994'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2011/09/what-consists-of-simplest-efi.html' title='How simplest EFI works.'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-2016547494212917301</id><published>2011-09-19T05:39:00.000-07:00</published><updated>2012-08-28T02:25:03.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="embedded"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="what processor to start with"/><title type='text'>Embedded programming - how to choose a target processor</title><content type='html'>Purpose of this blog is not a step by step tutorial, therefore I won&#39;t make a tutorial about uC&#39;s programming (besides I&#39;m a beginner&amp;nbsp;as well). If you want to&amp;nbsp;program&amp;nbsp;uC&#39;s I&#39;ll give you some&amp;nbsp;advices:&lt;br /&gt;
- First of all, don&#39;t ask me or communities questions like: &quot;What&#39;s a debugger&quot;. Most questions are answered thousands times, you just need to do the search, if you ask, you&#39;ll just be another lazy, annoying newbie.&lt;br /&gt;
OK.&amp;nbsp;Real advices:&lt;br /&gt;
- Learn C programming language, its simple and efficient. &quot;ANSI C&quot; by Brain Kernighan and Dennis Ritchie is a good point to start. Go through this book before buying a MCU dev kit.&lt;br /&gt;
- Find out which uC suits you best:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Atmel&#39;s AVR is very popular, there is a lot of support, there is a free IDE (from Atmel?): Avr Studio (C, ASM, C++), programmer devices are simple and cheap, there are tons of sample projects, schematics, examples on the internet. A great advantage is BASIC compiler for most AVRs (called Bascom). BASIC is a great programmer&#39;s time saver in some applications, but in some cases produces slow and large output. Bascom isn&#39;t free, but there is some kind of evaluation. Avr is an 8bit uC. And it&#39;s good for beginners. Cont&#39;s of AVR:&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Atmel for unknown reasons, discontinued for a couple of month&#39;s production of world&#39;s most popular hobby MCU&#39;s. That increased AVR&#39;s prices incredibly. Atmel is an unreliable manufacturer.&lt;/li&gt;
&lt;li&gt;Programming devices are cheap and simple, but programming-debugging devices are quite complicated and aren&#39;t that cheap. You will need a debugger sooner or later.&lt;/li&gt;
&lt;li&gt;To be honest AVRs are becoming out of date.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;On the other hand very popular are MCUs based on ARM core. These units are 32bits, have tons of&amp;nbsp;peripherals and are a nightmare for beginners. Most manufacturers don&#39;t provide a free IDE, some have very poor support. If you choose an ARM based MCU, you should have some knowledge about uC&#39;s. Debuggers are very expensive and in fact essential. If you already know something about programming, choose it. (Later you&#39;ll have to choose between the manufacturer and between core version).&lt;/li&gt;
&lt;li&gt;My advice for beginners is to choose Texas Instruments MSP430 16bit uC&#39;s. It&#39;s cheap - search for TI Launchpad dev board, this board has an integrated programmer-debugger. TI provides an Eclipse based IDE that is limited to 16k output code, but 16k is quite a lot of code. Bet you won&#39;t be able to fill a 2k space for a long time ;) MSP430 has a big community, a marvelous and clear support, you don&#39;t need anything else. TI is an excellent choice for a beginner.&lt;/li&gt;
&lt;li&gt;There are many other kinds of MCU&#39;s. Microchip PIC and Motorola are very popular, but I have no experience about it. Worth mentioning is that there are thousands kinds of PIC&#39;s and that Megasquirt is based on Motorola MCU.&lt;/li&gt;
&lt;li&gt;Summary: ARM based uCs seem to be the future in very advanced systems. TI offers a variety of MSP430 uCs from simple units to quite powerful ones.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
- Get familiar with Assembler. It&#39;s useful. I don&#39;t mean, try to write complicated algorithms in ASM, just get familiar with it&#39;s commands and syntax. It will help you figure out how MCU works.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My gear:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;TI Launchpad MSP430 + CCS&lt;/li&gt;
&lt;li&gt;ARM Cortex M3 STM32 (STM32F103RBT) Attached to a simple dev board with fancy TFT Touch Screen (which I haven&#39;t used once ;). I must warn you, that ST provides awful and poor support. Perhaps NXP or TI would be a better choice - I&#39;ll consider this if I need a change.&lt;/li&gt;
&lt;li&gt;A simple DIY contact board with couple of switches, a 2x16 HD47780 Lcd and transistors&amp;nbsp;attachable&amp;nbsp;for both TI and STM32 devboards.&lt;/li&gt;
&lt;li&gt;ARM programmer-debugger: A copy of Amontec JTAG-Key.&lt;/li&gt;
&lt;li&gt;IDE: Eclipse + Codesourcery Toolchain + OpenOCD. Very useful and totally free with no limitations.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
I think that&#39;s all for today.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Cheers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update:&lt;br /&gt;
&lt;br /&gt;
Recently I got a new devboard from ST STM32F4 and a copy of TI&#39;s BeagleBoard - DevKit8000&amp;nbsp;equipped with a Cortex A8 processor. It&#39;s a powerful processor with a huge core designed to run under control of an OS rather than bare metal like other MCUs I mentioned in this post. I am trying to make use of it.&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/2016547494212917301/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2011/09/embedded-programming.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/2016547494212917301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/2016547494212917301'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2011/09/embedded-programming.html' title='Embedded programming - how to choose a target processor'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7018786310714626625.post-924858630063792634</id><published>2011-09-19T04:15:00.000-07:00</published><updated>2011-09-19T09:03:17.531-07:00</updated><title type='text'>Hello World!</title><content type='html'>Hi, I am a student of Mechanical Engineering. Issues of combustion engines control bothers me a lot so I decided to try to gain some knowledge by building an electronic engine control unit. I&#39;ll keep the project open and share experiences here.&lt;br /&gt;
&lt;br /&gt;
There is already an open efi project (Megasquirt), but I think, that learning on my own mistakes is much more fun.&lt;br /&gt;
&lt;br /&gt;
If you find any mistakes or have any remarks, please leave feedback.</content><link rel='replies' type='application/atom+xml' href='http://openefi.blogspot.com/feeds/924858630063792634/comments/default' title='Komentarze do posta'/><link rel='replies' type='text/html' href='http://openefi.blogspot.com/2011/09/hi.html#comment-form' title='Komentarze (0)'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/924858630063792634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7018786310714626625/posts/default/924858630063792634'/><link rel='alternate' type='text/html' href='http://openefi.blogspot.com/2011/09/hi.html' title='Hello World!'/><author><name>Tom</name><uri>http://www.blogger.com/profile/12738240378185749590</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvw9lGaAcdiNTIIx8Be7FHguga6-cnq6inHvwK_fQgcuJfSgMYsAlt8IeyowPHPOsaBE0n2UVScxpFDBjZY1C5nOFVNCwLOXelYaIatSvTOOLkYzqerfcRrIZ4nsn3tg/s220/uaz.jpg'/></author><thr:total>0</thr:total></entry></feed>