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.

PIC Micro Choice

Status
Not open for further replies.
Cow Basic is wierd lol i changed or created a new compile bat to make it simpler:

Code:
@ECHO OFF
E:
cd \PROGRA~1\GCBASIC

GCBASIC /NC %1 /O:%1.asm 
PAUSE

This will compile your file and place it in same directory as original.

Then u would use mplab to load it i assume.
Yes you can import the compiled.asm or yourfile.asm to a MPLAB project if you wish. Or better yet just import the compiled.hex directly to the Pickit 2, clone, or? programmer. With the auto import hex feature of the Pickit 2, you have a one button to download sequence.

Here is some code for GCBasic, if you want to flash some leds on your 10F206. One could just paste into notepad, or any other editor, save to the GCBasic directory, drag and drop on download.bat, then import the compiled.hex to your programmer. A good editor program with a macro function is the best way to go to automate the process and keep your files organized.
Code:
#chip 10f206, 4 
#config INTRC_OSC

dir GPIO b'001000' 

Main: 
For test = 1 to 3 
    SET GPIO.0 ON 
    SET GPIO.1 OFF 
    WAIT 50 10ms 
    SET GPIO.0 OFF 
    SET GPIO.1 ON 
    WAIT 50 10ms 
Next
GPIO = 0
wait 1 s

For nib = 1 to 7 
    GPIO = nib 
    wait 50 10ms
Next
GPIO = 0
wait 1 s
goto Main
EDIT: Deleted unecessary code. An example of cut and pasting from other PIC project file:eek:. The offending code:
Code:
#define LED1 GPIO.0
#define LED2 GPIO.1
#define LED3 GPIO.2
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top