Marconi??????
Tesla!!!
If you do not figure it out in a bit. Post the configs/code and tell us again how everything is connected.
Being that it returned something once makes me think something might be loose.
Marconi??????
Tesla!!!
If you do not figure it out in a bit. Post the configs/code and tell us again how everything is connected.
Being that it returned something once makes me think something might be loose.
Dave
Always wear safety glasses while programming.
Well it could be. Although I've just realised that it only posted the 'yyyyy's when I reloaded the program.Being that it returned something once makes me think something might be loose
Speaking of program, could that be the problem (don't forget I'm still the worst programmer in the Northern hemisphere right now)
Tesla_DaveCode:CMCON0 = %00000111 ANSEL = %00000000 TRISIO = %00000000 GPIO = %00000000 DEFINE SER2_BITS 8 MYVAR VAR BYTE MAIN serin2 GPIO.0, 2400,[DEC MYVAR] IF MYVAR = 3 THEN HIGH GPIO.5
Hint...
Take another look at the manual and appendix B , I think it is B, MODE number.Code:serin2 GPIO.0, 2400,[DEC MYVAR]
Then add a short pause maybe 1/4 second, and a GOTO MAIN
MAIN:
Dave
Always wear safety glasses while programming.
I've tried this but it doesn't compile, do I need the 2400baud as well?
serin2 GPIO.0, Mode = 396, [DEC MYVAR]
I've tried this but it doesn't compile, do I need the 2400baud as well?
Code:serin2 GPIO.0, Mode = 396, [DEC MYVAR]
From the manual
' Wait until the character “A” is received serially on Pin1 and put next character into B0
SERIN2 1,16780,[wait (“A”),B0]
' Skip 2 chars and grab a 4 digit decimal number
SERIN2 PORTA.1,84,[skip 2,dec4 B0]
SERIN2 PORTA.1\PORTA.0,84,100,tlabel,[wait (“x”, b0), str ar]
Dave
Always wear safety glasses while programming.
This was my last go for tonight (wouldn't compile though).
I'm going to sleep on it.
Cheers again mackrackit, see you tomorrow.
Tesla_DaveCode:CMCON0 = %00000111 ANSEL = %00000000 TRISIO = %00000000 GPIO = %00000000 DEFINE SER2_BITS 8 con mode = 396 MYVAR VAR BYTE MAIN serin2 GPIO.0, 2400,mode, [DEC MYVAR] IF MYVAR = 3 THEN HIGH GPIO.5 PAUSE 250 GOTO MAIN
Might be another problem...
If all of the PicKIt1 are the same, mine has GPIO.0 connected to the on-board POT (RP1).
Your code is still a bit off, but code will not fix hardware.
Maybe I am looking at the hardware wrong, exactly what do you have? Maybe a picture?
Dave
Always wear safety glasses while programming.
Hi mackrackit,
I've re-cheched my connections:
PIC12F683 on my PICKit1.
I've got common pin5 on the DB9 cable (yellow) going to VSS PIC pin8.
I've got pin3 on the DB9 cable (red) going to GPIO.0 PIC pin7.
And pin2 on the DB9 cable (brown) going to GPIO.2 PIC pin5.
So data is coming from the pc onto GPIO.0Pin 5
Common, ground, zero rail...
This must be connected to both devices for any serial to work.
Pin 2
Data is sent to the PC via this pin. PIC® -->> PC
Pin 3
Data is sent to the PIC® via this pin. PIC® <<-- PC
data is going from the PIC to pc on GPIO.2
How does that look / sound?
Dave
Last edited by LEDave; - 11th April 2010 at 19:58.
Bookmarks