Analog Output

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
Post Reply
geocool
Posts: 15
Joined: 04 May 2011, 9:38 AM

Analog Output

Post 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 ?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Analog Output

Post 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).
- Don Kinzer
geocool
Posts: 15
Joined: 04 May 2011, 9:38 AM

Post 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.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post 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.
- Don Kinzer
geocool
Posts: 15
Joined: 04 May 2011, 9:38 AM

Post by geocool »

ok I understand now, thanks for the help :)
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post 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.
- Don Kinzer
Post Reply