336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://www.sonsivri.to/forum/index.php?topic=920.0

 

 CCS CMikroC 의 비교 !!!

MicroC:
Used ROM : 36
Used RAM : 18


CCS C:
Used ROM : 69
Used RAM : 9

CCS C --> more ROM, smaller RAM
MicroC --> smaller ROM, more RAM

큰 차이점

-CCS doesn't show the asm code of whole program.

It cuts the some important intgrated operation like multiplication:

프로그램 & 어셈블리 출력들 ▽

Micro C:

char a,b;

void main()

{

//a=3;

//b=5;

PORTB = a*b;

}

MikroC - ASM Output:

; ASM code generated by MikroVirtualMachine for PIC - V.8.1.0.0

; Data / Time: 04/03/2008 15:37:48

; Info: http://www.mikroe.com

; ADDRESS   OPCODE   ASM
; ----------------------------------------------
$0000   $281D         GOTO   _main
$0004   $   _Mul_8x8_U:
$0004   $1303         BCF   STATUS, RP1
$0005   $1283         BCF   STATUS, RP0
$0006   $0870         MOVF   STACK_0, W
$0007   $00F1         MOVWF   STACK_1
$0008   $01F0         CLRF   STACK_0
$0009   $3008         MOVLW   8
$000A   $00FC         MOVWF   STACK_12
$000B   $0871         MOVF   STACK_1, W
$000C   $0CF4         RRF   STACK_4, F
$000D   $1803         BTFSC   STATUS, C
$000E   $2813         GOTO   $+5
$000F   $0BFC         DECFSZ   STACK_12, F
$0010   $280C         GOTO   $-4
$0011   $01F1         CLRF   STACK_1, F
$0012   $3400         RETLW   0
$0013   $1003         BCF   STATUS, C
$0014   $2818         GOTO   $+4
$0015   $0CF4         RRF   STACK_4, F
$0016   $1803         BTFSC   STATUS, C
$0017   $07F1         ADDWF   STACK_1, F
$0018   $0CF1         RRF   STACK_1, F
$0019   $0CF0         RRF   STACK_0, F
$001A   $0BFC         DECFSZ   STACK_12, F
$001B   $2815         GOTO   $-6
$001C   $0008         RETURN
$001D   $   _main:
;Muitiplication.c,3 ::       void main()
;Muitiplication.c,7 ::       PORTB = a*b;
$001D   $1303         BCF   STATUS, RP1
$001E   $1283         BCF   STATUS, RP0
$001F   $0820         MOVF   _a, 0
$0020   $00F0         MOVWF   STACK_0
$0021   $0821         MOVF   _b, 0
$0022   $00F4         MOVWF   STACK_4
$0023   $2004         CALL   _mul_8x8_u
$0024   $0870         MOVF   STACK_0, 0
$0025   $0086         MOVWF   PORTB
;Muitiplication.c,8 ::       }
$0026   $2826         GOTO   $

CCS C:

#include<16F88.h>

#FUSES NPWDT    //No Watch Dog Timer

#FUSES INTRC_IO //Internal RC Osc, no CLKOUT

#FUSES NOLVP    //Low Voltage Programming on B3(PIC16) or B5(PIC18)

#use delay(clock=8000000)

char a,b;

Void main()

{

Output_B(a*b);

}

 

CCS C - ASM Output:

CCS PCM C Compiler, Version 4.068, 34857 03-Apr-08

SetupPCW.exe

Filename:  경로

I:\PIC-Elektronik\PIC\Prog_Source Codes\ccs_c PCW\PIC16F88 Projeleri\PIC16F88 Binary Mult.lst

               ROM used: 69 words (2%)
                         Largest free fragment is 2048
               RAM used: 9 (2%) at main() level
                         10 (3%) worst case
               Stack:    1 locations

0000:    MOVLW    00

0001:    MOVWF    0A

0002:    GOTO    02A

0003:    NOP

..............#include<16F88.h>

..............// Standard Header file for the PIC16F88 Device

