Here is a simple program, I just want to count on PORTD.
- Windows 1.8.2, Teeny 1.37
- the attached image shows D0..D7, 2,14,7,8,6,x,x,5, (Note: D5&6 are NOT connected)
Problems:
- bits are shuffled
- D1 & D3 aren't being driven
- those w/ keen eyes will notice the period is also wrong ...
I've tried this on a 3.2 and 3.6 with the same result.
Thank you
Dave
// --- --- ---
const uint8_t LED_PIN = 13;
// we are using all PORTD pins, direct access
elapsedMicros usec = 0;
uint8_t tblNdx;
void setup()
{
pinMode(LED_PIN, OUTPUT);
DDRD = 0xFF;
PORTD = 0x00;
tblNdx = 0;
}
void loop()
{
digitalWrite(LED_PIN, digitalRead(LED_PIN) ^ 0x01);
//
PORTD = tblNdx++;
while (usec < 500) ; // wait
usec = usec - 500;
}
- Windows 1.8.2, Teeny 1.37
- the attached image shows D0..D7, 2,14,7,8,6,x,x,5, (Note: D5&6 are NOT connected)
Problems:
- bits are shuffled
- D1 & D3 aren't being driven
- those w/ keen eyes will notice the period is also wrong ...
I've tried this on a 3.2 and 3.6 with the same result.
Thank you
Dave
// --- --- ---
const uint8_t LED_PIN = 13;
// we are using all PORTD pins, direct access
elapsedMicros usec = 0;
uint8_t tblNdx;
void setup()
{
pinMode(LED_PIN, OUTPUT);
DDRD = 0xFF;
PORTD = 0x00;
tblNdx = 0;
}
void loop()
{
digitalWrite(LED_PIN, digitalRead(LED_PIN) ^ 0x01);
//
PORTD = tblNdx++;
while (usec < 500) ; // wait
usec = usec - 500;
}