Seems you didn't have a look to the thread i suggested, but anyways...
RA.3 is a full CMOS output type, so unless
- you have this pin shorted to gnd
- this i/o is blow
it have to work. Try with another PIC.
Seems you didn't have a look to the thread i suggested, but anyways...
RA.3 is a full CMOS output type, so unless
- you have this pin shorted to gnd
- this i/o is blow
it have to work. Try with another PIC.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I used another one and the same result.
This pin is not connected yet so outer components don't interfere.
Here's the whole code. It is a POT command replacement that fits to my circuit (RC = 420 µs). Normally Wert is replaced by Wert2's contents.
If you are not german, you should understand it anyway(Wert means value, Zaehler = counter, Gelb = yellow and Gruen = green)...
Which thread are you referring to ?Code:Define OSC 8 Variablen: PORTA=0 TRISA=0 CMCON=7 TRISB = 0 PORTA = 0 ;VRCON = $20 Gruene_LED VAR PORTB.5 Gelbe_LED VAR PORTB.4 ADCWert VAR WORD Erster_Wert VAR WORD Zweiter_Wert VAR WORD Zaehler VAR WORD Zahl VAR BYTE ;Interrupts INTCON = 0 Start: Zahl = 0 FOR Zahl = 1 TO 4 High Gelbe_LED Pause 167 Low Gelbe_LED Pause 307 NEXT Zahl GOSUB Wert Erster_Wert = ADCWert WRITE 0, Erster_Wert.BYTE0 WRITE 1, Erster_Wert.BYTE1 Pause 2931 Zahl = 0 FOR Zahl = 1 TO 4 High Gruene_LED Pause 167 Low Gruene_LED Pause 307 NEXT Zahl GOSUB Wert Zweiter_Wert = ADCWert WRITE 2, Zweiter_Wert.BYTE0 WRITE 3, Zweiter_Wert.BYTE1 Pause 2791 IF Erster_Wert = Zweiter_Wert THEN High Gelbe_LED Pause 3140 Low Gelbe_LED Pause 2010 ENDIF IF Erster_Wert <> Zweiter_Wert THEN High Gruene_LED Pause 3140 Low Gruene_LED Pause 2010 ENDIF GOTO Start Wert: HIGH PORTA.3 PAUSE 5000 LOW PORTA.3 RETURN Wert2: ADCWert = 0 Trisa.3 = 0 High Porta.3 Pause 243 Trisa.3 = 1 ;Vertrauscht WHILE Porta.3 = 1 ADCWert = ADCWert + 1 WEND Zaehler = 600 - ( (600 / 1200) * ADCWert) Pauseus Zaehler RETURN END
Last edited by selbstdual; - 5th February 2007 at 22:44.
i didn't check the whole thing but i confirm that it blink PORTB.5 led, then turn on the LED on PORTA.3, then turn it off.
Your PIC i/o is dead OR there's a bad contact.
And i posted a link before in post #2 about the config fuses.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Good ideas.
How can I support you in doing so ?i didn't check the whole thing
Having replaced the PIC I don't think so. I usually press it gently but firmly in the socket. Sometimes I even press when running.Your PIC i/o is dead OR there's a bad contact.
Having read it fully, I will comment that. After my first impression it is just a summary of what fuses are possible. I think I am limited to the ones MPLAB offers ?! Additionally most settings are set to work in most cases so do you suggest focusing on something special for this issue ?And i posted a link before in post #2 about the config fuses.
Yes, you're limited to what's in the .INC file of your PIC.I think I am limited to the ones MPLAB offers ?
Well if the simple TOGGLE PORTA.3 loop don't work, you have to fix it first. Trust me it's working here.How can I support you in doing so ?
Well depending what you call most case.. but me, i use around 50 different PIC model and i have thousands PBP code examples, templates, projects and includes store in my computer. So... how on hearth can i remind what i'd set in all of them and how the hardware is set-up on board... I can't even predict what i'll do next time. This is why i always comment the default config fuses and set ALL of them in my code. One day if i have to modify it, i have only one place to check.Additionally most settings are set to work in most cases so do you suggest focusing on something special for this issue ?
Same rules apply to the other thousand code example on other microcontroller brands and other compiler i also use.
Last edited by mister_e; - 5th February 2007 at 23:56.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I fixed it, now it works. Let's see if the other code works aswell.Well if the simple TOGGLE PORTA.3 loop don't work, you have to fix it first. Trust me it's working here.
Tell me something: How can I be sure that a problem can be found in the externals ? There are so many switches in the chip - the manufacturer calls them features, I name them obstacles.
The other code doesn't work, because the capacitor doesn't discharge.
I am using a WIMA MKS 4 0,01/250-N4 capacitor, I guess that means 10nF.
The resistor is 40K.
That should mean it takes 0,00004 seconds to charge and at a maximum the same to recharge due to - er - well-intended voltage levels.
Then I am recharging it, while counting, but it doesn't stop. When short circuiting the capacitor it works, so the code is OK.
Is this cap no 10nF - cap ?
Is there anything to be changed in the code ?
ADCWert = 0
Trisa.3 = 0
High Porta.3
Pauseus 244
Trisa.3 = 1
High Gruene_LED
WHILE Porta.3 = 1
ADCWert = ADCWert + 1
WEND
Low Gruene_LED
Zaehler = 600 - ( (600 / 1200) * ADCWert) ;to keep time even
Pauseus Zaehler
RETURN
Bookmarks