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.

[SOLVED] need hex file for this code.......

Status
Not open for further replies.
I am really tired..


I just copy and paste this code for the work area of MPLAB.......

and Project>Build All

I get 11 errors
Obviously you did not install XC8 and select it as project tool.
 

In Youtube video, you trying to compile the asm generated by MikroC!!!

Try to open HMS.mcppi in MikroC and compile!!!

IF you use the code:

Code:
#include "htc.h"

__CONFIG(0x0770);

unsigned short tick;
... etc...

This is Hitech C Universal ToolSuite. Use option into the MPLAB like picture bellow:
Hitech C Universal ToolSuite.jpg


If use XC8 Mplab ToolSuite, change __CONFIG(0x0770); to __PROG_CONFIG( 1, 0x0770);

More: **broken link removed** https://singularengineer.com/programming-pic-18-using-xc8-mplab-x-configuration-bits-2/
 
Last edited:

OHHHHHHHH...I can do nothing...I dont know what is going? Please help me please

An unavoidable side effect of have someone else do the hard work.

You have to try to learn me the programing? I am Appriciate your hard work...Anyway I can done with your help, If you have time..

Firstly, the specific device for which you need the code compiled is not made clear.

The C code which you originally posted seems to indicate the device is a PIC12F675, while another participate of the thread seems to believe it is a PIC16F88.

What is the actual part number of the PIC for which you require the code compiled?


Secondly, having someone else compile code for you essentially accomplishes nothing, except perhaps providing you will something to submit for an academic assignment.

Of course, such actions will only result in further confusion and frustration when the next assignment is due.

Unfortunately, the only way to learn is by studying the problem and attempting to write and compile your own code.

Repeated failure, followed by eventual success is the only sure way to learn any field of study.


I strongly suggest you select and study a tutorial or set of tutorials which cover this topic.

Install and use only the compiler required by the tutorial(s), at least until you have a firm understand of the procedure of writing and compiling C code.

The previous post recommends the Gooligum Tutorials which I also recommend.

**broken link removed**

They cover both C and Assembly Language programming using both Baseline and Midrange PICs, many are freely downloadable with accompanying lesson code.

Studying these tutorials will certainly help you in your endeavors, if you should encounter issues or questions while studying these tutorials, post them here in this forum for assistance.


BigDog
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
In Youtube video, you trying to compile the asm generated by MikroC!!!

Try to open HMS.mcppi in MikroC and compile!!!

IF you use the code:

Code:
#include "htc.h"

__CONFIG(0x0770);

unsigned short tick;
... etc...

This is Hitech C Universal ToolSuite. Use option into the MPLAB like picture bellow:
View attachment 95071


If use XC8 Mplab ToolSuite, change __CONFIG(0x0770); to __PROG_CONFIG( 1, 0x0770);

More: **broken link removed** https://singularengineer.com/programming-pic-18-using-xc8-mplab-x-configuration-bits-2/


Thank you sir for your valuable comments

When i Compile. I get some error massages

This is the window.

Full page fax print_1-001-001.jpg

and this is the code

HTML:
// simple test program to Flash LEDs:
// D1 on RB7 at 1 Hz
// D2 on RB6 every 60 seconds
// D3 on RB5 every 360 seconds
// D4 on RB4 every 720 seconds

// Internal oscillator PIC16F88 on EasyPIC7 board

// Warning - this is untested amateur code written in a hurry - plenty of scope for improvement

// global variables
char d2_count;
char d3_count;
char d4_count;

char d2_state = 0;
char d3_state = 0;
char d4_state = 0;

