I am using this shield for I/O on an arduino UNO (ATMega328p) and a custom arduino (bobuino ATMega1284p).
On UNO it works fine, but on bobuino there is no signal, just a white screen. I thought i'd check the voltages on the uC pins and here is what i found:
bobuino uno
shield no shield shield no shield
rst 4 4.6 4.08 4.7
3.3V 3.3 3.3 3.3 3.3
5V 4.4 4.6 4.5 4.7
I checked both uC pins as well as board pins. As you can see, the board pins 4-9 have different voltages, something i don't understand why is happening.
The LCD uses pins 0-7 as data pins and pin 8 as TF card SS and pin 9 as Touch IRQ. The fact that the data pins have close to 0V explains why the screen is white and does not print anything.
Why two different uCs produce different signals on their pins while having loaded the same program?
fleshmachine:
Why two different uCs produce different signals on their pins while having loaded the same program?
The differences seem pretty small and might be accounted for by differences in the power regulation and any other external components between the microprocessor chip and the external pins. The same sketch on different chips can also produce very different behaviours if you use different Board types since this will determine the relationship between the hardware abstraction that the runtime library presents to the sketch, and the underlying hardware.
CrossRoads:
Post your sketch, may be a functional difference on a couple of the pins too.
Are some of those PWM outputs?
I am using any sketch from the UTFT library with an LCD screen using SSD1289 chip. Instead of getting the resulting messages/screens, i get a white glowing screen, which leads me to think that the data bus* is the one with the problem, meaning pins 4-7, which show the only important voltage differences between the two boards. I checked the voltage output from both the pins and the uC legs. There is no difference between these two, which makes me believe that the difference in uCs is what is causing the problem
*the data bus for the LCD screen are the digital pins 0-7
From looking in the UTFT library a little bit i think i understand that there are different structures for each mC in it. For example, there are differing codes for an ATMega328p and an ATMega1280. Isn't the ATMega1284 supposed to be "similar" to the ATMega1280? Am i supposed to "tweak" the library in order to make it think it works with an ATMega1280?
I checked the outputs again. From looking at the voltages that differ you get this info:
bobuino pin 8 is PD5 which is why it's equal to UNO pin 5 (PD5)
bobuino pin 9 is PD6 which is why it's equal to UNO pin 6 (PD6)
in general, ATMega1284 pins 18-21 are PD4-7 and are equal to UNO pins 4-7
While the same principle works on pins 4 and 5 on bobuino (PB0 and PB1), it does not work with the SPI pins, which already have similar outputs on both boards, even though they are different uC pins (bobuino uses PB4-7 while UNO uses PB2-5)
OK! Final update. As Henning Karlsen said on this ATMega1280 tutorial, you must find which output works for each microcontroller, in his example, ATMega1280 uses ports this way:
Digital Pin 0 = PE0 (Port E - bit 0)
Digital Pin 1 = PE1 (Port E - bit 1)
Digital Pin 2 = PE4 (Port E - bit 4)
Digital Pin 3 = PE5 (Port E - bit 5)
Digital Pin 4 = PG5 (Port G - bit 5)
Digital Pin 5 = PE3 (Port E - bit 3)
Digital Pin 6 = PH3 (Port H - bit 3)
Digital Pin 7 = PH4 (Port H - bit 4)
While Bobuino uses ports this way:
Digital Pin 0 = PD0 (Port D - bit 0)
Digital Pin 1 = PD1 (Port D - bit 1)
Digital Pin 2 = PD2 (Port D - bit 2)
Digital Pin 3 = PD3 (Port D - bit 3)
Digital Pin 4 = PB0 (Port B - bit 0)
Digital Pin 5 = PB1 (Port B - bit 1)
Digital Pin 6 = PB2 (Port B - bit 2)
Digital Pin 7 = PB3 (Port B - bit 3)
So i had to go to libaries/UTFT/HW_AVR.h and insert some code in there
Specifically:
in
void UTFT::LCD_Writ_Bus(char VH,char VL, byte mode)
i added after #if defined(AVR_ATmega1280) || defined(AVR_ATmega2560)
ends and before #else
this code:
What these two codes do is this:
The second one defines Port B pins 0~3 and Port D pins 0~3 as output
The first one takes the VH and VL bytes and puts them in these pins.
Hope this helps anyone who uses bobuino with the UTFT code