Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 6th January 2008, 10:05 PM   (permalink)
Exclamation Changing the hex code

Hi, i'm trying to put my name (anthony) into this air display but i cant
I do it with autor's page code and works excellent!!!!
Thankss
anthony123 is offline  
Old 6th January 2008, 11:00 PM   (permalink)
Default

Why not just modify the code under "algorithm" and re-compile? John
jpanhalt is offline  
Old 7th January 2008, 01:38 PM   (permalink)
Exclamation

The problem is: i dont know re-copiler. Do you can say me what are the rigth tools to do that? Pls help me... i wanna learn about copilation process...
anthony123 is offline  
Old 7th January 2008, 01:58 PM   (permalink)
Default

Quote:
Originally Posted by anthony123
The problem is: i dont know re-copiler. Do you can say me what are the rigth tools to do that? Pls help me... i wanna learn about copilation process...
A free assembler is available at www.microchip.com its the MPLAB IDE7.xx.

http://www.microchip.com/stellent/id...&part=SW007002

Download and install into your PC, use the Help files in the MPLAB.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now  
Old 7th January 2008, 02:01 PM   (permalink)
Default

There seem to be two choices to do what you want to do: 1) Edit the hex code directly; or
2) Edit the source code ("algorithm") and compile to give new hex code.

The first choice in my view is much more difficult, particularly if you are not familiar with coding. You have to use a hex editor, not a text editor. If you use a text editior, it may seem to work from what you see on the screen, but it won't work when you try to re-program the chip. I have used a hex editor couple of times in my work when I did not have access to the source code, but I did have access the hex code. In fact, I did essentially what you are trying to do, namely change the names of some variables. However, as I just stated, it would not be my first choice, since the source code is available in the "algorithm."

The second choice is easiest. The steps in the algorithm that spell out the greeting can simply be change to other letters to spell anything you want. Then when you program the chip the language of the "algorithm" will be converted to hex code by the compiler.

I cannot get much more detailed than that without know what you have for a programmer and whether you are familiar with assembler (assembly) language.

John
jpanhalt is offline  
Old 7th January 2008, 02:20 PM   (permalink)
Default

Quote:
Originally Posted by jpanhalt
The first choice in my view is much more difficult, particularly if you are not familiar with coding. You have to use a hex editor, not a text editor.
Not true, a HEX file is just a standard ASCII text file, Notepad is all you need to edit it - a HEX editor would offer no advantage, and probably put disadvantages in your way?.

However, it's a SERIOUSLY bad idea, you first have to understand fully how a HEX file is constructed (it's explained in the MPASM helpfile), and then how to create the values for one, including the correct checksum value.

Far, far easier to load it in MPLAB and alter the source code, then re-assemble it.

You could also load the HEX file in WinPicProg, and manually edit the HEX files there - as it's displayed as pure machine code, bit for bit, rather than the Intel HEX file format.

But re-assembling the source is the way to go! - if you can't do that, you can't do the other options as they are more difficult.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 7th January 2008, 02:43 PM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
Not true, a HEX file is just a standard ASCII text file, Notepad is all you need to edit it - a HEX editor would offer no advantage, and probably put disadvantages in your way?.
My error, I was just speaking from experience. The program was on floppy and the instrument used a PC, not a microcontroller. The file was an *.exe extension. My first attempt used Notepad on the assumption it was just ASCII. But that totally flopped. Of course, there were lots of nonsense characters. I used a hex editor freedbie, made the same changes to the characters, and it worked. Somewhat later, I read that one could not simply edit an exe file with Notepad and expect it to work.

I certainly defer to your experience and suspect I made an incorrect leap in assuming the exe was simply a hex file. Thank you for the correction. John

Last edited by jpanhalt; 7th January 2008 at 02:46 PM.
jpanhalt is offline  
Old 7th January 2008, 05:02 PM   (permalink)
Default

Well i have MPLAB but i dont know use it!!! Can you guide me saying me few importants steps??
anthony123 is offline  
Old 7th January 2008, 05:14 PM   (permalink)
Smile

will be something like this???
Code:
; name    : JP6293E
; author  : Anthony Sotillet
; date    : 07/01/08

; Microcontroller:  12f629 Speed: 4 Mhz Internal RC

delay 200 miliseconds
Set Comparator Mode 7


variable byte f = 00000000b   ; Output data
variable byte s                  ; Temporal variable
variable byte o                  ; message number.

procedure salida( s as byte ) is
gpio = s
delay 500 us
gpio = 00000000b
delay 200 us         
end procedure

procedure disp ( f as byte ) is
if f = "0" then f = "O" 
if f = "A" then
   salida(0011_0110)
   salida(0000_0101)
   salida(0000_0101)
   salida(0011_0110)
