Looks like Jan is right after I took his suggestion to increase the delay rate. The LED blinking program is working now. Finally thanks for all your help.


On 10/25/07, sdcc@dummgebabbel.de <sdcc@dummgebabbel.de> wrote:
Stanley Lee schrieb:

> Configuration data: 0xc900 0x1e18 0x0700 0x0081 0xc00f 0xe00f 0x400f

This config looks good to me:
- XINST disabled
- DEBUG = disabled
- Fosc is 1001 (internal osc with clock out on ra6)

One advise:
Dont use FOSC=0x34 but use FOSCbits.IRCF0 etc. this makes your code more
readable and you can find errors easier.
> My problem right now is that all 8 LEDs remain on at the same time as
> power is applied to the system. I'm not too sure what I'm missing or
> what I'm doing wrong in my code. I'm somehow getting a clock of 2 Mhz
> for some strange reason (although I have no idea whether it's
> appropriate). I have attached a copy of the code in the email.

You running with Fosc=8Mhz, since the pic need 4 steps to complete an
instruction, the 2Mhz = 8Mhz/4 is ok (see page 23 of the datasheet
chapter 2.1).
7. INTIO1 Internal Oscillator with FOSC/4 output on RA6 and I/O on RA7

A clock cycle takes 4 / 8Mhz = 5e-7 secs. A delay of 2x500 let your LED
blink with a 0.0005 secs or 2kHz. Thats why they seem to be on. They are
just blinking very fast.

Try it with a bigger, like 65530, delay.

So for me everything looks fine now.


This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Sdcc-user mailing list