Ttelmah
Joined: 11 Mar 2010 Posts: 19245
|
|
Posted: Tue Nov 26, 2019 9:14 am |
|
|
First, you are confusing things by trying to use the 6800 nomenclature for
the pins. The code is written to use the Z80 nomenclature, and assumes
that pins CNF2 & 3 are wired to 0v. Do this and use the Z80
nomenclature. You need AB0 defined and connected. CNF4 needs to
be wired to '1' to setup for indirect I/O.
Look at the table at the bottom of page 10 of the data sheet. This with
CNF4=1, is what the code is written to use. With AB0, RD and WR pins
(and CS).
Then you have ignored my comment about needing to explicitly use
unsigned int8. Every variable and function call, needs to have everything
referring to 'int8' changed to use 'uint8_t' (with stdint.h loaded). reason is
than on the DSPIC's the default variable type is 'signed'. The code needs
everything as 'unsigned'.
Also you are operating the reset line in software. Data sheet says you must
wait at least 3mSec after this line is de-asserted. You need to raise this
and ideally pause for perhaps 5mSec before continuing the initialisation. |
|