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.

Need help!

Status
Not open for further replies.

1Steveo

New Member
I am trying to make a delay timer for a relay. using a PIC 12c508a

I have some code but cannot find a compiler to turn it in to a hex file to burn it into the micro.
This is for a one time use and is vary small basic code.

Here is my code:

Device 12c508a

DECLARE XTAL 4
CONFIG WDT_OFF,INTRC_OSC,MCLRE_OFF,CP_OFF
DECLARE WATCHDOG OFF
TRISIO = %00001000 ' Make GPIO.3 an input
Symbol PIR = GPIO.3
Symbol RELAY = GPIO.2

DELAYMS 60000 'wait 60 seconds
DELAYMS 60000 'wait 60 seconds
DELAYMS 30000 'wait 30 seconds

CHECKIT:
IF PIR = 1 THEN 'check sensor
RELAY = 1 'turn on relay
DELAYMS 1000 'wait a second
RELAY = 0 'turn off relay
ENDIF
DELAYMS 30000 'pause 30 seconds
GOTO CHECKIT 'do it again
END

Can Some nice person Compile this for me!

Thanks
Steve
 
It would help if we knew for what compiler this was written.
It fails to compile with my picbasic compiler and also with Pic basic Pro
 
Poof

28 0A 6D 00 2C 00 FF 0C EC 01 03 07 ED 01 03 07
24 0A 03 0C 2B 00 DF 0C 0F 09 03 0A 6B 00 2A 00
E7 0C EA 01 6B 02 FC 0C 03 07 1A 0A EA 01 03 06
16 0A EA 01 00 00 EB 03 16 0A 0A 06 1F 0A 2A 07
23 0A 00 00 23 0A 00 08 C4 04 A4 04 00 00 00 08
64 00 FF 0C 27 00 29 00 08 0C 27 00 06 00 EA 0C
2D 00 60 0C 02 09 EA 0C 2D 00 60 0C 02 09 75 0C
2D 00 30 0C 02 09 66 07 43 0A 46 05 03 0C 2D 00
E8 0C 02 09 46 04 75 0C 2D 00 30 0C 02 09 3B 0A
03 00 48 0A FF 3F FF 3F FF 3F FF 3F FF 3F FF 3F

Resc.
 
Proton

I believe the lite version Proton can be downloaded from their site for free. I've tried pretty much every type of PIC based Basic language compilers and so far Proton exceeds them in both code size and run speed.

I had been using Mbasic and gave Proton a try and now use it pretty much exclusively. In Mbasic I tried quasi/interrupt based PWM control for multi lines and it failed miserably or at the very least gave horrible results, I tried it with Proton and I can now get 12 lines of Hardware quality PWM in a 0v-5v range from a 16F84A which I figured could never happen with compiled basic.

Resc.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top