WiCard ADC (+Tutorial Video)

Electronics and Programming tutorials and projects

WiCard ADC (+Tutorial Video)

wicard adc

With help of my project, ESP8266 and ATmega8a (WiCard) module, you can build this adc project.

WiCard ADC (Analogue to Digital Converter)

There are 22 lines of the pins available for the user to program in WiCard WiFi module. 8 of these lines can be set as “Analogue to Digital Converter” (ADC) input.

PINPort BitAnalogue to Digital Converter
A01VCC 3.3v
A02Ground
A030 
A041 
A052 
A063 
A074 
A085 
A096 
A107 
A1116*
A1217*
A1318*
A1419*
A1525 
B0124 
B0223*
B0322*
B0421*
B0520*
B0615 
B0714 
B0813 
B0912 
B1011 
B1110 
B129 
B138 
B14Ground
B15VCC 3.3v

The ADC data resolution is 10 bit. Also the reference voltage (In the current revision of the firmware 1.0.1) is 2.56v.

The Functions:

Currently there are two functions for Analogue to Digital Converter:

  • ConfigurePinAsADC(ucSettings[7:6] | ucChannel[4:0])

This function needs an 8 bit argument which the first 5 bits sets the ADC channel. Furthermore the last 3 bits sets the configuration of ADC. After calling this function, the PCI core will start converting the signal on channel. So to using an Analogue to Digital Converter channel, always this function must be called.

Currently, configuration bits must be set as 110, That means:

To reading Analogue to Digital Converter data from channel 16, the argument must be 0xD0.

Also 0xD1 for channel 17.

0xD2 is also for channel 18.

0xD3 is also for channel 19.

0xD4 is also for channel 20.

0xD5 is also for channel 21.

0xD6 is also for channel 22.

And 0xD7 for channel 23.

  • uiReadADCBuffer()

This function returns a 32 bit value of ADC data, but the ADC data is a value between 0 – 1023 (10 bit).

Example:

ControlBoxHandler()
{
    ConfigurePinAsADC(0xD6); // ADC Channel 22, Pin B03, Port Bit 22
    musFeed_0 = uiReadADCBuffer();
}

The 16 Bit Feedback:

In the WiCard simulator page there is a “16 bit feedback” tool which is able to show a number between 0 and 65535 (an unsigned 16 bit integer). To using this tool, simply drag and drop the item into the control box.

wicard adc simulator 1

Then double click on it and select the channel that you want to set its ADC data on the feedback.

wicard adc simulator 2

Tutorial Video:

This video will show you how to set a “16 bit feedback” item on an ADC channel of WiCard.

For example in the above video, the pin B03 (ADC 22) reads the Analogue to Digital Converter data from an LDR sensor. Here’s the schematic:

wicard adc

***””Electronics, Programming and Arduino projects, including the source codes, schematics and PCB plans for engineers, student and hobbyists””***

 

Leave a Reply

Your email address will not be published. Required fields are marked *

thirteen + eleven =