View previous topic :: View next topic |
Author |
Message |
danilomayojr
Joined: 17 Feb 2010 Posts: 36 Location: San Fernando City
|
Posted: Sat Dec 21, 2013 11:09 am Post subject: ADC |
|
|
Hi,
Is there any chance to use gather data from Analog input for bascom 8051?? i got pressure sensor that sends analog signal but dont how to integrate it to my mcu. i tried searching the help of bascom for reference (getad) but nothing happens... please help thank you in advance.
p.s. working on pesticide sprayer for our garden _________________ Danilo Mayo Jr. |
|
Back to top |
|
|
Deanus
Joined: 26 May 2006 Posts: 188 Location: Adelaide
|
Posted: Sun Dec 22, 2013 12:07 am Post subject: |
|
|
Hi Danilo,
Try searching for Getadc.
The search without the "C" doesn't find anything.
Regards
Dean |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Sun Dec 22, 2013 10:18 am Post subject: |
|
|
you might want to check the bascom help for : GETAD2051 and getad as mentioned.
you can also use an a/d converter with i2c or SPI control. _________________ Mark |
|
Back to top |
|
|
danilomayojr
Joined: 17 Feb 2010 Posts: 36 Location: San Fernando City
|
Posted: Sun Dec 22, 2013 12:33 pm Post subject: |
|
|
am i using a wrong MCU? im using AT89S52.... is this ok? Thank you _________________ Danilo Mayo Jr. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Sun Dec 22, 2013 1:36 pm Post subject: |
|
|
when your micro has the comparator, you could use the getad2051 but otherwise you need an external a/d converter. _________________ Mark |
|
Back to top |
|
|
danilomayojr
Joined: 17 Feb 2010 Posts: 36 Location: San Fernando City
|
Posted: Mon Dec 23, 2013 1:43 am Post subject: |
|
|
mcu = STC12C5A32S2.. its the same pin to pin config of AT89S52 said by the shop.... i attached the pin config of the MCU. thanks _________________ Danilo Mayo Jr. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Mon Dec 23, 2013 10:20 pm Post subject: |
|
|
this processor has NO comparator. It also has no A/D converter so you need a different processor or an external A/D _________________ Mark |
|
Back to top |
|
|
danilomayojr
Joined: 17 Feb 2010 Posts: 36 Location: San Fernando City
|
Posted: Tue Dec 24, 2013 10:29 am Post subject: |
|
|
According to the datasheet there is comparator sir.. the ADC is in
p1.0 = Reference
P1.1 = Vin..
I just dont know how to configure getad2051() i already tried it but nothing happen _________________ Danilo Mayo Jr. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Tue Dec 24, 2013 10:40 am Post subject: |
|
|
i could not find a datasheet of your chip but i looked at the AT89S52 which did not had this comparator.
when it has one : just look in the help for the circuit. getad2051 _________________ Mark |
|
Back to top |
|
|
|