.............#device PIC16F88

.............$list

.............

.............#FUSES NOWDT        //No Watch Dog Timer

.............#FUSES INTRC_IO    //Internal RC Osc, no CLKOUT

.............#FUSES NOLVP        

//Low Voltage Programming on B3(PIC16) or B5(PIC18)

.............#use delay(clock=8000000)

............char a,b;

............void main()

.................... {
002A:  CLRF   04
002B:  BCF    03.7
002C:  MOVLW  1F
002D:  ANDWF  03,F
002E:  MOVLW  72
002F:  BSF    03.5
0030:  MOVWF  0F
0031:  MOVF   0F,W
0032:  BCF    1F.4
0033:  BCF    1F.5
0034:  MOVF   1B,W
0035:  ANDLW  80
0036:  MOVWF  1B
0037:  MOVLW  07
0038:  MOVWF  1C
....................    Output_B(a * b);
0039:  BCF    03.5
003A:  MOVF   20,W
003B:  MOVWF  22
003C:  MOVF   21,W
003D:  MOVWF  23
003E:  GOTO   004
003F:  BSF    03.5
0040:  CLRF   06
0041:  BCF    03.5
0042:  MOVF   78,W
0043:  MOVWF  06
.................... }
0044:  SLEEP

Configuration Fuses:

Word 1: 3F70

NOWDT PUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG

CCPB0 NOPROTECT INTRC_IO

Word 2: 3FFF

FCMEN IESO

 

In MikroC

Fuses & Clock are setted at separately.

MikroC에서

퓨즈클락은 셋된다. at 개별적으로.

Same fuses & clock rate has choosen.

같은 퓨즈 & 클락률은 이미 선택됬다.

So, All everything same.

그래서, 모든것이 같다.

But,

the outputs are not same.

하지만

그 출력은 같지않다.

As you can see,

CCS C has not multiplication algorithm

but MikroC has.

네가 볼수있는바와같이,

CCS C는 갖고있지않다. 다중 알고리즘을

하지만 MikroC는 갖고있다.

 

This program is very very short.

이 프로그램은 매우 매우 짧다.

Then,

that is not a true comparison.

그런다음,

사실비교가 아니다.

But gives us some ideas.

I use CCS.

But I have trying MikroC in a few days.

난 사용한다. CCS를.

하지만 난 이미 시도하고있다. MikroC를 in a 몇일동안.

MikroC has some internal utilities an statements.

MikroC는 갖고있다. 몇몇 내장 유틸리티들을

And also, I didn't run USART with CCS

but MikroC I have run.

그리고 또한, 난 돌리지않았다. USART를 with CCS로

하지만 MikroC는 돌린다.

 

Some code but CCS

didn't give any output at USART PIN's.

몇몇 코드 but CCS가 아닌

는 주지않았다. any출력을 at USART 핀에.

Because of the fact that,

I tried MikroC.

그러한 사실때문에,

난 시도했다. MikroC를.

Now, I am testing both anywhere.

But I like CCS...

이제, 난 테스트하는중이다. 둘다 어디서든.

하지만 난 좋아한다. CCS를.

'Mikro C Pro' 카테고리의 다른 글

Bluetooth Code using HC-06 module  (0) 2015.08.09
MikroBootloader  (0) 2015.06.19
MikroC pro for AVR 설치법  (0) 2015.06.15
Making Hex  (0) 2013.01.19
Posted by ElectricShock
:

Making Hex File

2013. 1. 23. 14:13
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://www.edaboard.com/thread129581.html

 

Where is the HEX file after compilation in CCSC ?

 

At IDE,

go to MENU > OPTIONS > FILE FORMATS > OBJECT FILE

and mark : 8 bit HEX.

 

Gp to Tools > Folder Option > View

Then uncheck hide extensions for known file type as shown in the figure

Press apply and ok

 



