We spent 3 weeks in Spain last July. Started Barcelona, toured 3 days, then flew to Seville, toured Seville 2 days, rented car. Drove to Tarifa, ferry to Tangier for the day, drove to Gibraltar, Granada, Toledo, dropped off car, two or three days each place. Then train Toledo-Madrid, where we stayed 5 days, with two days spent on train side trips to Segovia and El Escorial.
Would not agree with the advice to skip Madrid. The art museums and the Royal Palace are not to be missed. Barcelona is on par with Madrid as a destination, but just as big a city, dirty, dangerous, etc.
I would be glad to answer any questions.