Problem c lang convert to hex (help)

Programmer, In-Circuit Debugger, PIC Start-Up Kit, Memory Interface...

Problem c lang convert to hex (help)

Postby p4can_lusuh » Mon Sep 06, 2010 9:51 pm

i wrote a program in c language to control servo movement but i don't know how to convert it to hex file. :(
p4can_lusuh
Greenhorn
 
Posts: 3
Joined: Mon Sep 06, 2010 9:45 pm

Re: Problem c lang convert to hex (help)

Postby hyng » Tue Sep 07, 2010 9:26 am

http://www.cytron.com.my/usr_attachment ... ct_16F.pdf

please refer to the doc. The hex code will be auto generated at the project folder after you have successfully built it.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Problem c lang convert to hex (help)

Postby p4can_lusuh » Tue Sep 07, 2010 3:26 pm

HI..thanx for reply.
but still have problem guys.. i copy down the sample code and compile it . but what i found is that the hex file created is no same as the download from the folder hex file . and thus is no working . but if i load the sample hex file to PIC . it work. so what is the problem ? with the sample code SC16A+16F, im using MPLAB IDE v8.30 with HITECH C compiler. is it problem cm from MPLAB version for sk40c?
p4can_lusuh
Greenhorn
 
Posts: 3
Joined: Mon Sep 06, 2010 9:45 pm

Re: Problem c lang convert to hex (help)

Postby hyng » Wed Sep 08, 2010 12:21 pm

p4can_lusuh WROTE:HI..thanx for reply.
but still have problem guys.. i copy down the sample code and compile it . but what i found is that the hex file created is no same as the download from the folder hex file . and thus is no working . but if i load the sample hex file to PIC . it work. so what is the problem ? with the sample code SC16A+16F, im using MPLAB IDE v8.30 with HITECH C compiler. is it problem cm from MPLAB version for sk40c?


Sorry for the trouble caused. The setting of UART baudrate in the C code is for 10Mhz crystal (it has been commented in the code) while the hex code is for 20Mhz crystal. What you have to do is just replace the SPBRG value (0x40 / 64 in decimal) with 129. Anyway, i have updated the code with 20Mhz setting at the product page. You may download it again.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Problem c lang convert to hex (help)

Postby p4can_lusuh » Wed Sep 22, 2010 5:35 am

Sorry for the trouble caused. The setting of UART baudrate in the C code is for 10Mhz cystal (it has been commented in the code) while the hex code is for 20Mhz crystal. What you have to do is just replace the SPBRG value (0x40 / 64 in decimal) with 129. Anyway, i have updated the code with 20Mhz setting at the product page. You may download it again.


hai guys..
desperate for this to my final project. :D
now i know what is SPBRG value. it really help..thanx!
p4can_lusuh
Greenhorn
 
Posts: 3
Joined: Mon Sep 06, 2010 9:45 pm


Return to PIC Development Tool

Who is online

Users browsing this forum: No registered users and 20 guests