Stanley Lee
Sat, 27 Oct 2007 14:13:46 -0700
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.
Stanley On 10/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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). > <quote> > 7. INTIO1 Internal Oscillator with FOSC/4 output on RA6 and I/O on RA7 > </quote> > > 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. > > jan > > ------------------------------------------------------------------------- > 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 > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user >
------------------------------------------------------------------------- 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 Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user