Overclock.net › Forums › Case Mods & Cases › Other Hardware Mods › Custom case Fan/RGB LED Controller with WC Loop and temp monitor. 7" Touchscreen 4x5.25" bay device
New Posts  All Forums:Forum Nav:

Custom case Fan/RGB LED Controller with WC Loop and temp monitor. 7" Touchscreen 4x5.25" bay device - Page 7

post #61 of 81
Thread Starter 
Quote:
Originally Posted by jvjessen View Post

I think these are likely clear and set on port D, but I'm only guessing. You'll have to look up the definition of REG_PIOD_CODR and REG_PIOD_SODR in the standard headers for the Due to find their actual definition, or some documentation.

The DB pins are set in HW_SAM.h:
Code:
// *** Hardwarespecific functions ***
void UTFT::LCD_Writ_Bus(char VH,char VL, byte mode)
{   
        switch (mode)
        {
        case 1:
....
        case 8:
....
        case 16:
                REG_PIOC_CODR=0xFF1FE;
                REG_PIOC_SODR=(VL<<1) & 0x1FE;
                REG_PIOC_SODR=(VH<<12) & 0xFF000;
                pulse_WR(); //Serial1.write(55);
                break;
        }
}


Again you will have to find out what exactly REG_PIOC_CODR and REG_PIOC_SODR does, it's probably port C.

Looking at the datasheet for the microcontroller, CODR and SODR are "Clear Output Data Register" and Set Output Data Register" respectively, The datasheet says that the level written on an I/O line is determined by writing to SODR.
I couldnt find anything about VL and VH but I would suspect they are Voltage Low and Voltage High.

Im now kicking myself, Looking at HW_SAM.h I can see the ports are clarified in the comments and I missed that.
I can now say that the DB pins are set wrong in the code when look at the schematic for the shield, Or maybe its the other way around. I cant say for sure because I can only see references to DB8-15 and not DB0-8
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #62 of 81
Unfortunately it's not quite that simple. The config for your display says the transfer mode is 16 bits, so you can only look at the part under:
Code:
case 16:
        REG_PIOC_CODR=0xFF1FE;
        REG_PIOC_SODR=(VL<<1) & 0x1FE;
        REG_PIOC_SODR=(VH<<12) & 0xFF000;
...

So if you look at the numbers 0xff1fe in binary it's:

11111111000111111110

And the data, VL and VH are the 16 bits of data split into a high and a low byte.

So the VL gets shifted 1 bit to the left before getting written and VH is 12 bits to the left. That means you can see the 16 bit DB data is being written to:

DB15 = Port C bit 19
...
DB8 = Port C bit 12

and

DB7 = Port C bit 8
..
DB0 = Port C Bit 1


Then you should be able to look at some pin mappings http://arduino.cc/en/Hacking/PinMappingSAM3X and find the Due pin numbers.

So e.g. DB0 is Due pin 33
post #63 of 81
Thread Starter 
Quote:
Originally Posted by jvjessen View Post

Unfortunately it's not quite that simple. The config for your display says the transfer mode is 16 bits, so you can only look at the part under:
Code:
case 16:
        REG_PIOC_CODR=0xFF1FE;
        REG_PIOC_SODR=(VL<<1) & 0x1FE;
        REG_PIOC_SODR=(VH<<12) & 0xFF000;
...

So if you look at the numbers 0xff1fe in binary it's:

11111111000111111110

And the data, VL and VH are the 16 bits of data split into a high and a low byte.

So the VL gets shifted 1 bit to the left before getting written and VH is 12 bits to the left. That means you can see the 16 bit DB data is being written to:

DB15 = Port C bit 19
...
DB8 = Port C bit 12

and

DB7 = Port C bit 8
..
DB0 = Port C Bit 1


Then you should be able to look at some pin mappings http://arduino.cc/en/Hacking/PinMappingSAM3X and find the Due pin numbers.

So e.g. DB0 is Due pin 33

Oh wow, Thank you very much. I think i'm actually starting to get it now.

So im looking at:
DB0 = 33
DB1 = 34
..
DB7 = 40
DB8 = 51
DB9 = 50
..
DB15 = 44

That means the pinout on the shield is correct with the coding, That means my problem is elsewhere.
So far I have eliminated the pins, the coding(To a degree). All that leaves now is the LCD which is apparently tested before shipping and the actual LCD driver code, That is most likely way out of my depth even with some guidance so I wont bother checking that out. Another issue that could be the cause is a short because as you pointed out the microcontroller heating up generally means a short somewhere.
Testing that, Would a good approach be to add voltage to each pin independently to see which pin actually heats up the MC?
Would that run the risk of damaging the MC?
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #64 of 81
Quote:
Originally Posted by trust-no-1 View Post

Oh wow, Thank you very much. I think i'm actually starting to get it now.

So im looking at:
DB0 = 33
DB1 = 34
..
DB7 = 40
DB8 = 51
DB9 = 50
..
DB15 = 44

That means the pinout on the shield is correct with the coding, That means my problem is elsewhere.
So far I have eliminated the pins, the coding(To a degree). All that leaves now is the LCD which is apparently tested before shipping and the actual LCD driver code, That is most likely way out of my depth even with some guidance so I wont bother checking that out. Another issue that could be the cause is a short because as you pointed out the microcontroller heating up generally means a short somewhere.
Testing that, Would a good approach be to add voltage to each pin independently to see which pin actually heats up the MC?
Would that run the risk of damaging the MC?

That's great smile.gif .. even they are correct, it's always nice to know how the code works.

Still you should also check the other pins for the LCD control.

