Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

library of mikroc programming v1.65

Status
Not open for further replies.

boukamoha

Member level 5
Joined
Aug 3, 2012
Messages
85
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,891
problems in library of mikroc pro v1.65

hi every one

i'm doing now one application using the sd card with spi interfacing to the serial COM , i followed an example in book Advanced PIC Microcontroller

Projects in C: From USB to RTOS with the PIC 18F Series , but when i wanted to initialize the spi bus as the author did , unfortunetely i couldn't find the right function like he has.. the author function for spi bus initialization is :

Spi_Init_Advanced(MASTER_OSC_DIV16,DATA_SAMPLE_MIDDLE,CLK_IDLE_LOW, LOW_2_HIGH);

other wise i have in my library the function :

SPI1_Init_Advanced(_SPI_MASTER_OSC_DIV4,_SPI_DATA_SAMPLE_MIDDLE,_SPI_CLK_IDLE_LOW,_SPI_LOW_2_HIGH); and it doesn't work at all.

the second question is :

please can some one tell me why the author used the function in this format

while(Mmc_Init(&PORTC,2));

because in my opinion the function Mmc_Init() doesn't have arguments .

the third question :

why i don't have a CAN library and i have just spi_CAN?should i do some thing to download it?or my version of mikroc pro is old?

i hope some one can give me a clear responses

thx in advance
 
Last edited:

1 I would guess that you are using a different PIC18 to the PIC18 that the author wrote the code for. Alternatively, maybe the book was written for a different version of compiler than the one you are using.

2 Looks to me like the author was using an older compiler, or an older version of compiler.

3 CAN library will only be available when a CAN-capable PIC is selected. CAN-SPI library will probably be available for most PIC18 varieties (at least on an up-to-date version of compiler). And yes, using the latest version of compiler is generally a good idea, but this will make your reference book even more outdated.

MikroE provide much sample code and good help files with their compilers, but be aware that they will still be written with a particular PIC in mind.
 

I think the code mentioned in the book is hi tech c code or mplab c18 code. You are using mikroC.
 

hi
i'm sure that he is using the mikroc but i think an oldest version, i was working with c18 in mplab before but its totally different then this code, any way i downloaded the new version of mikroc and i'm trying to work on it
thx

- - - Updated - - -

hi
thx for ur response ,i was working with mplab c18 before , and now i downloaded the latest version of mikroc , tell me..in your opinion which compiler worth to learn deeply
c18 of mplab or mikro c ? of course for pic18
thx in advance
 

In my humble opinion:

mikroC is great for hobby projects and for those who want fast results without too much understanding. Great for lazy people like me, but not as satisfying as doing the job properly. In fact, I sometimes wonder if mikroC has made me lazy :oops:

C18 is a much more professional choice. It is harder work and requires a good understanding of the basics before it is possible to progress, but will turn you into a better programmer in the long run, as long as you have what it takes. I wish laziness had not got in the way, as I would have preferred to have continued using C18.

Of course this is generalising and other's opinions will vary.

I found both products to be very good, and both provided me with many hours of fun.

I am in the lucky position of only coding for a hobby, not as a profession.
 
Last edited:

i'm sure that he is using the mikroc but i think an oldest version,

I actually own a copy of the text to which I believe you are referring:

Advanced PIC Microcontroller Projects in C: From USB to RTOS with the PIC 18F Series

You are correct, the book utilizes the MikroC Compiler for all but one chapter on RTOSs which utilizes the CCS C Compiler.

The author, Dogan Ibrahim, has also published:

SD Card Projects Using the PIC Microcontroller

Which uses the Microchip C18 Compiler exclusively.

The exercises/examples in the text to which you refer can be accomplished using the Microchip C18 Compiler and its extensive library or routines as well.

I would also agree with hexreader in regards to the Microchip C18 being a more professional compiler, although not because it is "harder", but due to its closer adherence to both the C89 and C99 C Standards and the readily available source code for its extensive library of routines. Also MikroC has an aggravating tendency to use Microchip's device nomenclature in conflicting ways to which it was originally intended.

BigDog
 

thx hexreader
i think i will use both of them cos i want to acces the profession world...so having 2 compilers is better as i think ..but i will concentrate on c18
boukamoha

- - - Updated - - -

i read that book and i was following all the steps gratefully until i arrived to the SD CARD projects then i couldn't install the microchip application libraries for SD CARD...

can u please give me some books that use the C18 as a reference for projects i want to go forward with more projects like CAN , RTOS ? i will appreciate
thx in advance
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top