Home › ELEKTOR FORUMS › Microcontrollers & Embedded › ATM18 project problems

ELEKTOR FORUMS

Please log in to post a reply or subscribe / unsubscribe to topics

Topic: ATM18 project problems

Author Post

Paul_Gamble

26 posts

Occasional Visitor
Occasional Visitor

Read post 07-02-2009 21:37

Hi guys

I've built the project board, relay board and assembled the LCD display / controller.

I'm having a little problem with wiring because the articles seem to assume the reader knows what is wired where. I'm sure the more knowledgeable guys do, but relative newbies like me will have real problems.

The the LCD display, it is not shown how the driver board is attached to the LCD. I ended up downloading the displaytech 204b pdf from displaytech's website and compared the pinouts with the driver board circuit diagram ... so I believe I have that sorted (and it's the opposite to what I initially believed).

The next problem is with the wiring of the modules together.
The pictures with the articles never clearly show which wires go from which pins / sockets to which pins / sockets. I also don't see an obvious explanation in the text. This all seems a little daft to me.

Can someone please help me with the wiring of the LCD to the project board (May edition), the LCD and relay board to the project board (October edition) ... and well ... I'm doing the RC project and the hot spot project ... so I could do with the same there.

If I'm being daft and this is detailed elsewhere .. please let me know.

Best regards

Paul.

Paul_Gamble

26 posts

Occasional Visitor
Occasional Visitor

Read post 08-02-2009 13:19

Quick update

P1 is very sensitive and the contrast setting seems to differ by project.

The LCD appeared to be dead. I checked the voltage lines when project powered up and they were fine. As a last resort I tweaked P1 and the display came up with the project text.

There are still some oddities.

If you programme with one of the other LCD hex files, the contrast setting to get a display is different.

Also .. when you have got the basic display project running ... if you disconnect the programmer, remove power and then reapply power the text doesn't come back on the display. The only way you can do this is by reconnecting the programmer and re applying the hex.

I thought the whole point of a Microcontroller is that the code was persistent and would simply re-run when power was re applied.

The final odditie is that I seem to need to use external power to get reliable programming. If I set the power to USB on JP1 ... remove the external power and connect the programmer AVR Studio seems be able to check serial number and fuses etc, but if I try and programme it comes up with an error suggesting I'm not using ISP ... which I am. Applying external power and it all works.

Please help.

Paul.

DocJC

1 post

Popping In
Popping In

Read post 11-02-2009 04:38

Hello Paul,

Since I"ve just subscribed I haven't seen the schematic for your project, but reading your post a few thoughts came to mind.

LCDs have significant variability from one display to the next, even of the same model number. Hence the adjustable contrast. It is not unusual to have to adjust each board's LCD contrast.

That said, you should not have to re-adjust the contrast if you are downloading and running a different program in the microcontroller. This suggests that something is not wired properly.

What is the power supply for the project? Is it putting out a stable 5V, (or 3V, or whatever)? Switching power supply or linear? If linear to you have appropriate caps on both the input and output t the regulator?

Is the LCD backlight on? How much current does the backlight draw? Can the power supply handle it? Does the circuit behave better with the backlight off?

Do you have a filter cap across the LCD's power supply pins? As close t the LCD as possible? Say a 10uF and a 0.1uF for starters.

Which micro? What programmer? You are correct in that you should not have to re-load the program after a power cycle. Do you have a reset switch on the reset pin to the micro? After programming the chip, watching it run, and doing a power cycle, have you tried using the reset switch to reset the micro? Have you tried this with the programmer DISconnected from the micro?

Is the micro's programming pins sharing any pins with the LCD?

What test code are you running on the micro and LCD? Does it use a known good library for the LCD or are you using your own driver?

Sorry I can't give you more specific help, but I don't have access to the project you are working on.

JC

Burkhard Kainka

696 posts

Power User
Power User

Read post 11-02-2009 10:41

This photo might help:

Paul_Gamble

26 posts

Occasional Visitor
Occasional Visitor

Read post 16-02-2009 17:55

Hi guys

thanks for your replies.

Mine is wired exactly as the photo you provided ... comforting.

As I say ... it all works, it is just odd that if you remove the programmer and power and then reapply power ... it won't restart unless you programme again.

Has anyone done any of the other projects (relay expander etc) ? I'd really like a picture of those to check wiring. It's particularly confusing where there appear to be multiple wires going into to each +/-ve sil socket.

I've just got the 'radio' one ... really ugly the way it is hard wired to the microcontroller board ... must be a better more reusable way of doing that ...

Paul.

Mactitan

32 posts

Occasional Visitor
Occasional Visitor

Read post 10-05-2010 03:06

Hello all, I have the "Light as Air" project up and running, however of late I seem to be having a problem with the PWM output from port D6. I would like to make a change to the C code or Assembler code to enable D7 as the PWM output. I would appreaciate if someone could point advise me which lines need to be changed.

;//-----------------------------------------------------------------------------
;
;U08 pwm_value;
;//-----------------------------------------------------------------------------
;
;void pwm_init(void)
; 0005 0010 {

.CSEG
_pwm_init:
; 0005 0011 #ifndef USE_TIMER0
; 0005 0012 #error *** Module "TIMER0" not enabled!
; 0005 0013 #endif
; 0005 0014
; 0005 0015 pwm_value = 0; // Reset PWM value
LDI R30,LOW(0)
STS _pwm_value,R30
; 0005 0016
; 0005 0017 // Timer0 OC0A (PD6) is PWM output
; 0005 0018 TCCR0B = 0x00; // Stop timer0
OUT 0x25,R30
; 0005 0019 TCNT0 = 0x01; // Set timer0 to start value
LDI R30,LOW(1)
OUT 0x26,R30
; 0005 001A
; 0005 001B OCR0A = 0; // Turn off PWM-A
LDI R30,LOW(0)
OUT 0x27,R30
; 0005 001C
; 0005 001D TCCR0A = COM0A1 | WGM01 | WGM00; // Setup for positive PWM signals
LDI R30,LOW(131)
OUT 0x24,R30
; 0005 001E TCCR0B = CS00; // Clock select = 1 (F_CPU)
LDI R30,LOW(1)
OUT 0x25,R30
; 0005 001F
; 0005 0020 PWM_OUTPUT_INIT(); // Set PWM output
SBI 0xA,6
; 0005 0021 }
RET

Please log in to post a reply or subscribe / unsubscribe to topics

Subscribe now

Subscribe to our free
E-weekly Newsletter!

Enter your Email address:

Follow Elektor

      

Act now!

Sponsored

FAQ

Before submitting questions, review our FAQ section!

Bestseller

Controller Area Network Projects

The aim of this book is to teach you the basic principles of CAN networks and in addition the development of microcontroller based projects using the CAN bus.

Package Deals

Elektor Bundles

Check our Package Deals and save money! Discounts up to 19% now available!

Price Slashed

Elektor OSPV

This Open Source People Vehicle is perfect for factory halls, warehouses, hospitals, colleges, schools etc.