Author |
Message |
Topic: Setup ADC on PIC18F4685 |
RageOfFury
Replies: 6
Views: 6521
|
Forum: General CCS C Discussion Posted: Thu Apr 17, 2008 1:51 pm Subject: Setup ADC on PIC18F4685 |
Alright then...
if I use this:
setup_adc_ports(AN0_TO_AN8 | VSS_VDD);
setup_adc(ADC_CLOCK_DIV_32|ADC_TAD_MUL_0);
can I still use ports between AN5 and AN8 for let's a LCD or are they l ... |
Topic: Setup ADC on PIC18F4685 |
RageOfFury
Replies: 6
Views: 6521
|
Forum: General CCS C Discussion Posted: Thu Apr 17, 2008 1:38 pm Subject: Setup ADC on PIC18F4685 |
// Constants used in SETUP_ADC_PORTS() are:
#define NO_ANALOGS 0x0F // None
#define ALL_ANALOG 0x00 // A0 A1 A2 A3 A5 E0 E1 E2 B1 B4 B0
#define AN0_TO_AN9 0x05 // A0 A1 A2 A ... |
Topic: Setup ADC on PIC18F4685 |
RageOfFury
Replies: 6
Views: 6521
|
Forum: General CCS C Discussion Posted: Thu Apr 17, 2008 1:08 pm Subject: Setup ADC on PIC18F4685 |
I need to use ADC channels AN0 to AN5 and AN8. I will be sampling between VSS(GND) and VDD(5V). The other "pins" need to stay digital. How would my setup_adc_ports() look like?
Thanks. :w ... |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Wed Apr 16, 2008 1:03 pm Subject: I2C: PIC(5V) / Sensor(3.3V) |
....I need to use 2 discrete N-channel enhancement MOS-FETs. Any available in through-hole?
2N7000.Alright well we don't have 2N7000s here so I went with an IRF520.
As for the 4 pull ups, what s ... |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Wed Apr 16, 2008 11:11 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Why do you not want to follow the earlier suggestion of the typical way to hook 3.3V I2C and 5V I2C devices together? A search will turn up the document from NXP or others, it is simply 2 mosfets and ... |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Wed Apr 16, 2008 9:26 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Why do you have the 5v side powered through a 200k resistor?
Well because that's the way its wired in the datasheet typical application example.
I am still having problems communicating with my se ... |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Wed Apr 09, 2008 6:53 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Thanks for replying.
Everywhere I look the microcontroller is on the 3.3V side and the sensor on the 5V side. Me it's the other way around. Everything except the sensor is running at 5V, this i ... |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Tue Apr 08, 2008 11:16 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
There is a 2000Ohm impedance between each line and the ground. |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Tue Apr 08, 2008 11:05 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Is it normal for the PCA9306 to become really hot during operation? |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Tue Apr 08, 2008 9:40 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Here is the schematic:
http://img145.imagevenue.com/loc1091/th_68464_I2C_122_1091lo.jpg
(click to view full size) |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Tue Apr 08, 2008 9:23 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
Well I already have the PCA9306.
But looking at the datasheet it would seem that the PIC must be 3.3V and the sensor 5V and not the other way around(the way I have it now). |
Topic: I2C: PIC(5V) / Sensor(3.3V) |
RageOfFury
Replies: 18
Views: 16861
|
Forum: General CCS C Discussion Posted: Tue Apr 08, 2008 9:11 am Subject: I2C: PIC(5V) / Sensor(3.3V) |
I have a I2C pressure sensor that I wish to read using a PIC18F4685. The sensor runs at 3.3V and the PIC at 5V. I'm using the PCA9306 as a voltage-level translator. Will this setup work?
Thanks. :w ... |
Topic: Need help understanding a line of code |
RageOfFury
Replies: 3
Views: 5914
|
Forum: General CCS C Discussion Posted: Thu Mar 27, 2008 9:38 am Subject: Need help understanding a line of code |
var % 10
that's the module(remaining) of var/10
so for example:
N = 185
N/10 = 18
N%10 = 5
so (18*10) + 5 = 185
Ah, ok now I understand. Thanx for clearing that up. |
Topic: Need help understanding a line of code |
RageOfFury
Replies: 3
Views: 5914
|
Forum: General CCS C Discussion Posted: Thu Mar 27, 2008 9:19 am Subject: Need help understanding a line of code |
I'm currently in the middle of converting a C program written for another type of micro controller to PICC. Everything is going quite smoothly except that now I'm stuck at this line of code:
ucCoun ... |
Topic: PIC18F4685 I2C question. |
RageOfFury
Replies: 2
Views: 3639
|
Forum: General CCS C Discussion Posted: Thu Feb 07, 2008 1:21 pm Subject: PIC18F4685 I2C question. |
Thanx for the reply. After discussing it with one of my teachers, he recommended I use a PCA9306, which is a I2C level translator. |
|