From what I can see in the code:
Code:
#define pulse_WR()   REG_PIOD_CODR=0x2;      REG_PIOD_SODR=0x2;
#define cbi_RS() REG_PIOD_CODR=0x1;
#define sbi_RS() REG_PIOD_SODR=0x1;
#define cbi_CS() REG_PIOD_CODR=0x4;
#define sbi_CS() REG_PIOD_SODR=0x4;
#define cbi_RST() REG_PIOD_CODR=0x8;
#define sbi_RST() REG_PIOD_SODR=0x8;

They should be:

LCD_RS = Port D bit 0
LCD_WR = Port D bit 1
LCD_CS = Port D bit 2
LCD_RST = Port D bit 3

So looking up in the mapping that should be:

LCD_RS = Due pin 25
etc.
...

One thing I noticed, and that could be the reason you can't get it to work, is that the LCD_RD isn't used in code, but it's pulled high in the schematic. So you should use a 10K resistor between LCD_RD on the display and 3.3V.

This could be the reason you experienced the micro controller heating up, as it would likely leave the display in read mode instead of write mode.

I don't think I've ever managed to actually destroy a micro controller biggrin.gif, but I'm usually careful and switch the power off immediately if it heats up quickly.
post #65 of 81
Thread Starter 
Quote:
Originally Posted by jvjessen View Post

That's great smile.gif .. even they are correct, it's always nice to know how the code works.

Still you should also check the other pins for the LCD control.

From what I can see in the code:
Code:
#define pulse_WR()   REG_PIOD_CODR=0x2;      REG_PIOD_SODR=0x2;
#define cbi_RS() REG_PIOD_CODR=0x1;
#define sbi_RS() REG_PIOD_SODR=0x1;
#define cbi_CS() REG_PIOD_CODR=0x4;
#define sbi_CS() REG_PIOD_SODR=0x4;
#define cbi_RST() REG_PIOD_CODR=0x8;
#define sbi_RST() REG_PIOD_SODR=0x8;

They should be:

LCD_RS = Port D bit 0
LCD_WR = Port D bit 1
LCD_CS = Port D bit 2
LCD_RST = Port D bit 3

So looking up in the mapping that should be:

LCD_RS = Due pin 25
etc.
...

One thing I noticed, and that could be the reason you can't get it to work, is that the LCD_RD isn't used in code, but it's pulled high in the schematic. So you should use a 10K resistor between LCD_RD on the display and 3.3V.

This could be the reason you experienced the micro controller heating up, as it would likely leave the display in read mode instead of write mode.

I don't think I've ever managed to actually destroy a micro controller biggrin.gif, but I'm usually careful and switch the power off immediately if it heats up quickly.

I tried adding some 3.3V with the 10K to RD with no dice, The screen didn't turn on and the chip heated a little but not as much as before.
I double checked all my connections and they all seem to be in the right place.
The shield was posted a few days ago so with any luck hopefully I will get it late next week or the week after.

I think I should come over to where you live, "Hire" you and bring you back to Australia and "pay" you to make this work wink.gif Haha
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #66 of 81
Quote:
Originally Posted by trust-no-1 View Post

I tried adding some 3.3V with the 10K to RD with no dice, The screen didn't turn on and the chip heated a little but not as much as before.
I double checked all my connections and they all seem to be in the right place.
The shield was posted a few days ago so with any luck hopefully I will get it late next week or the week after.

I think I should come over to where you live, "Hire" you and bring you back to Australia and "pay" you to make this work wink.gif Haha

Well, at least you had a good go at it biggrin.gif .. hope everything works flawlessly when you get the shield.

Nah, I'm afraid that would cause your project to go slightly over budget smile.gif .. but I'm happy to help if you get stuck.
post #67 of 81
Thread Starter 
Quote:
Originally Posted by jvjessen View Post

Well, at least you had a good go at it biggrin.gif .. hope everything works flawlessly when you get the shield.

Nah, I'm afraid that would cause your project to go slightly over budget smile.gif .. but I'm happy to help if you get stuck.

Haha, As with everything I do, There is no budget, Just depends on what hours I get at work. Stringy people....
If it doesn't work with the shield, I will be mighty annoyed and call foul play with paypal.
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #68 of 81
Thread Starter 
Just got the shield, The resistor values are:
R1:4.7Kohm
R2:4.7kohm
R3:10Kohm

Caps are unmarked, Jumpers have the following config:
LCD VCC:3.3v
LCD LEDA+:3.3v(The seller told me 5v)

I cant get any good pics right now, Ill try again later.
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #69 of 81
Thread Starter 
*

It has life! Sweet sweet life! thumb.gif
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
Big Black Guy
(15 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-4100 ASUS Crosshair V Formula-Z Sapphire Raedon HD 6670 G.Skil Ripjaws-X 
Hard DriveHard DriveHard DriveHard Drive
WD Black WD Blue  Seagate 7200RPM Kingston HyperX 3k 
Optical DriveCoolingOSMonitor
LG Noctua NH-D14 Windows 7 Ultimate x64 Dell 2408WFP 24" 
MonitorPowerCase
Soniq 32" Antec TruePower 550W NZXT Switch 810 
  hide details  
Reply
post #70 of 81
Quote:
Originally Posted by trust-no-1 View Post

Warning: Spoiler! (Click to show)
*

It has life! Sweet sweet life! thumb.gif

Very nice thumb.gif

Happy to see the earlier experiments didn't break anything smile.gif

I guess it didn't work before because not everything was connected? Any significant difference in the shield you got?
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Other Hardware Mods
Overclock.net › Forums › Case Mods & Cases › Other Hardware Mods › Custom case Fan/RGB LED Controller with WC Loop and temp monitor. 7" Touchscreen 4x5.25" bay device