Motherboard Forums

Thread Tools Display Modes

HC16z1 problem
Posts: n/a
      02-12-2007, 08:57 PM

I have a freedom 16 mite v2 Hc16 controller working with a
development board. I write to a memory addressed by CS2 and the chip
select pin does not go low and as a result i am not getting an output
on my data pins D[15,8].

The codes i wrote are

/*Function name: setpolc*/

void setpolc(int cell,int value)
poke(DACBASE, cell,value); //writing voltage to DAC
delay(400); //allow the cell to settle to the new value

/* Function name: ioboard_init
Purpose: Initialize custom I/O board


void ioboard_init(void)

unsigned int reg=0; // Local variables

poke(REG_PG, PEPAR, 0); // All port E pins belong
to E port (no bus ctl)
poke(REG_PG, DDRE, 0); // All port E pins are

reg=peekw(REG_PG, CSPAR0); // Get current value of
CSPAR0 register
reg=reg & 0xFC3F; // Clear bits 6-9 (function
of CS2 and CS3 pins)
reg=reg | 0x0280; // Set CS2 and CS3 as 8-bit
chip selects
pokew(REG_PG, CSPAR0, reg); // Write new value to

pokew(REG_PG, CSBAR2, 0x0400); // CS2 will access 2 KB of
memory at $4:0000
pokew(REG_PG, CSBAR3, 0x0500); // CS3 will access 2 KB of
memory at $5:0000
pokew(REG_PG, CSOR2, 0x5070); // CS2 & CS3 memory
pokew(REG_PG, CSOR3, 0x5070); // (see interface


I dont see the chip selects going low. And the blink all.c demo
program has no effect on cs2 pin

Help in this matter will be very much appreciated

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT. The time now is 10:07 PM.

Welcome to Motherboard Point