![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hey everyone, Can someone suggest a simple programming language i can learn so i can program a 16F877A that i bough, using MPLAB. Im using it for an enginnering project at college and ive only really used flowsheets before so a fairly simple one would be nice, cheers!! Chris | |
| |
| | (permalink) | |
| Quote:
The only other free language is JAL (Just Another Language), but you should really be reasonably proficient in assembler before using anything else. Personally I don't use MPLAB, I just use the assembler MPASM, which is installed along with it typing the code using Notepad and then assembling it with MPASM. | ||
| |
| | (permalink) |
| Thanks for the advice Nigel, you're tutorials look really good, but for tutorial 1 which lines do i need to amend to make the program sutiable for a 16F877A, is it just the 5th and 6th and if so wot do i put it there, thanks | |
| |
| | (permalink) | |
| Quote:
Code: BANKSEL ADCON1 ;disable A2D
movlw 0x06
movwf ADCON1
BANKSEL PORTA | ||
| |
| | (permalink) |
| Does any one happen to know what the config value for a 16F877A - I/P is, as i cant seem to find it on the microchip website. Also what does the I/P at the end stand for??? Cheers | |
| |
| | (permalink) |
| The config value depends on your hardware, (using a crystal or a RC?, want MCLR enabled or not? , ...) The P just means it's a PDIP part. | |
| |
| | (permalink) |
| Im using a 4Mhz ceramic resonator and i want memory clear to be enabled, basicly i just want a test program that will work with a 16F877A to check i have got the circuit and the programmer working right | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| I am now using one of you're programs Nigel which has been slightly altered but i still cant get my circuit to work right, Is the program wrong or is there a problemwith my circuit ;Tutorial 1.1 - Nigel Goodwin 2002 LIST p=16F877A ;tell assembler what chip we are using include "P16F877A.inc" ;include the defaults for the chip __config 0x2909 ;sets the configuration settings ;(oscillator type etc.) org 0x0000 ;org sets the origin, 0x0000 for the 16F628, BANKSEL ADCON1 ;this is where the program starts running movlw 0x06 movwf ADCON1 ;turn comparators off (make it like a 16F84) BANKSEL PORTA 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) |
| What happens when you run it?. | |
| |
| | (permalink) |
| I put it in my circuit which has LED on all the port B outputs and nothing happens. My Other LED comes on to show ive got power (Its just connected across the power lines) and ive checked ive got voltages at the chip in the right places. The only thing i can think of that might be wrong is the oscillator its a 4MHz ceramic resonator [/url]http://uk.farnell.com/jsp/search/searchresultstwo.jsp;jsessionid=IEKJGNQLBP1PRQFIAE XCFE4AVAAS2IV3?_dyncharset=ASCII&action=1&ImgDisp= Y&KWord=&NPart=295267&MPart=&MName=&QText=&_DARGS= %2Fjsp%2Fsearch%2Fcontent%2Fadvancedproductsearchc ontenttwo.jsp.1&x=0&y=0http://<br /> <br /> its connected... this right??? | |
| |
| | (permalink) |
| i believe a ceramic resonator already has the proper capitors built-in. The middle pin of the resonator goes to earth and the pins on the sides go to the clock in/out of the 'F677. you don't need the capaitors on the resonator.
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | (permalink) |
| As Pike has already said, you shouldn't need external capacitors with a ceramic resonator - they come with three pins, and include them internally, the middle pin been the ground connection of the capacitors. If your resonator only has two pins, it's probably not the correct type. | |
| |
| | (permalink) |
| which is the best resonator to use then?? or should i change to a crystal, Is there any in the farnell online catalogue that would do??? Also am I still alright with 4MHz | |
| |
| | (permalink) | |
| Quote:
I might also mention that the first tutorial, which you quoted, flashes the LED's far too fast to see any flashing - the second one explains why, and modifies the first routine. If you have access to a scope, try checking for oscillation on the PIC oscillator pins, you will need to use a x10 probe, a x1 probe will stop the oscillator anyway. | ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |