Author Topic: Pullup no works  (Read 2704 times)

0 Members and 1 Guest are viewing this topic.

ldalep

Pullup no works
« on: November 09, 2011, 09:44:31 PM »
 ???
I have an ardruno sketch that when I compiled it in wiring I noticed that the pullups no longer worked.  I have tried in vain going from

digitalwrite(XXX, HIGH)
to
pullup(XXX)

no worky ATML328P 16mhz

bhagman

Re: Pullup no works
« Reply #1 on: November 10, 2011, 11:51:31 AM »
can you post your sketch, explain a bit about what you want it to do?

Also, which board are you using?

ldalep

Re: Pullup no works
« Reply #2 on: November 10, 2011, 12:18:36 PM »
Thanks for the quick responce

I have a key pad and some buttons in the sketch that worked fine in ardrunio land.  I used the writedigital to use the internal pull up resistors.  Now some of the pins (A3) for one and some of the keypad pins no longer work   

I am using the Adrurino Pro (5V 16Mhz) w/atml328

As an aside I can get the keyboard to work fine in wiring when I use just the Keyboard example sketch

Code: [Select]
#include <Keypad.h>
#include <EEPROM.h>
//#include <MsTimer2.h>
#include <TimedAction.h>



const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns

String Inputstring="";
String Cmdstring="";
boolean Master = false;
boolean Sechalf= false;
unsigned long inval=0;
int Rtime=0;

int rel1count=0;
int TOGGLEcount=0;

int Codelen=0;
int keycounter =0;
boolean keyboardlk=false;

boolean pb=false;
boolean rel1=false;
boolean TOGGLE=false;
boolean valpart=false;
int memslot=0;

const int FADEAMOUNT=10;
const int PUSHBUTTON=12;
const int RESET =A3;
const int GREENLED =9;
const int REDLED = A0;
const int YELLOWLED =10;
const int REL1=A1;

const int STARTMEMREL1 = 0;
const int ENDMEMREL1 = 297;
const int MEMTOGGLE = 300;
const int R1ENTRY=20;
const int CODLEN=4;

const int MEMREL1TIME= 305;
const int MEMREL2TIME= 307;
const int MEMBOOT=511;
const int DEFR1SEC=5;


const int MEMMASTER = 310;
const unsigned long DEFMASTER=1234;
const unsigned long MAXINT=1048575;

char keys[ROWS][COLS] = {
  {
    '1','2','3'                  }
  ,
  {
    '4','5','6'                  }
  ,
  {
    '7','8','9'                  }
  ,
  {
    '*','0','#'                  }
};
byte rowPins[ROWS] = {
  2, 4, 5, 7}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
  8, 6 , 3}; //connect to the column pinouts of the keypad
int brightness = 125;    // how bright the LED is
int fadeAmount = 0;    // how many points to fade the LED by
//int incomingByte = 0; // for incoming serial data

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
TimedAction timedout = TimedAction(60000,abort);
TimedAction clocktime = TimedAction(500,Timeclear);

void setup(){
  Serial.begin(9600);

  Codelen=CODLEN;
  //MsTimer2::set(60000, abort); // 500ms period
  //MsTimer2::stop();
  timedout.disable();
  clocktime.disable();
  pinMode(GREENLED, OUTPUT);
  pinMode(REDLED,OUTPUT);
  pinMode(YELLOWLED,OUTPUT);
  pinMode(REL1,OUTPUT);



  pinMode(RESET,INPUT);
  digitalWrite(RESET,HIGH);
  //pullup(RESET);

  pinMode(PUSHBUTTON,INPUT);
  digitalWrite(PUSHBUTTON,HIGH);
  //pullup(PUSHBUTTON);

« Last Edit: November 14, 2011, 01:29:38 PM by bhagman »

ldalep

Re: Pullup no works
« Reply #3 on: November 14, 2011, 12:52:01 PM »
Any word on this issue.... do you need more info

bhagman

Re: Pullup no works
« Reply #4 on: November 14, 2011, 01:38:22 PM »
Just after a quick look, I think the problem is that you're using the "A3" constant - which will result in an entirely different result than what Arduino has done with those constants.

Here is what you should change:

Code: [Select]
const int FADEAMOUNT = 10;
const int PUSHBUTTON = 12;
const int RESET = 27;   // A3;
const int GREENLED = 9;
const int REDLED = 24; // A0;
const int YELLOWLED = 10;
const int REL1 = 25; // A1;

Try that.

ldalep

Re: Pullup no works
« Reply #5 on: November 15, 2011, 08:26:51 AM »
 :)

Thanks that worked only  off by 10.

const int FADEAMOUNT = 10;
const int PUSHBUTTON = 12;
const int RESET = 17;   // A3;
const int GREENLED = 9;
const int REDLED =14; // A0;
const int YELLOWLED = 10;
const int REL1 = 15; // A1;

bhagman

Re: Pullup no works
« Reply #6 on: November 15, 2011, 04:59:59 PM »
Whoops... sorry I was referring to the Wiring S board :)