1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

HC16z1 problem

Discussion in 'Embedded' started by sat_nash@yahoo.com, Feb 12, 2007.

  1. Guest

    Hello,

    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
    inputs

    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
    register

    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
    characteristics
    pokew(REG_PG, CSOR3, 0x5070); // (see interface
    documentation)

    }

    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
     
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernd Bubis
    Replies:
    4
    Views:
    616
    Bernd Bubis
    Sep 11, 2003
  2. Neptune
    Replies:
    0
    Views:
    445
    Neptune
    Aug 22, 2003
  3. klink
    Replies:
    2
    Views:
    460
    Edward Lee Ah Yen
    Aug 23, 2003
  4. eddwnn
    Replies:
    3
    Views:
    567
    Muttley
    Jul 18, 2003
  5. Jay Bittle
    Replies:
    1
    Views:
    880
Loading...

Share This Page