View previous topic :: View next topic |
Author |
Message |
wewa
Joined: 02 Jul 2008 Posts: 27
|
Order of #use declarations |
Posted: Sat Feb 14, 2009 10:18 am |
|
|
Hi!
Do I have to keep a particular order with the #use declaration?
In this order: Code: | #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, timeout=100)
#use i2c(master,sda=PIN_C4,scl=PIN_C3,fast=4000,force_hw) | I2C is working.
But in this way: Code: | #use i2c(master,sda=PIN_C4,scl=PIN_C3,fast=4000,force_hw)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, timeout=100) | it doesn't work.
Why? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Feb 14, 2009 1:54 pm |
|
|
1. Post your PIC.
2. Post your compiler version.
3. Post the #use delay() statement.
4. Be aware that your i2c clock speed is set at only 4000 Hz in your #use i2c
statement. Is that what you want ? |
|
![](templates/subSilver/images/spacer.gif) |
wewa
Joined: 02 Jul 2008 Posts: 27
|
|
Posted: Tue Feb 17, 2009 9:10 am |
|
|
1. PIC18F4525
2. #use delay(clock=20000000)
3. v 4.057
4. Not really, but this' only a prototype and speed doesn't matter now. I'll change it in my final prog. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 17, 2009 10:12 pm |
|
|
I compiled it both ways and compared the .LST files and I don't see any obvious problem. You need to post a little test program that shows the
problem. |
|
![](templates/subSilver/images/spacer.gif) |
|