http://www.ccsinfo.com/faq.php?page=compile-program

 

  1. Open the CCS PCW IDE and select Menu -> Open from the ribbon along the top of the main window or from the menu bar if using the classic style IDE. Make sure that the name of the project to compile appears at the bottom of the IDE Editor window. If the project is already opened, multiple projects are open, or the project name does not appear at the bottom of the editor, right-click on the program you want to compile and select Make File Project from the pop-up menu.

만약 프로젝트가 이미 열려있고, 다중 프로젝트가 열려있으면,

혹은 프로젝트 이름이 나타나지않으면 at the 에디터의 밑에,

우클릭해라. on the 프로르램상을

그리고 택해라. Make File Project를 from pop-up menu의.

 

2. There are four types of compilers: (at the picture above.△)

 

 

3. Select Options -> Project Options from the ribbon

along the top of the main window or from the menu bar if using the classic style IDE.

In the Project Options window that appears, there are four different sections that allow for changes to be made to the compiler operation:

 


 

Allows source files to be added & removed from the current project.

 

Allows directories to be specified to search for header files needed for the project.

By default,

the CCS C Compiler directories for Devices & Drivers should appear in the list. 

Allows the creation of #define statements to be used during compiling.

 

Allows changes to the format and types of output files created during compiling.

 

4. To compile the files in a project,

select Compile from the ribbon along the top of the main window

or from the menu bar if using the classic style IDE,

and select one of the following options:

Compile    - Compile all the units in the current project

or a single unit selected from the drop-down menu.

Build        - Compiles units that have changed since the last compilation and rebuilds the project.

컴파일한다. 이미 바뀐 유닛들을

Build All    - Compiles all the units and builds the project.

Clean        - Deletes the output files for the project.

 

 

5. After the program is compiled,

a prompt will appear showing the types of files created and the amount of ROM and RAM used by the program.

Press any key to close the window or it will auto-close after a certain amount of time has passed.

The program can then be used for programming or debugging purposes.

 

 


 How to renew the source path

 

To do this, I need to open an other source file which has "C" extension.

because there's no way to remove source file I've made

from project directory.

 

Go to C:\Program Files\PICC\Devices

check out if PIN_A5 is in Header File.

'MPLAB > CCSC Syntax' 카테고리의 다른 글

CCSC Syntax & Functions  (0) 2013.01.26
Posted by ElectricShock
:

Making Hex

2013. 1. 19. 15:58
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

에러 처리(in Fuse Setting in Mikro C)

만약 위 그림과 같은 Fuse Error가 보인다면.

http://www.microchip.com/forums/m694831.aspx

 

 

포럼 사이트 추천

 

http://zentronics.wordpress.com/tag/how-to-use-mikroc/

 

 Edit Project (Ctrl + Shift + E)

Choose the appropriate configuration fuse settings. Click OK.

 

 

Set the fuse settings properly.

 

 Add related C.files to Sources

H.files to Header Files.

 

 

 

All Libraries that are not use should be unselected.

사용되지않는 라이브러리들은 선택해제 되야만한다.

Otherwise, it might cause compilation error for some cases.

그렇지 않으면 에러를 유발할 가능성이 있다.

 

 

Click Build (Ctrl + F9).

If your code is error-free, you should get the picture above.

 

 


 

 

http://www.microchip.com/forums/tm.aspx?m=544634&mpage=&print=true

From Voltmeter example...

 

Now I noticed that

the directives #task, #use, and #device were not understood by the preprocessor
Also i removed a line before compiling that, the line was "#include <18F8520.h>"
제거했다. a 라인을 before 컴파일링하기전에 that을, 그 라인은 #include <18F8520.h>였다.

I removed it because i will not use that same PIC,

제거했다.it을 왜냐면 난 같을 PIC를 사용하지않을꺼기 때문에,

and the file was not found by the compiler too...
(I will also add some additional lines to provide the right configurations for clock.... but need to figure this out first)

그리고 그 파일은 검색이안된다. by the 컴파일러에의해서

(난 또한 추가할것이다. some 추가적 라인들을 to 제공하기위해 the 올바른 구성요소들을 for 클락을위한... but 알필요가있다. 이걸 우선)



