brentonw2004
New Member
Hello again everyone. I have a PIC 16F819 and I am having difficulties getting started with this chip. I have worked with some more basic PICs before, but I needed the ADC of the 16F819. I have it hooked up as follows:
Pin4 -> 2.7K -> +5V
Pin5 -> GND
Pin7 -> LED -> GND
Pin14 -> +5V
Here's my very simple Pic Basic Pro code:
loop:
HIGH PORTB.1
PAUSE 500
LOW PORTB.1
PAUSE 500
GOTO loop
My first problem with this is that I am getting basically random signals from all of the other pins, some are high and some are low whenever I haven't told any but PORTB.1 to do anything. It took me a while to realize, but the code actually is working, but the timing is very slow. It takes roughly a minute for the LED to change to high or low when it should only take half a second. I am guessing that there is an internal clock that has something to do with this. How do you set the internal clock? Do I have to use an external crystal? On the 16F628 I just hooked it up this same way and it worked fine. My last problem, is that I tried to hook it up to a serial cable and send data to my computer using SEROUT, but it wouldn't do anything. I am guessing that this is also because of the timing in the chip. Does the microchip have to have a USART to communicate serially? Any advice at all would be greatly appreciated.
Thanks!
Brent
Pin4 -> 2.7K -> +5V
Pin5 -> GND
Pin7 -> LED -> GND
Pin14 -> +5V
Here's my very simple Pic Basic Pro code:
loop:
HIGH PORTB.1
PAUSE 500
LOW PORTB.1
PAUSE 500
GOTO loop
My first problem with this is that I am getting basically random signals from all of the other pins, some are high and some are low whenever I haven't told any but PORTB.1 to do anything. It took me a while to realize, but the code actually is working, but the timing is very slow. It takes roughly a minute for the LED to change to high or low when it should only take half a second. I am guessing that there is an internal clock that has something to do with this. How do you set the internal clock? Do I have to use an external crystal? On the 16F628 I just hooked it up this same way and it worked fine. My last problem, is that I tried to hook it up to a serial cable and send data to my computer using SEROUT, but it wouldn't do anything. I am guessing that this is also because of the timing in the chip. Does the microchip have to have a USART to communicate serially? Any advice at all would be greatly appreciated.
Thanks!
Brent