Author |
Message |
Topic: Why not run the same code on two PICS |
fiasgardone
Replies: 8
Views: 12907
|
Forum: General CCS C Discussion Posted: Thu Oct 15, 2015 11:13 am Subject: Why not run the same code on two PICS |
your way...
#byte portb=3969
is awkward since the datasheet refers to address in HEX not DECIMAL, so it would be better to use F81 the same as the datasheet.
Also it's better to use descript ... |
Topic: Why not run the same code on two PICS |
fiasgardone
Replies: 8
Views: 12907
|
Forum: General CCS C Discussion Posted: Thu Oct 15, 2015 9:09 am Subject: Why not run the same code on two PICS |
This is also why the compiler now supports using names for such registers. So:
#byte portb=getenv("SFR:PORTB")
#byte portc=getenv("SFR:PORTC")
Will ... |
Topic: Why not run the same code on two PICS |
fiasgardone
Replies: 8
Views: 12907
|
Forum: General CCS C Discussion Posted: Thu Oct 15, 2015 9:05 am Subject: Why not run the same code on two PICS |
Hi!! Thank you for your help!
I really had not noticed this detail, I have a doubt you said that the address I / O PORTB was F8a of 4550, but from what I saw in datasheet is F81h! or am I doing confu ... |
Topic: Why not run the same code on two PICS |
fiasgardone
Replies: 8
Views: 12907
|
Forum: General CCS C Discussion Posted: Thu Oct 15, 2015 6:34 am Subject: Why not run the same code on two PICS |
Hi!! thanks for help
I do not yet have much experience with pics 18F,
almost I worked with 16F.
so my question to ask for help! I've seen the datasheet of the pic and still did not get that pic 18f ... |
Topic: Why not run the same code on two PICS |
fiasgardone
Replies: 8
Views: 12907
|
Forum: General CCS C Discussion Posted: Thu Oct 15, 2015 4:19 am Subject: Why not run the same code on two PICS |
Hi!
I have this code and want to experiment with the pic 16f887 and pic 18F4550!
With pic 16f887 it works well, but the pic 18F4550 does not work, where the error is?!
I appreciate all the help
... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Mon Apr 20, 2015 10:09 am Subject: MQ-2 Sensor |
Hi!
Thank you all!
Well .... therefore I have to take the tests as anybody show!
After doing the test, I post the results here!
Thank you very much |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2015 2:20 pm Subject: MQ-2 Sensor |
If you are not going to do what we suggest then we are wasting our time...
If I'm here to ask for help is because I am not able to deal alone this AD problem, and I always try to understand and do ... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sun Apr 19, 2015 7:03 am Subject: MQ-2 Sensor |
In the comments of the OP, it says 'LM393' which is an opamp, so assuming you're using a premade board with the sensor feeding the LM393 AND that it's be configured to give 0 V out for 0 gas, 5 volts ... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2015 5:04 pm Subject: MQ-2 Sensor |
Hi!
The val variable must have a value to be compared with the variable adc_result reading AD converter, so that the LED only lights up when you have a value of anologica entry about 25% of gas enter ... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2015 4:53 pm Subject: MQ-2 Sensor |
Basic trouble shooting 101
What is the output of the sensor ? Maybe it's busted ??
Normally you'd 'simulate' the sensor with a pot and test with it, recording the Vin to ADC versus the raw 10 bi ... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2015 3:11 pm Subject: MQ-2 Sensor |
Thank you for your answer Ttelmah!
Yes, the chip works very well, did tests and works 100%.
Modified the variables as described, and the ADC is not working!
I used variables float, because wi ... |
Topic: MQ-2 Sensor |
fiasgardone
Replies: 15
Views: 26959
|
Forum: General CCS C Discussion Posted: Sat Apr 18, 2015 2:02 pm Subject: MQ-2 Sensor |
Hi!!
I'm doing tests with a MQ-2 gas sensor, but the code below does not work ยจ
What I really want to do, is when the sensor detects over 25% of gas lights a LED on pin, but the code compiles fin ... |
Topic: Problem with function |
fiasgardone
Replies: 6
Views: 6735
|
Forum: General CCS C Discussion Posted: Sun Sep 01, 2013 3:16 am Subject: Problem with function |
Hi! Ttelmah thanks for helping me!!
I have some books on C programming, but logic programming is that I have had some difficulties in solving this as well!
The function is to configure the DS130 ... |
Topic: Problem with function |
fiasgardone
Replies: 6
Views: 6735
|
Forum: General CCS C Discussion Posted: Sat Aug 31, 2013 4:29 pm Subject: Problem with function |
Hello Ttelmah
Yes, the problem is how the variable (i) remains at zero when C3 = 0, the first time so you can enter the code 1.
Unfortunately I am not able to operate with the knowledge that I hav ... |
Topic: Problem with function |
fiasgardone
Replies: 6
Views: 6735
|
Forum: General CCS C Discussion Posted: Sat Aug 31, 2013 1:08 pm Subject: Problem with function |
Hello Ttelmah thank you for answering my questions.
I've done several tests, but without any result.
The variable (i) is a global variable this initialized to (0) when (C3 = 0) to variable (i) is ... |
|