Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 4th November 2003, 06:32 PM   (permalink)
Default Trouble starting Pic programming in Basic

Greetings all,
Im having a problem getting any code Ive written to work on a 12F675. Im using PicBasic Pro to compile in the MPLABS IDE. Im also programming threw the USB PicKit 1.

The kit came with a few tutorials that I can get to work(used to verify that the internal clock was indeed running) but I cant get anything I write and compile into HEX to do anything. Ive tried simple:

loop:
High 1
Pause 1000
Low 1
Pause 1000
Goto loop
or
loop:
GPIO.1 = 1
Pause 1000
GPIO.1 = 0
Pause 1000
Goto loop
and a few other simple variants and cant get an led to light. My leds polarity is correct, also the tutorial programs do alot of things with 8 leds on the evaluation board that all work properly.

Ive configured the compiler and MPLAB as stated on their site so Im guessing that I dont have something inside the IDE right. Ive picked the proper chip, and programmer from the MPLABs drop downlists.

Any help or advice will be greatly appreciated.

<EDITED>
I changed gpio's to pin 1, previously I used 3 as an example but pin 3 is a dedicated input so might cause some confusion
Jerran is offline  
Old 5th November 2003, 06:49 AM   (permalink)
Default

kk found part of my problem.

I can get correct output on pins now with the Low and High command (low 1) but why doesnt the GPIO.1 = 1 work? It isnt a huge problem that I cant work around but from what Ive read it should work on my PIC.
Jerran is offline  
Old 5th November 2003, 10:35 AM   (permalink)
Default

You need to set the ports TRIS to configure the pins as outputs.
Exo is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:55 AM.


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

eXTReMe Tracker