end if
if f = "H" then
   salida(0011_0111)
   salida(0000_0100)
   salida(0000_0100)
   salida(0011_0111)
end if
if f = "N" then
   salida(0011_0111)
   salida(0000_0010)
   salida(0000_0100)
   salida(0001_0000)
   salida(0011_0111)
end if
if f = "O" then
   salida(0001_0110)
   salida(0010_0001)
   salida(0010_0001)
   salida(0001_0110)
end if
if f = "T" then
   salida(0000_0001)
   salida(0011_0111)
   salida(0000_0001)
end if
if f = "Y" then
   salida(0000_0001)
   salida(0000_0010)
   salida(0011_0100)
   salida(0000_0010)
   salida(0000_0001)
end if
if f = "h" then         ; 'h' lowercase = Hearth character
   salida(0000_0010)
   salida(0000_0111)
   salida(0001_0111)
   salida(0011_0110)
   salida(0001_0111)
   salida(0000_0111)
   salida(0000_0010)
end if
if f = " " then        ; space character.
   delay 4 miliseconds
end if
delay 1 milisecond
end procedure

; main program
gpio = all output

if o = 0 then
; Display  "BE HAPPY   "
o = o + 1
forever loop
disp("A")
disp("N")
disp("T")
disp("H")
disp("O")
disp("N")
disp("Y")
disp(" ")
disp("h")
end loop
end if

o = 0
salida(0000_0000)
sleep microcontroller   ; sleep command
nop   ; No operation
anthony123 is offline  
Old 15th January 2008, 10:24 PM   (permalink)
Red face

No body can help me??
anthony123 is offline  
Old 6th February 2008, 08:36 AM   (permalink)
Default

Quote:
Originally Posted by anthony123
Hi, i'm trying to put my name (anthony) into this air display but i cant
I do it with autor's page code and works excellent!!!!
Thankss
TRY THE ATTACHED FILE ANTHONY123
__________________
Regards,
Sarma.

Last edited by mvs sarma; 7th July 2008 at 01:14 PM.
mvs sarma is online now  
Old 6th February 2008, 09:12 AM   (permalink)
Default

Hi Anthony,

it would be a good idea to post the exact authors code which is normally displayed.

I translated a BMS computer program from English to German without touching any other Bit, just replaced the English text with German. The program works fine with no malfunctions.

I have two powerful hex editors and finding the author's code it will be changed very quickly.

Assuming the author didn't deliver the source code (why should he?) the only way to apply changes is going directly to the hex code.

Disassembling would be another choice, but do you know which language was used to create the hex file?

Boncuk
Boncuk is offline  
Old 6th February 2008, 09:56 AM   (permalink)
Default

Quote:
Originally Posted by Boncuk
Hi Anthony,

it would be a good idea to post the exact authors code which is normally displayed.

I translated a BMS computer program from English to German without touching any other Bit, just replaced the English text with German. The program works fine with no malfunctions.

I have two powerful hex editors and finding the author's code it will be changed very quickly.

Assuming the author didn't deliver the source code (why should he?) the only way to apply changes is going directly to the hex code.

Disassembling would be another choice, but do you know which language was used to create the hex file?

Boncuk
His interest appears to be just to see whether he could see his name -- Perhaps thereafter he would practice the PICbasic or assembly.
__________________
Regards,
Sarma.
mvs sarma is online now  
Old 6th February 2008, 02:19 PM   (permalink)
Default

Quote:
Originally Posted by mvs sarma
His interest appears to be just to see whether he could see his name -- Perhaps thereafter he would practice the PICbasic or assembly.
I only want show my name and learn how!!

PD: I dont know use the MPLAB as well as you!! i even dont copile an one single
code in the MPLAB
anthony123 is offline  
Old 6th February 2008, 04:19 PM   (permalink)
Default

Quote:
Originally Posted by anthony123
I only want show my name and learn how!!

PD: I dont know use the MPLAB as well as you!! i even dont copile an one single
code in the MPLAB
Never too late to learn, that would be much easier than trying to modifiy the hex file.
http://josepino.com/pic_projects/air...play_code.html

Here's a flash video I'm working on for using MPLABs Wizard
http://www.blueroomelectronics.com/S...HelloWorld.swf
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
How a Hex code is operated in u-controller? ibrar0 Micro Controllers 11 30th November 2007 09:15 PM
MP Lab Program Help bamafan54 Micro Controllers 3 19th October 2007 03:53 AM
Need some help with a code provided by ATMEL ikalogic Micro Controllers 1 23rd January 2007 03:46 PM
Tough assembly program for the PIC16F84 asmpic Micro Controllers 34 3rd December 2004 07:50 PM
An error in pic16f84a, why? Zener_Diode Micro Controllers 6 11th April 2004 03:55 AM



All times are GMT. The time now is 01:34 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker