Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

convert to HEX a fike written For TASM assembler

Status
Not open for further replies.

pouchito

New Member
Hi ALL :)

I have a source file written for TASM ASSEMBLER and i want to compile it.
I usually use MPLAB and i have never used another Assemlber
I made many research to find a TASM software that can do this job. I found one called TASM 3.1 but yet was not able to get the HEX

ANyone knows how to deal with TASM and can help me to convert the source code to HEX

thanks a lot
 

pouchito

New Member
Still Need your help Please

I have the PIC tape measure from EPE magazine
it is written for TASM assembler

I tried the TASM from
**broken link removed**

It is not working , it is giving me errors !!

Please can you help me convert it ? maybe i m using it wrong :(
 

pouchito

New Member
i convert it to hex but still it is not working :(
So you think there was an error during z conversion or the code is not correct?
 

ericgibbs

Well-Known Member
Most Helpful Member
hi P,
Can you post the first part of your assembler code, the section where you
initialise the assembler. ie; microproc type, type of file you want it to make.

I use the TASM table assembler for some of my micro's.

If you are generating lots of errors from a proven known assembler file, its likely
that you not initialising the asmb correctly.
Regards
EricG
 
Last edited:

pouchito

New Member
the source code i am trying to compile are found here :

**broken link removed**

I used this assembler:
**broken link removed**

it was compiled but not working :S

I don't beleive that the source code is incorrect cz it is published in z magazine
I doubt that there was a mistake in the conversion yet the software change it to HEX without any error :(
 

ericgibbs

Well-Known Member
Most Helpful Member
pouchito,
Converted your orginal TASM to MPLAB, it now assembles OK.
Have not checked for function, just assembly, the rest is up to you.

Use the Project Wizard on MPLAB 7.xx to create a Project.

EricG
 

ericgibbs

Well-Known Member
Most Helpful Member
pouchito,
File failed to attach ??
EricG
 
Last edited:

Eplanet

New Member
hi
i have a picbasic code and i want to convert to HEX file and copy to pic micro please tell me how i should convert to hex
thanks


;LED control program by vladimir Tskhvaradze

include "modedefs.bas" ;include serial modes
pinin var PORTA.1 ;define pinin as porta.1
B0 var byte

POKE TRISB,0 ;set PORTB to output
POKE TRISA,31 ;set porta to input
POKE PORTB,0 ;turn off all LEDs

loop:
SERIN pinin,T2400,B0
POKE PORTB,B0
GOTO Loop



can you give me hex file? i haven't any software
 
Last edited:

Nozapo

New Member
hi
i have a picbasic code and i want to convert to HEX file and copy to pic micro please tell me how i should convert to hex
thanks


;LED control program by vladimir Tskhvaradze

include "modedefs.bas" ;include serial modes
pinin var PORTA.1 ;define pinin as porta.1
B0 var byte

POKE TRISB,0 ;set PORTB to output
POKE TRISA,31 ;set porta to input
POKE PORTB,0 ;turn off all LEDs

loop:
SERIN pinin,T2400,B0
POKE PORTB,B0
GOTO Loop



can you give me hex file? i haven't any software


Hi I have a similar problem as Eplanet.

I was wondering if anyone there could assist with a bit of programming / configuration of the 16F505 I/P (16C505) or 16F676, if someone there was knowledgeable enough and had a few spare minutes to help out?

I have tried MPLAB, but being new to it, I can`t quite seem to get it to work.

I have a choice of 14 pin dil PICs, 16F505 I/P, 16F676 and basic code, originally PORTB, but the 505 only has PORTA & C, so I thought I could just change the portb to port a or c. but the I would require it to be turned into a runnable hex code with checksum. (As required to "upload code to chip" function for burning/programming microchips)

The pins on any of the 14pin chips are configured as follows:
Pin# ------- Function------
1. Vdd
2. Mode A
3. Mode B
4. NC
5. Output D
6. Output C
7. Output B
8. Output A
9. TP1
10. TP0
11. Step
12. Direction
13. Enable
14. Vss (GND)

Source is as follows:
==========================
Code:
'
       '       Hardware Assignments
       '       --------------------
       StepA var PORTA.0
       StepB var PORTA.1
       StepC var PORTA.2
       StepD var PORTA.3

       '
       '       RAM Assignments and Variables
       '       -----------------------------
       CounterA var word
               ' General Counter
       StepDelay var word
               ' Inter-Step Delay (uS)
       StepReverse var bit
               ' 0=Drive Forward
               ' 1=Drive Reverse
       StepOut var byte
               ' a Variable reflecting Stepper Channel Outputs
       StepOnLine var bit
               ' 0=Stepper Off-Line (de-energised)
               ' 1=Stepper On-Line (energised)
       StepMode var Byte
               ' 0=Single Drive A-B-C-D
               ' 1=Two Phase Drive AB-BC-CD-DA
               ' 2=Half-Step A-AB-B-BC-C-CD-D-DA
       StepStatus var byte
               ' Step Status (a value between 0 and 7)
               ' used internally by the StepDrive routine.
               ' Other than presetting at Power-On... do not
               ' otherwise adjust this variable, as it keeps
               ' track of the current coil setting.
               '
               ' Single Step One Phase has FOUR possibilities
               '   0=A
               '   2=B
               '   4=C
               '   6=D
               ' Single Step Two Phase has FOUR possibilities
               '   1=AB
               '   3=BC
               '   5=CD
               '   7=DE
               ' Half-Step has EIGHT Possibles
               ' those eight possibilities are the two single
               ' steps interwoven.
               '   0=A
               '   1=AB
               '   2=B
               '   3=BC
               '   4=C
               '   5=CD
               '   6=D
               '   7=DA

       '
       '       Start Program
       '       =============
       goto JumpStart

       '
       '       Subroutine Nest Area
       '       ====================

       '
       '       Subroutine Drives Stepper
       '       -------------------------
       '       From wherever the current step position happens to be
       '       this routine will drive Forwards or Backwards.  If the
       '       Stepper happens to be parked in an illegal step for
       '       the current Mode, then it will ensure that the Stepper
       '       increments a one-half step first... this ensures that
       '       if the stepper is in position AB, and needs to increment
       '       TWO steps forwards in Mode 0, it increments AB-B-C
       '       rather than AB-C-D.
       '
StepDrive:
               '
               '       this section determines what the NEW StepStatus
               '       should be, depending on the Mode and Direction
               '       of step.
               '
       If StepReverse=0 then
               If StepMode=0 then
                       Lookup StepStatus,[2,2,4,4,6,6,0,0],StepStatus
                       endif
               If StepMode=1 then
                       Lookup StepStatus,[1,3,3,5,5,7,7,1],StepStatus
                       endif
               If StepMode=2 then
                       Lookup StepStatus,[1,2,3,4,5,6,7,0],StepStatus
                       endif
               else
               If StepMode=0 then
                       Lookup StepStatus,[6,0,0,2,2,4,4,6],StepStatus
                       endif
               If StepMode=1 then
                       Lookup StepStatus,[7,7,1,1,3,3,5,5],StepStatus
                       endif
               If StepMode=2 then
                       Lookup StepStatus,[7,0,1,2,3,4,5,6],StepStatus
                       endif
               endif
StepDriveRAW:
               '
               ' All Stepper Coils Disabled
               ' --------------------------
       Low StepA
       Low StepB
       Low StepC
       Low StepD
       If StepOnLine=1 then
               '
               ' Energise Coils to New Settings
               ' ------------------------------
               ' This Lookup table represents [A,AB,B,BC,C,CD,D,DA]
               Lookup StepStatus,[1,3,2,6,4,12,8,9],StepOut
               StepA=StepOut.0
               StepB=StepOut.1
               StepC=StepOut.2
               StepD=StepOut.3
               endif
       Return

       '
       '       Initialise Hardware
       '       -------------------
JumpStart:
       TRISB=%11110000
       StepOnLine=0            ' Power-Off Stepper
       Gosub StepDriveRAW
       Pause 1000              ' Wait for PSU's and Hardware to settle
       StepStatus=0            ' Preset initial Start Point
       StepMode=0              ' Standard Phase Mode 0
       StepReverse=0           ' Standard Forward Movement
       StepOnLine=1            ' bring Stepper On-Line
       Gosub StepDriveRAW
       '
       '       Application Example
       '       -------------------
       '       Gentle Ramp Up Stepper to 200rpm
       '       Run for about 3 Seconds at 200rpm
       '       Fast Ramp Down Stepper to Zero
       '       Pause 5 seconds and repeat Reversing Direction
       '       once this has been done, the Stepper Mode will
       '       change and the proceedure loops over again.
       '       Once all three Stepper Modes have been run, the
       '       program loops and starts over from Mode 0.
       '       ------------------------------------------
       '       200 step motor at 200 rpm=40000 steps/minute
       '       this is approx 666 steps (3.33 revs) per second
       '       Assuming NO program latenticity that's 1 step every 1.5mS
       '       The program will actually add some delay, probably around
       '       100uS but for now, lets assume this is ZERO.
       '       --------------------------------------------
       '       This entire example is dependant on the mass and inertia
       '       of your stepper and it's load.  The Delays may require
       '       serious consideration to make the Ramp-Up/down more
       '       applicable to the hardware and environment.
ExampleLoop:
               '
               '       Slow Ramp-Up Stepper
               '       --------------------
       For CounterA=0 to 2000 step 4
               Gosub StepDrive
               StepDelay=65500-(CounterA*32)
               PauseUS StepDelay
               Next CounterA
               '
               '       Run at constant Speed of 200 rpm (or so) for 3 Seconds
               '       ------------------------------------------------------
       For CounterA=0 to 2000
               Gosub StepDrive
               PauseUS 1500
               Next CounterA
               '
               '       Fast Ramp-Down Stepper
               '       ----------------------
       For CounterA=2000 to 0 step -20
               Gosub StepDrive
               StepDelay=65500-(CounterA*32)
               PauseUS StepDelay
               Next CounterA
               '
               '       Change Direction/Mode
               '       ---------------------
       If StepReverse=0 then
               StepReverse=1
               else
               StepReverse=0
               StepMode=StepMode+1
               If StepMode>2 then StepMode=0
               endif
               '
               '       Wait 5 seconds
               '       --------------
       Pause 5000
       Goto ExampleLoop

       End
===========================

Any assist would be much appreciated.
Thank you
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Top