void main() {

    TRISB = 0;                                                         // all output
    PORTB = 0;                                                         // all LEDs off
    ANSEL = 0;                                                         // turn off analogue
    OSCCON = 0x72;                                                     // select 8MHz internal osc

    while(1){                                                          // loop forever
        for (d4_count=0 ; d4_count < 2 ; d4_count++){                  // 2
            for (d3_count=0 ; d3_count < 6 ; d3_count++){              // 6
                for (d2_count=0 ; d2_count < 30 ; d2_count++){         // half of 60 for toggle
                     PORTB.B7 = 1;                                     // LED D1 on
                     delay_ms(500);                                    // half second delay
                     PORTB.B7 = 0;                                     // LED D1 off
                     delay_ms(500);                                    // half second delay
                }
                d2_state++;                                            // toggle bit 0
                PORTB.B6 = d2_state;                                   // toggle LED D2
            }
            d3_state++;
            PORTB.B5 = d3_state;                                       // toggle LED D3
        }
        d4_state++;
        PORTB.B4 = d4_state;                                           // toggle LED D4
    }
}

thank you
 
Last edited:

hummm...
I have using MikroC Pro 5.61 and compile fine!!!
MirkoC.jpg

See Attach!!!
 

Attachments

  • Edaboard2.rar
    8.7 KB · Views: 39
Last edited:

Sorry to see this only today, i thought of that when i posted last time, as you see, a hex file has been attached to my previous post.

pityu
 

He forgot the P!!!

PORTB.B7 = 1;
No, that was not the point - I just took that as a typo. I have edited post 28 to make the point clearer.

The point is... why is F7 better than B7 ?
My understanding is that the two forms are completely equivalent and either is fully acceptable for MikroC compiler, but maybe my understanding is flawed?

EDIT: @manoj madhavan Please ignore posts 27 to 30 - they will not help you with your problem in any way
 
Last edited:

No, that was not the point - I just took that as a typo. I have edited post 28 to make the point clearer.

The point is... why is F7 better than B7 ?
My understanding is that the two forms are completely equivalent and either is fully acceptable for MikroC compiler, but maybe my understanding is flawed?

EDIT: @manoj madhavan Please ignore posts 27 to 30 - they will not help you with your problem in any way

Hello Sir


How can I obtain the correct file? any hope?
 

Zip and post the code and mention the PIC used and Clock frequency. I will Compile with mikroC PRO PIC 6.0.1 and post the files.

Try this. I Compiled from above code.
 

Attachments

  • Edaboard2 b.rar
    22.7 KB · Views: 50

Hello Jayanth

You need any payments for this?

Hello Jayanth



https://obrazki.elektroda.pl/5993859800_1376830023.jpg


This is the request

Please help me out

- - - Updated - - -

Zip and post the code and mention the PIC used and Clock frequency. I will Compile with mikroC PRO PIC 6.0.1 and post the files.

Try this. I Compiled from above code.

Code working but the 2nd LED will ON at 30 seconds...I want 60 second acurate timing (Acurate Timing).
 

I want 60 second acurate timing (Acurate Timing).
You're starting to be abusive. Me and some other guys from here gave you the full code, code that you would have to adjust only by changing some variables to get the timing you want. I tried mine in simulator, and it works. You just have to install a compiler and make fine adjustments. Are you even trying? I don't think so.

pityu
 

You're starting to be abusive. Me and some other guys from here gave you the full code, code that you would have to adjust only by changing some variables to get the timing you want. I tried mine in simulator, and it works. You just have to install a compiler and make fine adjustments. Are you even trying? I don't think so.

pityu

Thank you for the comments... I try to build for what I really want. First I dont learn about the programming.. But I guess something and I do it.. I try much time to small changes to the source code. After I change the source code, I build the hex file and simulate. I get some good result and I try to changes in the source code again and the process continues..

After all I get the Hex file, I make the hex file with the help of all helpers and my beloved friends in this site...

Thank you everyone who helped to build the hex file...I am so ZERO in the programming field, I learn someting (only little bit ) in the filed of programming. I try to check much programme and how the programme writed and how its works.... Finally I get the Good correct result.


So thank you all my friends in this site (EDABoard.com) again and all the best.

Bless you all
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top