Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #492401

Ack!! AT89S8253 (8051 microcontroller problem)

Newsgroups sci.electronics.design
Date 2018-01-24 18:23 -0800
Message-ID <bd4fbaf6-80c7-42e6-84fd-475bf1b2cb33@googlegroups.com> (permalink)
Subject Ack!! AT89S8253 (8051 microcontroller problem)
From mpm <mpmillard@aol.com>

Show all headers | View raw


For the life of me, I don't know what is wrong.
And I'm on a deadline.

I'm trying to bit-bang an 8-CH, 12-bit A/D converter.
It's a Microchip MCP3208, attached to port-1.

Although it is connected to the uPC's SPI port, I'm not using that feature because my development tools don't support it natively, and I don't have time to mess with workarounds.  The SPI's functions are disabled (SRF's), so Port-1 should just behave as normal port.  Right?

Well, I'm getting "4095" returned on every read (i.e., the max value, 2^12) - which is definitely incorrect.  I have fiddled with the ADC timing ad nauseam.

Do I need to put a pull-up on Port-1?
On the scope, it does sort of look like I'm having trouble holding the pin high on Chip Select and MISO and the other two really aren't pretty and sharp either (for no obvious reason)?  I'm clocking at 2x with 11.0592 xtal.

I should note:
My board is laid out EXACTLY the same as my (tried and true!) development board (which does not exhibit this issue), and on which, my code works perfectly, even when swapping physical processor chips.  I did trace an unrelated to issue to my programmer/ISP not tri-stating after a programming session, which is a manageable annoyance.. but only barely.

So, I just have to say...  WTF?

Honestly, after two days (on and off) and a lot of external time pressures for delivery, this is really starting to piss me off.

I must be doing something truly stupid. (Wouldn't be the first time!)
Anybody got any ideas, or ever run into an ADC problem like this before?
It's not like this is cutting-edge hardware.

It's a lot of code, so I really have few options other than to get this piece of it working via bit-bang.  Too much low-level optimized code in other areas to switch to some different development tool with better SPI support (and really, no guarantee that would work anyway, since I don't even know what's wrong.)

The hand-soldering and PCB look good.

Aargh.!!  I guess I'm just venting.
This is not an ADC I'm all that familiar with.

Back to sci.electronics.design | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Ack!!  AT89S8253 (8051 microcontroller problem) mpm <mpmillard@aol.com> - 2018-01-24 18:23 -0800
  Re: Ack!!  AT89S8253 (8051 microcontroller problem) Long Hair <DecadentLinuxUserNumeroUno@decadentlinuxuser.org> - 2018-01-25 02:25 +0000
  Re: Ack!! AT89S8253 (8051 microcontroller problem) Sylvia Else <sylvia@not.at.this.address> - 2018-01-25 13:36 +1100
  Re: Ack!!  AT89S8253 (8051 microcontroller problem) Winfield Hill <hill@rowland.harvard.edu> - 2018-01-24 18:41 -0800
  Re: Ack!! AT89S8253 (8051 microcontroller problem) bitrex <bitrex@de.lete.earthlink.net> - 2018-01-24 22:58 -0500
  Re: Ack!! AT89S8253 (8051 microcontroller problem) TTman <kraken.sankey@gmail.com> - 2018-01-25 11:45 +0000
    Re: Ack!! AT89S8253 (8051 microcontroller problem) bitrex <bitrex@de.lete.earthlink.net> - 2018-01-25 09:17 -0500
      Re: Ack!! AT89S8253 (8051 microcontroller problem) mpm <mpmillard@aol.com> - 2018-01-25 19:26 -0800
        Re: Ack!! AT89S8253 (8051 microcontroller problem) Perry <Perry@null.com> - 2018-01-26 11:39 +0800
          Re: Ack!! AT89S8253 (8051 microcontroller problem) George Herold <gherold@teachspin.com> - 2018-01-26 13:27 -0800
        Re: Ack!! AT89S8253 (8051 microcontroller problem) bitrex <bitrex@de.lete.earthlink.net> - 2018-01-25 22:41 -0500
        Re: Ack!! AT89S8253 (8051 microcontroller problem) jack4747@gmail.com - 2018-02-01 07:32 -0800

csiph-web