<PAGE>   1
                                                                   EXHIBIT 10.12

                              SECOND AMENDMENT TO
                          CREDIT AGREEMENT AND WAIVER

        THIS SECOND AMENDMENT TO CREDIT AGREEMENT AND WAIVER (this "Amendment
and Waiver"), dated as of November 28, 1997, is entered into by and among
PENFORD CORPORATION, formerly known as Penwest, Ltd. ("Penwest"), PENFORD
PRODUCTS CO. ("Penford") and PENWEST PHARMACEUTICALS CO., formerly known as
Edward Mendell Co., Inc. ("Penwest Pharmaceuticals") (each a "Borrower" and
together the "Borrowers"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS
ASSOCIATION, as agent for itself and the Banks (in such capacity, the "Agent"),
and the several financial institutions party to the Credit Agreement
(collectively, the "Banks").

                                    RECITALS

        A.      The Borrowers, the Banks, and the Agent are parties to a Credit
Agreement dated as of December 22, 1995, as amended by a First Amendment to
Credit Agreement dated as of May 7, 1997 (as so amended, the "Credit
Agreement"), pursuant to which the Agent and the Banks have extended a
revolving credit facility to the Borrowers.

        B.      The Borrowers have requested that the Banks amend and/or waive
certain provisions of the Credit Agreement in order to permit Penwest to
spin-off to the public its pharmaceuticals business, which is presently carried
on principally in Penwest Pharmaceuticals.

        C.      The Banks are willing to so amend and/or waive certain
provisions of the Credit Agreement, subject to the terms and conditions of this
Amendment and Waiver.

        NOW, THEREFORE, for valuable consideration, the receipt and adequacy of
which are hereby acknowledged, the parties hereto hereby agree as follows:

        1.      Defined Terms. Unless otherwise defined herein, capitalized
terms used herein shall have the meanings, if any, assigned to them in the
Credit Agreement.

        2.      Amendments to Credit Agreement.

                (a)     The Preamble to the Credit Agreement is hereby amended
to reflect the change in name of Penwest, Ltd. to "Penford Corporation" and
Edward Mendell Co., Inc. to "Penwest Pharmaceuticals Co."

                (b)     The Preamble to the Credit Agreement shall be amended
by deleting therefrom each reference to Penwest Pharmaceuticals, and, subject
to the terms and conditions hereof, from and after the Effective Date, Penwest
Pharmaceuticals shall cease to be a "Company" and shall cease to be included in
the definition of the "Companies" under and for purposes of the Credit
Agreement and other Loan Documents.

                (c)     Section 1.01 of the Credit Agreement shall be amended
as follows:

                                       1
<PAGE>   2
                (i)     The definition of "Arranger" shall be amended and
restated as follows:

                ""Arranger" means BancAmerica Robertson Stephens."

                (ii)    The definition of "EBITDA" shall be amended and
restated as follows:

                ""EBITDA" of a Person means such Person's earnings before
        interest expense, taxes, depreciation, results of discontinued 
        operations and amortization, computed on a consolidated basis and
        measured on a four-quarter trailing basis."

                (iii)   The definition of "Restricted Subsidiary" shall be
amended by inserting immediately before the period at the end of such
definition the following:

        ", and in any event shall include Penwest Pharmaceuticals at all times
        prior to the Spin-Off Date"

                (iv)    The definition of "Subsidiary" shall be amended by
adding the following new sentence at the end of such definition:

        "Notwithstanding the foregoing, Penwest Pharmaceuticals shall not be
        considered a Subsidiary of Penwest for all purposes of this Agreement
        other than for purposes of determining Penwest's compliance with 
        Sections 6.10, 7.11, 7.12 and 7.13 hereof; provided, however, that if
        on December 31, 1998, the Spin-Off Date has not occurred, then this
        sentence shall be of no further force or effect."

                (v)     the following new definitions shall be inserted therein
in proper alphabetical order as follows:

                        ""Penwest Pharmaceuticals" means Penwest
        Pharmaceuticals Co. (formerly known as Edward Mendell Co., Inc.) and 
        any successor thereto."

                        ""IPO" means the sale of shares of the common stock of
        Penwest Pharmaceuticals to the public pursuant to an initial public 
        offering of such shares."

                        ""Pharmaceuticals Business" means the business of, and 
        assets used in connection with, the manufacture and supply of 
        pharmaceutical excipients and the development of controlled release
        technology for pharmaceuticals and shall include, but is not limited
        to, the business and assets of the Mendell and TIMERx Technologies 
        divisions of Penwest Pharmaceuticals."


                                       2

        

<PAGE>   3
                        ""Spin-Off" means the distribution to the holders of the
        common stock of Penwest of the shares of common stock of Penwest
        Pharmaceuticals then held by Penwest."

                        ""Spin-Off Date" means the date on which the Spin-Off
        occurs."

        (d)     Schedule 5.16 to the Credit Agreement shall be amended and
restated in the form of Attachment A hereto.

        (e)     Section 6.14 of the Credit Agreement shall be amended and
restated as follows:

                "6.14.  Maintain Ownership and Control.  Preferred Products Co.
        shall at all times remain a Wholly-Owned Subsidiary of Penwest."

        (f)     Section 7.01(a) of the Credit Agreement shall be amended by
redesignating clause (iv) thereof as clause (v), re-designating clause (iii)
thereof as clause (iv), and re-designating clause (ii) thereof as clause (iii),
and by inserting a new clause (ii) therein as follows:

                "(ii)  sales, transfers or other dispositions of assets
        constituting the Pharmaceuticals Business (A) by Penwest to Penwest
        Pharmaceuticals, (B) as a result of the sale of shares of common stock
        of Penwest Pharmaceuticals to the public pursuant to the IPO, or (C) as
        a result of the Spin-Off, provided that the reduction in the net book
        value of Penwest associated with the IPO and the Spin-Off shall not
        exceed $45,000,000,"

        (g)     Section 7.02 of the Credit Agreement shall be amended as
follows:

                (i)  Subsection 7.02(a)(3)(A) shall be amended and restated as
        follows:

                        "(A)  Consolidated Total Debt shall not exceed (i) 62%
        of Total Capitalization during the period from the Spin-Off Date to the
        date which is six months thereafter, (ii) 60% of Total Capitalization
        during the period from the date which is six months after the Spin-Off
        Date to the date which is one year after the Spin-Off Date and (iii) 55%
        of Total Capitalization at any other time."

                (ii)  Subsection 7.02(a)(4) shall be amended and restated as
        follows:

                        "(4)  unsecured Current Debt of Penwest; provided that
        Consolidated Total Debt shall not exceed (i) 62% of Total
        Capitalization during the period from the Spin-Off date to the date
        which is six months thereafter, (ii) 60% of Total Capitalization during
        the period from the date which is six months after the Spin-Off Date to
        the date which is one year after the Spin-Off Date and (iii) 55% of
        Total Capitalization at any other time." 

        (h)     Schedule 7.05 to the Credit Agreement shall be amended and
restated in the form of Attachment B hereto.     




                                       3

<PAGE>   4

          (i)  Section 7.10 of the Credit Agreement shall be amended by
deleting the word "and" at the end of subsection (c) thereof, replacing the
period at the end of subsection (d) thereof with "; and", and adding a new
subsection (e) as follows:

                    "(e) declare and make to the holders of the common stock of
          Penwest a distribution consisting of the shares of common stock of
          Penwest Pharmaceuticals then held by Penwest to effect the Spin-Off."

          (j)  Section 7.11 of the Credit Agreement shall be amended by
deleting the period at the end of such Section and adding a new clause (iv)
thereto as follows:

          ", plus (iv) up to $45,000,000 of charges to net book value recorded
          by Penwest in connection with the IPO and the Spin-Off."

          (k)  Section 7.12 of the Credit Agreement shall be amended and
restated as follows:

               "7.12 Maximum Leverage Ratio. Penwest shall not permit its ratio
     of (i) Consolidated Total Debt to (ii) Total Capitalization to exceed 0.60
     to 1.00 during the period from the Spin-Off Date to the date which is one
     year thereafter and 0.55 to 1.00 at any other time."

          (l)  Section 7.13 of the Credit Agreement shall be amended and
restated as follows:

               "7.13 Minimum Fixed Charge Coverage Ratio. Penwest shall not
     permit at any time its ratio of (i) the sum of EBITDA plus rental expense 
     to (ii) the sum of interest expense plus rental expense, to be less than
     3.00 to 1.00.

     All computations under this Section shall be on a consolidated basis and
     measured on a four quarter trailing basis. Rental expense shall be
     computed in accordance with GAAP as set forth in Section 1.03."

     3.   Defaults and Waiver.

          (a)  Subject to and upon the terms and conditions hereof, the
Majority Banks hereby waive the Event of Default, if any, existing or arising
under Section 8.01(c) of the Credit Agreement solely as a consequence of one or
more of the following:

               (i) a breach of subsection 6.02(d) of the Credit Agreement
     solely as a result of sales, transfers or other dispositions of assets
     constituting the Pharmaceuticals Business by Penwest to Penwest
     Pharmaceuticals;

               (ii) a breach of Section 7.07 of the Credit Agreement solely as
     a result of transactions between Penwest and Penwest Pharmaceuticals in
     respect of: (A) the provision of certain corporate and administrative
     services by Penwest to Penwest Pharmaceuticals after the Spin-Off, (B) the
     provision by Penwest after the Spin-Off of certain materials to Penwest
     Pharmaceuticals necessary for the manufacture of certain 


                                       4
<PAGE>   5
          of Penwest Pharmaceuticals' products, (C) the provision of coverage by
          Penwest for Penwest Pharmaceuticals' employees under certain of
          Penwest's employee benefit plans, or (D) the allocation of certain
          consolidated federal or state income tax liability or credits between
          Penwest and Penwest Pharmaceuticals;

               (iii) a breach of Section 7.10 of the Credit Agreement solely as
     a result of the issuance by Penwest Pharmaceuticals, at the time of the
     IPO, of options to acquire shares of stock of Penwest Pharmaceuticals;

               (iv) a breach of Section 7.16 of the Credit Agreement solely as a
     result of the discontinued operations effected by the IPO and the Spin-Off;
     or

               (v)  a breach of Section 7.17 of the Credit agreement solely as a
     result of the change of Penwest Pharmaceuticals' fiscal year-end from
     August 31 to December 31.

          (b)  Subject to and upon the terms and conditions hereof, the
Majority Banks hereby waive the Event of Default, if any, existing or arising
under Section 8.01(k) of the Credit Agreement solely as a consequence of (i)
the reconstitution of the board of directors of Penwest Pharmaceuticals, (ii)
the sale by Penwest to the public of shares of common stock of Penwest
Pharmaceuticals in connection with the IPO, and (iii) the subsequent
distribution of the balance of such shares to the holders of the common stock
of Penwest in the Spin-Off.

          (c)  Nothing contained herein shall be deemed a waiver (or otherwise
affect the Agent's or the Bank's ability to enforce) any other default or Event
of Default, including without limitation any default or Event of Default as may
now or hereafter exist.

     4.   Assumption of Indebtedness of Penwest Pharmaceuticals; Release of
Penwest Pharmaceuticals. (a) On the Effective Date, Penwest and Penford each
hereby assume, jointly and severally, the indebtedness and other obligations of
Penwest Pharmaceuticals under the Credit Agreement and the other Loan Documents
(such indebtedness and other obligations, the "Penwest Pharmaceuticals
Obligations"). Penwest and Penford each hereby represents and warrants to the
Agent and the Banks that the Penwest Pharmaceuticals Obligations are the legal,
valid and binding obligations of Penwest Pharmaceuticals enforceable against
Penwest Pharmaceuticals in accordance with their respective terms, and that on
and after the Effective Date the Penwest Pharmaceuticals Obligations shall be
the legal, valid and binding obligations of Penwest and Penford enforceable
against Penwest and Penford in accordance with their respective terms, in each
case, without defense, offset or counterclaim.

          (b)  On the Effective Date, the Banks hereby release Penwest
Pharmaceuticals from the Penwest Pharmaceuticals Obligations.

     5.   Representations and Warranties. Penwest and Penford each hereby
represents and warrants to the Agent and the Banks as follows:


                                       5

       
<PAGE>   6
                (a)     Other than the Events of Default which are the subject
of the waivers set forth in Section 3 hereof, no Default or Event of Default has
occurred and is continuing or will result from the execution, delivery and 
performance of this Amendment and Waiver or the transactions contemplated 
herein.

                (b)     The execution, delivery and performance by the 
Borrowers of this Amendment and Waiver have been duly authorized by all
necessary corporate and other action and do not and will not require any
registration with, consent or approval of, notice to or action by, any Person
(including any Governmental Authority) in order to be effective and enforceable.
The Credit Agreement and the other Loan Documents constitute the legal, valid
and binding obligations of Penwest, Penford and Penwest Pharmaceuticals,
enforceable against them in accordance with their respective terms, and on and
after the Effective Date, the Credit Agreement and the other Loan Documents as
amended by this Amendment and Waiver shall be the legal, valid and binding
obligations of Penwest and Penford, enforceable against them in accordance with
their respective terms, in each case, without defense, counterclaim or offset.

                (c)     All representations and warranties of the Borrowers 
contained in the Credit Agreement are true and correct.

                (d)     The Borrowers are entering into this Amendment and 
Waiver on the basis of their own investigation and for their own reasons, 
without reliance upon the Agent and the Banks or any other Person.

        6.      Effective Date.  This Amendment and Waiver will become
effective on the date (the "Effective Date") on which each of the following
conditions precedent is and remains satisfied:

                (a)     The Agent has received from each Borrower and the
Majority Banks a duly executed original (or, if elected by the Agent, an
executed facsimile copy) of this Amendment and Waiver.

                (b)     The Agent has received from each Borrower a copy of a
resolution passed by the board of directors of such corporation, certified by
the Secretary or an Assistant Secretary of such corporation as being in full
force and effect on the Effective Date, authorizing the execution, delivery and
performance of this Amendment and Waiver.

                (c)     All representations and warranties contained herein are
true and correct as of the Effective Date.

                (d)     The Agent has received from the Borrowers for the
ratable benefit of the Banks the amount of $43,750, representing payment in
full of a non-refundable amendment and waiver fee.

                (e)     The Agent shall have received a legal opinion from
Borrowers' counsel in form and substance satisfactory to the Agent and the
Majority Banks and covering such matters as the Agent and the Majority Banks
shall reasonably request.


                                       6



<PAGE>   7
                (f)     The IPO shall have been completed.

        7.      Reservation of Rights. Each Borrower acknowledges and agrees
that neither the Agent's nor the Banks' forbearance in exercising their rights
and remedies in connection with any Default or Event of Default, nor the
execution and delivery by the Agent and the Majority Banks of this Amendment and
Waiver, shall be deemed (i) to create a course of dealing or otherwise obligate
the Agent or the Banks to forbear or execute similar amendments or waivers
under the same or similar circumstances in the future, or (ii) to waive,
relinquish or impair any right of the Agent or the Banks to receive any
indemnity or similar payment from any Person or entity as a result of any
matters arising from or relating to any Default or Event of Default.

        8.      Miscellaneous.

                (a)     Except as herein expressly amended, all terms,
covenants and provisions of the Credit Agreement are and shall remain in full
force and effect and all references therein to such Credit Agreement shall
henceforth refer to the Credit Agreement as amended by this Amendment and
Waiver. This Amendment and Waiver shall be deemed incorporated into, and part
of, the Credit Agreement.

                (b)     This Amendment and Waiver shall be binding upon and
inure to the benefit of the parties hereto and thereto and their respective
successors and assigns. No third party beneficiaries are intended in connection
with this Amendment and Waiver.

                (c)     This Amendment and Waiver shall be governed by and
construed in accordance with the law of the State of California.

                (d)     This Amendment and Waiver may be executed in any number
of counterparts, each of which shall be deemed an original, but all such
counterparts together shall constitute but one and the same instrument. Each of
the parties hereto understands and agrees that this document (and any other
document required herein) may be delivered by any party thereto either in the
form of an executed original or an executed original sent by facsimile
transmission to be followed promptly by mailing of a hard copy original, and
that receipt by the Agent of a facsimile transmitted document purportedly
bearing the signature of a Bank or a Borrower shall bind such Bank or such
Borrower, respectively, with the same force and effect as the delivery of a hard
copy original. Any failure by the Agent to receive the hard copy executed
original of such document shall not diminish the binding effect of receipt of
the facsimile transmitted executed original of such document of the party whose
hard copy page was not received by the Agent.

                (c)     This Amendment and Waiver, together with the Credit
Agreement, contains the entire and exclusive agreement of the parties hereto
with reference to the matters discussed herein and therein. This Amendment and
Waiver supersedes all prior drafts and communications with respect thereto.
This Amendment and Waiver may not be amended except in accordance with the
provisions of Section 10.01 of the Credit Agreement.

                (f)     If any term or provision of this Amendment and Waiver
shall be deemed prohibited by or invalid under any applicable law, such
provision shall be invalidated without

                                       7

<PAGE>   8
affecting the remaining provisions of this Amendment and Waiver or the Credit
Agreement, respectively.

        (g)  The Borrowers covenant to pay to or reimburse the Agent and the
Banks, upon demand, for all costs and expenses (including allocated costs of
in-house counsel) incurred in connection with the development, preparation,
negotiation, execution and delivery of this Amendment and Waiver.




                           [Signature pages follow.]











                                       8

<PAGE>   9
        IN WITNESS WHEREOF, the parties hereto have executed and delivered this
Amendment and Waiver as of the date first above written.


                                        PENFORD CORPORATION


                                        By:    [SIG]
                                            -----------------------------------
                                        Title: 
                                               --------------------------------


                                        PENFORD PRODUCTS CO.


                                        By:    [SIG]
                                            -----------------------------------
                                        Title: 
                                               --------------------------------


                                        PENWEST PHARMACEUTICALS CO.


                                        By:    [SIG]
                                            -----------------------------------
                                        Title: Senior Vice President


                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as Agent


                                        By: ___________________________________
                                        Title: Managing Director

                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as a Bank


                                        By: ___________________________________
                                        Title: ________________________________



                                        ABN-AMRO BANK N.V., Seattle Branch


                                        By: ___________________________________
                                        Title: ________________________________

        
        

                                       9
<PAGE>   10
        IN WITNESS WHEREOF, the parties hereto have executed and delivered this
Amendment and Waiver as of the date first above written.


                                        PENFORD CORPORATION


                                        By: ___________________________________
                                        Title: ________________________________


                                        PENFORD PRODUCTS CO.


                                        By: ___________________________________
                                        Title: ________________________________


                                        PENWEST PHARMACEUTICALS CO.


                                        By: ___________________________________
                                        Title: Senior Vice President


                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as Agent


                                        By:    [SIG]
                                           ------------------------------------
                                        Title: Managing Director

                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as a Bank


                                        By:    [SIG]
                                           ------------------------------------
                                        Title: Managing Director


                                        ABN-AMRO BANK N.V., Seattle Branch


                                        By: ___________________________________
                                        Title: ________________________________

        
        

                                       10
<PAGE>   11
        IN WITNESS WHEREOF, the parties hereto have executed and delivered this
Amendment and Waiver as of the date first above written.


                                        PENFORD CORPORATION


                                        By: ___________________________________
                                        Title: ________________________________


                                        PENFORD PRODUCTS CO.


                                        By: ___________________________________
                                        Title: ________________________________


                                        PENWEST PHARMACEUTICALS CO.


                                        By: ___________________________________
                                        Title: ________________________________


                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as Agent


                                        By: ___________________________________
                                        Title: Managing Director

                                        BANK OF AMERICA NATIONAL TRUST
                                        AND SAVINGS ASSOCIATION, as a Bank


                                        By:    
                                           ------------------------------------
                                        Title: Vice President

                                        ABN-AMRO BANK N.V., Seattle Branch


                                        By:    [SIG]
                                            -----------------------------------
                                        Title: Vice President

        
        

                                       11
<PAGE>   12

                                        THE BANK OF NOVA SCOTIA


                                        By:    [SIG]
                                            -----------------------------------
                                        Title: Officer


                                        SEATTLE-FIRST NATIONAL BANK


                                        By: ___________________________________
                                        Title: ________________________________

        
        

                                       11
<PAGE>   13

                                        THE BANK OF NOVA SCOTIA


                                        By: ___________________________________
                                        Title: ________________________________


                                        SEATTLE-FIRST NATIONAL BANK


                                        By:     [SIG]
                                            -----------------------------------
                                        Title: Senior Vice President


        
        

                                       12
<PAGE>   14
                                  ATTACHMENT A

                                 SCHEDULE 5.16

                                  SUBSIDIARIES


(a)  Penford Products Co.

     Penford Export Corporation


(b)  None

<PAGE>   15


                                  ATTACHMENT B

                                 SCHEDULE 7.05

                                     LIENS

<TABLE>
<CAPTION>
                            UCC           UCC
      Debtor              Location       Filed        File No.           Secured Party           Description of Security Interest
      ------              --------       -----        --------           -------------           --------------------------------
<S>                      <C>            <C>          <C>             <C>                        <C>
Penford Products Co.     IA-SOS         12/4/89     K066087          Norwest Leasing            Panasonic EP-2220 Copier and other
                                                                     (Assignee of Tall Corn     Panasonic Equipment
                                                                     Leasing (Automated
                                                                     Office Systems

Penford Products Co.     Linn Co.-1A    03/04/91    G80486           2 Canon FAX 770's

Penford Products Co.     Linn Co.-1A    04/00/92    G82524           Canon Fax L770 S/N
                                                                     UBJ13975

Penwest Foods Co.        WA-SOS         02/24/94    84-055-0125      Western Paper              One Leneteo "Q" Series Model 400
                                                                     Company                    Semi-Automatic stretch wrapping
                                                                                                system.
                                                                                                Serial No. Q-0898
</TABLE>