![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) | |
|
ok the dunce is back, and i just cant seem to get things right so if someone could look at this simple piece of code and tell me why it wont work it would be real nice (simple to you maybe) im taking things real easy and well it compiles but it dosnt work so it must be my understanding is wrong so if you could point me in the right direction there as well it would also be nice :roll:
Quote:
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
||
|
|
|
|
|
(permalink) | ||
|
Quote:
Maybe.. |
|||
|
|
|
|
|
(permalink) |
|
I'm not familiar with the dialect, but presumably you are defining BUTUP as PortA.0?, and the same with BUTDN and PortA.1?.
But then a couple of lines later you set them as zero?. Presumably, as this doesn't give an error?, it's redefining the two definitions?. |
|
|
|
|
|
|
(permalink) |
|
ok this is how it is, i am a bit scared to write in assembler as i had to do that a college (using MASM in hnd software engineering) a few years ago and although i passed the modules it was like having your teeth drilled as far as i was concerned and that was simple to draw three wire frame boxes one inside the other!! so the word assembler strikes the fear of god into me. what i am trying to say is i have a little vellman p8048'1 programmer for 8,18 and 28 pin 300mil dil packages the software that came with it says it cant see the programmer so i found microstudio pro which does see it and i am using that and RE PIC PROGRAMMER to program the pic its all over the place tell me how to start PLEASE or shoot me all i want is a way of programming a pic properly with a language that dosnt require a phd just to understand and break down or modify some examples (basic ones that is)
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
|
|
|
|
|
|
(permalink) | ||
|
i guess niether mine nor Nigels stab at the problem worked?
Quote:
Quote:
|
|||
|
|
|
|
|
(permalink) |
|
or you could try googling
c pic programming turned up a lot of references |
|
|
|
|
|
|
(permalink) | ||
|
williB Wrote
Quote:
The english oxford dictionary states Quote:
so you think i should start with assembler?? ok ill give it a go...(ive got my own gun )
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
|||
|
|
|
|
|
(permalink) |
|
ok good choice let me give you an outline(code ) to get you started
|
|
|
|
|
|
|
(permalink) |
|
|
|
|
|
|
|
|
(permalink) |
|
Ok ive downloaded the mpasm program and manual i assume you would like me to get my teeth into that
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
|
|
|
|
|
|
(permalink) |
|
this is borrowed from nigel
cut & paste this code tell me wether it assembles.. Code:
;Tutorial 1.1 - Nigel Goodwin 2002 LIST p=16F628 ;tell assembler what chip we are using include "P16F628.inc" ;include the defaults for the chip __config 0x3D18 ;sets the configuration settings ;(oscillator type etc.) org 0x0000 ;org sets the origin, 0x0000 for the 16F628, ;this is where the program starts running movlw 0x07 movwf CMCON ;turn comparators off (make it like a 16F84) bsf STATUS, RP0 ;select bank 1 movlw b'00000000' ;set PortB all outputs movwf TRISB movwf TRISA ;set PortA all outputs bcf STATUS, RP0 ;select bank 0 Loop movlw 0xff movwf PORTA ;set all bits on movwf PORTB nop ;the nop's make up the time taken by the goto nop ;giving a square wave output movlw 0x00 movwf PORTA movwf PORTB ;set all bits off goto Loop ;go back and do it again end |
|
|
|
|
|
|
(permalink) |
|
save it to a text file with the extention
.asm |
|
|
|
|
|
|
(permalink) |
|
it has 15 errors
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
|
|
|
|
|
|
(permalink) |
|
can u cut & paste the .err file here
use the code button |
|
|
|
|
|
|
(permalink) |
|
well here they are
Code:
Error[132] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 2 : Unknown processor (16F628) Error[105] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 3 : Cannot open file (Include File "P16F628.inc" not found) Error[131] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 4 : Processor type is undefined Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 9 : Found label after column 1. (movlw) Error[108] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 9 : Illegal character (0) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 10 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 10 : Illegal opcode (CMCON) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 12 : Found label after column 1. (bsf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 12 : Illegal opcode (STATUS) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 13 : Found label after column 1. (movlw) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 13 : Illegal opcode (b) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 14 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 14 : Illegal opcode (TRISB) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 15 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 15 : Illegal opcode (TRISA) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 16 : Found label after column 1. (bcf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 16 : Illegal opcode (STATUS) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 19 : Found label after column 1. (movlw) Error[108] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 19 : Illegal character (0) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 20 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 20 : Illegal opcode (PORTA) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 21 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 21 : Illegal opcode (PORTB) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 22 : Found label after column 1. (nop) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 23 : Found label after column 1. (nop) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 24 : Found label after column 1. (movlw) Error[108] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 24 : Illegal character (0) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 25 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 25 : Illegal opcode (PORTA) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 26 : Found label after column 1. (movwf) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 26 : Illegal opcode (PORTB) Warning[207] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 27 : Found label after column 1. (goto) Error[122] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 27 : Illegal opcode (Loop) Error[131] C:\DOCUME~1\ADMINI~1\DESKTOP\MYFIRST.ASM 30 : Processor type is undefined
__________________
In the game of life the fact is, everyone loses, but I sure enjoy playing. |
|
|
|
|