![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I'm trying to learn my way around PICs. All I want to do is pulse an LED using only a 3V source. I'm using a 16F684A and the spec says it has an operating range of 2.0 - 5.5V. It also states that the "Voltage on all other pins with respect to VSS is -0.3V to VDD + 0.3V." I can get the LED to turn on only when Vdd is 4.20V or higher. I'm running an internal 4MHz clock and theres only the PIC and the LED on the board. The LED has a VF of roughly 1.7V. In theory if I apply 3V for Vdd then there should exist 3V at the output pin of where the LED is placed, more that enough to bias it. What am I doing wrong? | |
| |
| | (permalink) |
| Post your code. | |
| |
| | (permalink) |
| hi, What value are the LED segment resistors ?, are the LED's common anode/cathode? [sounds like CC] Do you have a transistor in the common of the LED?
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| |
| | (permalink) |
| Here's all I have. There are no active components in the circuit. Just one LED. The I/O will source/sink 25mA automatically. Again, the code and the built circuit works fine at 4.3V and above. I can see the LED turning ON and OFF at a visible rate. I can apply 3V to Vdd but I get nothing, 0V, at the I/O port being tested. There is no segment display. Just one LED. Code STATUS equ 03h ;Address of the STATUS register TRISA equ 85h ;Address of the tristate register for port A PORTA equ 05h ;Address of Port A COUNT1 equ 21h ;First counter for our delay loops COUNT2 equ 22h ;Second counter for our delay loops bsf STATUS,5 ;Switch to Bank 1 movlw 00h ;Set the Port A pins movwf TRISA ;to output. bcf STATUS,5 ;Switch back to Bank 0 Start movlw 1Fh ;Turn the LED on by first putting movwf PORTA ;it into the w register and then Loop1 decfsz COUNT1,1 ;Subtract 1 from 255 goto Loop1 ;If COUNT is zero, carry on decfsz COUNT2,1 ;Subtract 1 from 255 goto Loop1 ;Go back to the start of our loop. ;This delay counts down from ;255 to zero, 255 times movlw 00h ;Turn the LED off by first putting movwf PORTA ;it into the w register and then on Loop2 decfsz COUNT1,1 ;This second loop keeps the goto Loop2 ;LED turned off long enough for decfsz COUNT2,1 us to see it turned off goto Loop2 goto Start ;go back to Start and turn LED END Thanks | |
| |
| | (permalink) |
| Only PIC and LED? No resistor? How about the decoupling caps?
__________________ Superman returns.. | |
| |
| | (permalink) | |
| Quote:
Also post all your code, not just a part of it - and use the 'code' tags (click on Go Advanced) to sorround your code to maintain it's formatting. | ||
| |
| | (permalink) |
| Not sure on this pic as I have not used it, but make sure that pin is set to an output and look for CMCON in the spec just in case. But you did say it "works" at a higher voltage? Does it blink or just light up? Also, as stated, add that current limiting resistor Post a drawing and the complete code (as requested) and I am sure someone will get you working. | |
| |
| | (permalink) | |
| Quote:
Even as simple as a part number and you get it wrong.
__________________ L.Chung | ||
| |
| | (permalink) |
| It sounds like you have brown out reset enabled in the CONFIG bits. This can cause the PIC to be in reset as long as the supply voltage is lower than 4.2V.
__________________ --- The days of the digital watch are numbered. --- | |
| |
| | (permalink) |
| kchriste I believe there had to be something related to PIC setup that needed to be addressed. The PIC is 16F648A. eblc1388: I mixed the numbers around, no need to be a jerk. Nigel Goodwin: The LED would have burnt out within seconds if the current were any higher than I had stated and I used an ammeter to see what it was drawinig (without current limiting resistor) when I coded the LED to remain ON. It works, I can code it to blink at a 30mA and code it to leave the LED ON with no problem. Same LED was used for many days now. I still works. | |
| |
| | (permalink) |
| Mixing up the numbers makes a big difference. I checked the BOR voltage in the 16F684 data sheet yesterday and didn't post as the value is much too low to be the problem. On a 16F648 the BOR voltage can be as high as 4.35V and is probably your problem. Maybe you should apologize to eblc as due to him you may have found your problem. Mike. | |
| |
| | (permalink) |
| Yesterday I found that the VBOR of PIC16F684 is from 2.0 V to 2.2 V. Then I thought that was the current limiting resistor problem. If it is PIC16F648A, then it is probably the problem. The VBOR for this PIC is from 3.65 V to 4.35 V. But anyhow, the resistor is still needed. Don't be stubborn, I've burned a few PICs simply because of not putting in the resistor for turning on the LED.
__________________ Superman returns.. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Basing a PWM output on an Analogue input | turbo-brown | Electronic Projects Design/Ideas/Reviews | 6 | 12th September 2007 02:00 AM |
| Output = Input - Problems | adamthole | Micro Controllers | 20 | 24th April 2007 05:09 AM |
| 555 timer output help for a newbee... | WIZARDSV650S | Electronic Projects Design/Ideas/Reviews | 6 | 6th April 2007 05:04 AM |
| Using PicBasic with Output compare for sounds | mduong77 | Micro Controllers | 7 | 29th March 2007 03:29 AM |
| How to design such output stage | eeglp | Electronic Projects Design/Ideas/Reviews | 4 | 8th April 2003 07:01 PM |