Embedded C programming Tutorial , Keil C ide , microsoftware.gr
Keil CRC and CAN BUS codes.
1. Shift led left
2.It's time for DAVE! <7/6/13>
3.Capture/Compare unit 6
6.Analog converter
7.Memory manipulation routines
8. Recursion
9.Understanding interrupt priorities using CAPCOM2 module
10. POINTERS TO FUNCTION <4/7/13>,<4/28/13>
11.Memory models, memory types
12. The heap , part 1
13. The heap , part 2
14. The heap , part 3
15. Structure example
16. Nested structures, Array of structures.
17. Passing array of structures to function using pointers.<1/5/13>
18. Self Referential Structures
20. Linked list example
21. Circular linked list
22. Union example
23. Enumeration example
24. Watchdog timer example
25. Void pointer example <7/4/13>
26. The sieve of Eratosthenes
27. The stack
28. Union and bitfields as flags example. <6/23/13>
29. Look up table example. <8/11/13>
30. Seven segment display multiplexing -four digits with dot- example
31. LCD character display example - JHD162A
32. Hash table introduction example <8/27/14>
33. Array of Linked Lists example
34. Array of Linked lists-more functions included.
35. Hash table construction,searching and printing.
36. Fininte state machines- a first approach.
37. Finite state machines- two events example.
38. SPI port and an AT25128 serial eeprom hardware.
40. Definite Integral Calculator for Scientists, Engineers...
41 .Hamming distance of a CRC polynomial
42. Linux play starting.
43. Galois GF(2^4) Finite Field
44. Construct your own time triggered real time operating system.
1. Shift led left

This article explains how Keil IDE works.

// About your travel symbols explanation in Keil IDE
see here.
// About basic keys in Keil IDE  see here

example 1 
 Shift led left   

A. Shift led left debuger  
You will explore: typedef, char, int, volatile, while, if , -- , & , | , ~ ,  shift left operator <<  , how to manage parallel ports, how to do simple time delays , how to insert coment  /*   */.

Your travel in Keil IDE: >>rebuild all target files >> start /stop debug session >run

Important selections for the debuger! Watch carefully the selections at the travels:

>>Options for Target>options for Target ‘Target 1’>Debug>setings

>>Options for Target>options for Target ‘Target 1’>Utilities>setings //use the key “Add” to change the setings

exercise 1:change the value of counter1 and watch the resault.

exercise 2: shift led right

exercise 3:  Do a reset (find the key near 'run ' key), set a breakpoind at the command : PIL= PIL<<1 ; and run again and again. Watch the led.

see a video sample

shift led left simulator 

your travel in Keil IDE: >>rebuild all target files >> start /stop debuging session >> peripherals > I/O -ports > PORT1 >> debug > step

Important selections for the simulator! Watch carefully the selections at the travel:

>>Options for Target>options for Target ‘Target 1’>Debug>setings //near the "Use simulator"  selection

exercise:   shift led right
Make it by yourself changing the "<< " shift left operator of the example 1 with ">>"  shift right operator in "shift led left. c" file  in Keil IDE.  
Remember! the leds emit light  when the pins of xc164cm are low (o volts. why?)

 From the begining!
Now we will build the project "shift led left" from the begining! You have in your hand only the file " shift led left.c" for the debuger Take it, or you have the file "shift led left.c" for the simulator Take it. The difference between these two files is the presence of time - delay routines only for the debuger case! The reason is that the led must be enough time at ON or OFF state in order to be visible.

Your travel in Keil IDE:

Make a folder "shift led left" and follow:

>>Project>New project//give the name "shift led left" and save it at "shift led left " folder >Select Device for Target ‘Target 1’>Infineon>xc164cm-8f > OK> uVision3>Yes >>Target 1// open it >(R) Source group 1 > Add files to Group “Source Group 1” >(shift led left.c).    That's it !!!

 And you have to select "simulator" or "debuger":

>>Options for Target>options for Target ‘Target 1’>Debug>  //select simulator or debuger

At the end:
You have to select the Important selections for the simulator  or the  Important selections for the debuger of the example 1.