Continue to Site

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.

Please help a Noob

Status
Not open for further replies.

Newbie08

New Member
Guys am totally new to the assy level programming. Currently am doing a project which requires me to design a microcode for a temperature controller based on 16F88 .There are two heaters H1 and H2 , its assumed that the system cools under natural convection . The actual temp T is regulary measured and converted to an 8bit number and stored in the PIC at 0x20 (microcode for adc is already given) four preset temperatures T1 , T2 , T3 , T4 are stored as 8-bit binary numbers at addresses 0x21 , 0x22 , 0x23 , 0x24 . The overall objective of the system is to keep the actual temp in the range T1 to T2 . the presets are such that T4<T3<T2<T1 . H1 is controlled by Port B , Bit 0 and H2 by Port B , bit1 .
The control algorith is given Below If
T <T2 H1 is switched on . H1 is switched off if T is less than or equal to T1 . H2 switched on if T<T4 . H2 switched off if T less than or equal to T3
The microcode i've written in attached . but am getting a lot of the errors below . Please guide me with this as am totally puzzled:confused::confused:


Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 22 : Symbol not previously defined (porta)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 23 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 25 : Symbol not previously defined (Trisb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 26 : Symbol not previously defined (w)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 27 : Symbol not previously defined (Trisb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 28 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 46 : Symbol not previously defined (c)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 48 : Symbol not previously defined (CheckT1)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 51 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 52 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 61 : Symbol not previously defined (w,1)
Error[128] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 61 : Missing argument(s)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 63 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 71 : Symbol not previously defined (z)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 73 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 81 : Symbol not previously defined (c)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 82 : Symbol not previously defined (Less)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 82 : Symbol not previously defined (Than)
Error[112] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 82 : Missing operator
 

Attachments

  • Temp Control.txt
    2 KB · Views: 207
You did not INCLUDE your PIC???.inc file.

All those names are given in that file to simplify (and make safer) your job.

If you don't know about this, please read about .inc files in the help of MPLAB.

That would not solve the "missing argument" or the "missing operator" errors though. To solve them, look at the instruction set and see what you didn't put that is missing for those instructions. You will find it.
 
Last edited:
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 22 : Symbol not previously defined (porta)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 23 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 25 : Symbol not previously defined (Trisb)...

Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 61 : Symbol not previously defined (w,1)

Error[128] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 61 : Missing argument(s)

Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 63 : Symbol not previously defined (portb)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 71 : Symbol not previously defined (z)
Error[113] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 73 : Symbol not previously defined (portb)...

Error[112] C:\USERS\YUAN FEI\DESKTOP\ICT.ASM 82 : Missing operator


Notice the increasing numbers as the list descends?

Those are the lines of the assembly listing that contain an error.

"Symbol not previously defined (w,1)" and "Missing argument(s)" for line 61, indicate two errors on the same line. BTFSC means 'Bit Test f, Skip if Clear' and expects two values, separated by a comma.

e.g. (Refer to 16F88 Datasheet - Section 16 - Table 16-2)
Usage = btfsc f, b

Register "f" is checked as to whether it contains the value "b".

Depending on the content of Register "f", the next instruction is either executed, or skipped and the subsequent instruction executed.

Register "f" can be the 'Working Register' (W), or another Register that has been "previously defined" in the configuration block, such as "MyReg1".

Syntax is important in that it has to be used consistently throughout the assembly listing:

"MyReg1" may seem to us to be the same as "My Reg1", "My Reg 1", "My reg 1", "my reg 1", "myreg1", and so on, but to a compiler, the examples are as different as apples, oranges and the rest of the fruits available.

With the pointers from "Boomslang", "atferrari" and referring to MPLAB IDE Help re the errors, plus the 16F88 Datasheet, you should get this .asm to a working .hex in no time.

HTH,

Mickster.
 
Boomslang, atferrari,Mickster . Thanks a million u guys ..I understand my mistake now . I was way too careless . Thank u for the eye opener .
 
A long ladder

Don't worry.

Acquiring knowledge is a long ladder up to sky.

You will climb it along the time. Enjoy the trip.

And share!

Buena suerte.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top