So i'm wondering, it said that the code was designed for mikroC, and i did not make any changes to it...
What alternatives am i looking at in order to make this compile correctly?


 Edit Project

In order to set the configuration bits go to Project -> Edit Project.

단축키(=ShortCut) -- Ctrl+Shift+E

You can see all the options for selecting clock oscillator, WDT, Power up timer, etc.

Select the right setting for your project.

In this example, I am using the internal RC clock, and so I selected Internal RC No Clock option for the oscillator.

If you are using the MCLR reset pin, you should select Enabled option for Master Clear Enable.

To compile

click on Build -> Build or hit Ctrl + F9.

If there are no errors,

the HEX file will be generated successfully inside the same project folder

and you will see Project Finished Successfully message in the message window, at the bottom.

 


 

Q

I am after some information on how to use the #Include directive in MikroC.

I really want to know how an include file is set up from start to finish as I just cannot seem to get it to work.
The error message I get is: Can't open include file "display.h"

Does this mean that

it cannot find my include file or it CAN find it but doesn't like what I have in it?

I have opened some example programs with includes in then

and have tried to copy what has been done, with no luck.

I am beginning to think that

the biggest problems I have are located between my ears! :D

To anybody

that is kind enough to reply,

please take your time, it is not urgent,

I'm just frustrated that I don't know how to get it to work.

Thanks.

 

A1.

I have copied the .h file from another folder  

난 이미 복사했다. 그 헥사 파일을 from 다른 파일로부터 

 and altered it to suit my project,

그리고 바꿨다.그걸 to 어울리게 내 프로젝트에

now seems to work OK.

지금은 괜찮아보인다.

So, I have got it to work but don't really understand what I have done. :roll:

그래서 난 알았어to동작하는법을 but 정말 이해가안가 뭘 내가 했는지.


A2.

The preprocessor directive #include pulls in header files (extension .h)

into the source code.

Do not rely on preprocessor

to include source files (extension .c)

- see Add/Remove Files from Project for more information.

The syntax of #include directive has two formats:

#include 문법은 갖고있다. 두가지 포멧들을:

 

#include <header_name>

#include "header_name"

 

The processor removes the #include line

and

replaces it with entire text of the header file

at that point

in the source code.

프로세서는 제거한다. the #include 라인을

&

교체한다.it을 with 전체 택스트와 of the 해더파일의

at 그 지점에서

in the 소스코드안에서.

The placement of the #include

can therefore influence the scope and duration

of any indentifiers in the included file.

그 배치는

can 따라서 영향을 미칠수있다. the 범위 &기간에

of 어느 식별자들의 in the 포함된 파일안의.

 

 

The difference between the two formats

lies in the searching algorithm

employed in trying to locate the include file.

그 차이점 between 그 두 포멧들사이의.

은 있다. in the 검색 알고리즘

고용된 in 노력하는데 to 위치잡기에 the include파일을.

 

If #include directive was used with the <header_name> version,

the search is made successively

in each of the following locations,

in this paticular order:

만약 #include 지시어가 사용됬다면 with the <header_name> 버젼과,

그 서치는 만들어진다. 연속적으로

in 각각 of the 따라오는 위치들안에,

in 이 특정 순서로:

 

MikroC installation folder > "include" folder

your custom search paths

The "header_name" version specifies a user-supplied include file;

MikroC will look for the header file in following locations,

in this particular order:

 

the project folder (folder which contains the project file .pcc)

MikroC installation folder > "include" folder

your custom search paths

 

 


Making a Hex file in MikroC Pro

If no errors are encountered, the MikroC for PIC will generate output files.

Upon successful comilation, the Mikro C for PIC wil generate output files in the project folder.

'Mikro C Pro' 카테고리의 다른 글

Bluetooth Code using HC-06 module  (0) 2015.08.09
MikroBootloader  (0) 2015.06.19
MikroC pro for AVR 설치법  (0) 2015.06.15
CCS 와 MikroC 의 비교  (0) 2013.01.23
Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백