Please help me with that blue screen

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys I just connected my laptop to AVR using TTL , and burned that code on the avr and used putty to send from avr to the pc 
after connecting the ttl to the laptop that bluescreen appeared !!!
 

#include "STD_TYPES_H.h"

#include <avr\io.h>

#include <avr\interrupt.h>

#include <avr\delay.h>

 

#undef F_CPU

#define F_CPU (u32)8000000

 

#define USART_BAUDRATE 9600

#define BAUD_PRESCALE (u32)((((F_CPU) / (((u32)USART_BAUDRATE) * (u32)16))))

int main(void)

{

     u8 SentByte;

 

     UCSRB = (1 << RXEN) | (1 << TXEN);                  // Turn on the transmission and reception circuitry

     UCSRC = (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit character sizes

 

     UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register

     UBRRL = BAUD_PRESCALE;        // Load lower 8-bits of the baud rate value into the low byte of the UBRR register

 

     while (1) // Loop forever

     {

          while ((UCSRA & (1 << UDRE)) == 0)

               ;              // Do nothing until UDR is ready for more data to be written to it

          UDR = SentByte; // Echo back the received byte back to the computer

     }

}

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have an driver issue on your PC, absolutely nothing related to your avr or code you burned to it.

 

I would start by looking new drivers for your TTL converter as it's propably the cause, also update all the other drivers, since it might be a conflict with other drivers.

 

There seems to be some good advices aswell, after you did what I suggested.

https://www.google.com/amp/s/win...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What do you mean by updating my drivers which drivers?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MuhammedElmaghraby wrote:

What do you mean by updating my drivers which drivers?

Device drivers of your Computer, for example the TTL converter, look up who manufactored it and go to their Homesite, from there you should newest drivers for the device.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys I just connected my laptop to AVR using TTL 

Why aren't you using CMOS---much lower current & voltage compatible? 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Why aren't you using CMOS---much lower current & voltage compatible? 

These days TTL just means logic level (5v or 3.3v, etc) rather then RS232 level, how the part is made (TTL or CMOS) does not matter.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

MuhammedElmaghraby wrote:
UDR = SentByte; // Echo back the received byte back to the computer

This does not do what the comment says!, also SentByte has not been defined, most likely this will send null, so difficult to see on a terminal!

Perhaps set SentByte = 'U';   for a nice 0101010101 pattern to scope.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

These days TTL just means logic level 

I think saying "I'm using TTL"  is different than saying "I'm using TTL logic levels".  Someone might actually want to tell us they are (still) using TTL chips.  I have a whole tray full that I'm going to wire up to make some flip-flops laugh

Also,  why would anyone use TTL levels in the first place with an AVR?...it is more suited to CMOS levels.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
why would anyone use TTL levels

0 - 5v ??? TTL levels

Sorry, I must be missing your point!

 

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Wed. Oct 9, 2019 - 01:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
I think saying "I'm using TTL"  is different than saying "I'm using TTL logic levels"

In theory, yes - if we all made a point of using clear, precise, complete, well-structured English sentences.

 

But a lot of people use sloppy shorthand.

 

Or it could be just that the person is not good at (written) English.

 

In the context of the OP, it certainly looks like "I'm using TTL logic levels" (or, specifically, "I'm using a USB-to-TTL UART converter") was intended

 

.  Someone might actually want to tell us they are (still) using TTL chips

Indeed - perhaps  MuhammedElmaghraby can clarify ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Oct 9, 2019 - 02:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Someone might actually want to tell us they are (still) using TTL chips

Just the other day, I had an engineering friend ask me if I had any 74xx06 (open collector hex inverters), told him I had a few that have been in my bins since '75, they worked just fine in his project!

avrcandies wrote:
I have a whole tray full that I'm going to wire up to make some flip-flops

So there may yet be hope for your stash! smiley

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

See Tip #1 for how to put pictures in you post:

 

Did you go to that web page for more information?

Did you scan the QR code?

 

Note that it tells you "What failed"

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Oct 9, 2019 - 03:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

why would anyone use TTL levels

 

0 - 5v ??? TTL levels

Sorry, I must be missing your point!

You don't want to drive 5V CMOS chips with TTL---the levels don't overlap too well & come close to not working...A 5V TTL chip output might only put out 2.4V, very minimal for a 5V CMOS "hi" level (Vhi min often at 80% of Vcc)...The HCT series CMOS was made to be compatible with TTL.

 

The mega88  @5V requires a min of 0.6Vcc (3.0 Volts) for a "hi" ...you want much more for margin...like 4V or better

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Wed. Oct 9, 2019 - 04:16 PM