Page 1 of 1

Analog Output

Posted: 26 June 2013, 1:25 AM
by geocool
Microcontroller: ZX24s

I'm using Arduino Library with my microcontroller.
I tried yesterday to use analogWrite Function to test a single LED with the Arduino Fade example. Unfortunately I figured out that all pins were working as digital. Pin D.5 & D.7 which are the LEDs on microcontroller can be used as analog output. Can I use other pins as analog ?

Re: Analog Output

Posted: 26 June 2013, 7:51 AM
by dkinzer
geocool wrote:Can I use other pins as analog ?
The "analog output" function is nothing more than PWM. PWM is only supported on certain pins that have an alternate function as timer output compare signals, the number and location of which depend on the particular device being used.

On a mega1284P-based ZX like the ZX-24s, analog output is possible on B.6 and B.7 (Timer3), D.4 and D.5 (Timer1), D.6 and D.7 (Timer2).

Posted: 26 June 2013, 12:24 PM
by geocool
I'm reading the ZX24 HW Reference and I figured out that there is not any association with B.6 & B.7 Ports on any of 24 pins, is that right ?.Also Port D.4 is only available by soldering ? D.6 is the pin 7 on my basic stamp board and it's working as analog fine like D.5 & D.7 where the LEDs are.

Posted: 26 June 2013, 13:02 PM
by dkinzer
geocool wrote:[T]here is not any association with B.6 & B.7 Ports on any of 24 pins, is that right ?.
B.6 and B.7 are the MISO and SCK pins, respectively. They are available on the row of holes along the pin 1/24 end of the ZX-24 board. Take a look at the schematic.

You've identified a shortcoming of using the 24-pin format, i.e., not all pins are conveniently accessible. Although it's a little more work to set up initially, the 40-pin DIP devices provide convenient access to all 32 I/O pins.

Posted: 26 June 2013, 13:23 PM
by geocool
ok I understand now, thanks for the help :)

Posted: 27 June 2013, 7:45 AM
by dkinzer
geocool wrote:Also Port D.4 is only available by soldering ?
Rather than soldering directly to the board, you might consider soldering on a set of square pins. Then, you can make the connections you need via the square pins.