ugg that doesn't compile either
A bunch of illegal opcode warnings and errors
207 and 122.
ugg that doesn't compile either
A bunch of illegal opcode warnings and errors
207 and 122.
This is what the author of the original code said to me.
That clock is much faster (meaning the 12F657) . The 12c508 has a 4Mhz clock. The return from Pulsin for the 12c508 is: 100 = 1.0 ms, 150 = 1.5 ms, 200 = 2.0 ms. You need to adjust the numbers to whatever your PIC returns in Pulsin. I have not looked at the data sheet. It will be there somewhere, or in the help data for your compiler.
Maybe this is the problem?
It compiled without error on my PBP ver 2.47, I don't mean to be rude, Did you remember to select the appropriate device in the compiler (IDE) up at the top? I am confused are we talking about a 12F675, a 12f657, or a 12c508?
It shows 199 words compiled for 12F675, it will not compile for a 12c508 or 12f508 as is. As for if it will work or not, that's beyond the scope of my examination, and likely ability, but it does compile as is.
Last edited by Archangel; - 26th August 2006 at 08:00.
The reason it fails to compile is due to the config lines beginning with the @ sign. Change it to the format
@ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
and it compiles OK. This is due to using either PBP or MPSAM as the compiler.
What Malc said.
whenever I use
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
' System Clock Options
@ DEVICE pic12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic12F675, WDT_OFF
' Watchdog Timer
@ DEVICE pic12F675, CPD_OFF
it errors all over the place.
@ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF
Works fine but HenrikOlsson said "I THINK it should be MCLR_OFF and not MCLRE_OFF. - try it."
I'm not even sure thats were the problem is or why having the @ device lines like that fails.
I have PBP 2.46 and MPLAB 7.41 MPSAM 5.04
I still have no idea if thats the actual problem im having where the RC signal is basically ignored.
Is anyone able to get this chip to actually work with RC signal with any settings?
I've used the 12F675 as an RC switch and it works fine. The only thing is it was programmed in Assembler, and JAL (which I lost the notes on due to a PC crash).
I'm sure its just a matter of getting the timing correct, so the PIC is able to detect and measure the pusle width of every pulse. As I mentioned above, the RX will be sending a pulse every 20ms, which is generally 1 - 2 ms in duration.
Wouldn't holding the stick cause the signal to repeat and therefore catch it at some point?
I have tried and assumed that it would eventually see the signal but never seems to see anything.
I may have to go picaxe as I can't seem to dissect a data sheet.
Well I just compiled the following and I get flashing LEDs (I haven't got the time this morning to hook up a receiver and test the reading of the PPM signal)
The only change I made was to use GPIO.4 and not GPIO.3Code:'12F675 @ __CONFIG _INTRC_OSC_CLKOUT & _WDT_OFF & _MCLRE_OFF & _CP_OFF DEFINE OSC 4 OPTION_REG.5 = 0 ' clock source internal CMCON = 7 ANSEL=0 Pulselen var word ' Pulselen can be 0 - 255, 100 = 1 ms, 200 = 2 ms Init var word ' Init used to flash LED Clear ' set all variables = 0 Input GPIO.4 ' set pin 5 to RX signal ReadPWM: PulsIn GPIO.4, 1,Pulselen ' pin 4 - read high pulse length, times out after .65535 seconds pause 15 If Pulselen < 50 Then GoTo Blink ' no signal -> blink led If Pulselen > 75 Then GoTo solid ' signal -> Solid led GoTo ReadPWM Blink: For Init = 1 To 3 ' blink led 3 times High GPIO.1 pause 200 Low GPIO.1 pause 200 Next pause 1000 GoTo ReadPWM Solid: High GPIO.1 pause 3000 Low GPIO.1 pause 200 GoTo ReadPWM END
EDIT:
OK so I couldn't go out without testing the code to see if it reads the PPM signal.. sorry to say it doesn't detect it![]()
Last edited by malc-c; - 26th August 2006 at 09:37.
Originally Posted by Joe S.
Oh and yes I chose and am using 12F675
Bookmarks