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
 
Tools
Old 25th April 2009, 03:41 PM   #16
Default

Quote:
Originally Posted by AtomSoft View Post
not working still
Don't you have to clear pin 3 of the CMCON0 register to disable the comparator of the 10F206?
eng1 is offline  
Old 25th April 2009, 03:45 PM   #17
Default

yeah 0x07 = 0b00000111
PIN7 = 0
PIN6 = 0
PIN5 = 0
PIN4 = 0
PIN3 = 0
PIN2 = 1
PIN1 = 1
PIN0 = 1


Even this didnt help tho :
Code:
CLRF	    CMCON0

Last edited by AtomSoft; 25th April 2009 at 03:48 PM.
AtomSoft is offline  
Old 25th April 2009, 03:57 PM   #18
Default

bug in the Oshonsoft PIC10F simulator

Tested it on a 'real' 10F206 and it doesn't work as you found


You need to add this to disable T0 clock source on GP2

Code:
 
 movlw ~(1<<T0CS)
 option
__________________
Pete
picprojects.org.uk
geko is offline  
Old 25th April 2009, 03:58 PM   #19
Default

Quote:
Originally Posted by AtomSoft View Post
yeah 0x07 = 0b00000111
PIN7 = 0
PIN6 = 0
PIN5 = 0
PIN4 = 0
PIN3 = 0
PIN2 = 1
PIN1 = 1
PIN0 = 1


Even this didnt help tho :
Code:
CLRF        CMCON0
Yes, you cleared it Take a look at the T0CS bit of the OPTION register. I don't remember its value upon reset, but if it is 1, it will override the TRIS settings on GP2. Does your program work on GP1 without changes?
eng1 is offline  
Old 25th April 2009, 04:00 PM   #20
Default

yay! it works. Thanks to all again lol i guess i gotta read more lol
AtomSoft is offline  
Old 25th April 2009, 05:59 PM   #21
Default

Quote:
Originally Posted by AtomSoft View Post
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. The offending code:
Code:
#define LED1 GPIO.0
#define LED2 GPIO.1
#define LED3 GPIO.2

Last edited by nickelflippr; 26th April 2009 at 03:28 PM. Reason: edit code block
nickelflippr is offline  
Old 25th April 2009, 06:25 PM   #22
Default

awesome dude
AtomSoft is offline  
Old 31st May 2009, 08:44 PM   #23
Default

Dude what does this do?:

Code:
 movlw ~(1<<T0CS)
 option
How can i do this in long code?
AtomSoft is offline  
Reply

Tags
choice, micro, pic

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
MOSFET choice? Nix Electronic Projects Design/Ideas/Reviews 12 31st May 2008 06:12 PM
Choice of Vcc and LDO Regulator Papabravo Datasheet/Parts Requests 16 6th July 2007 03:10 PM
Mic choice epilot General Electronics Chat 28 21st September 2006 07:51 PM
XTAL choice Asjad Micro Controllers 2 17th April 2004 07:17 PM
Choice of barrery? brodin General Electronics Chat 5 5th March 2004 10:37 AM



All times are GMT. The time now is 05:04 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker