Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
larcomj
PostPosted: Mar 17, 2010 - 11:40 PM
Newbie


Joined: Jan 26, 2008
Posts: 5
Location: simi valley

this is my first post to this forum so please excuse me.
well to start i have a ft232r connected to an atmega8. im trying to send data from a windows app that i created and display it on an lcd connected to my atmega8. all i see on the lcd is gibberish and nothing close to what i sent. Im starting out with just a single letter being sent so i can learn the d2xx api. i have attached the windows app that i compiled using visual c++ express and the code for atmega. any help will be much appreciated.thanx
 
 View user's profile Send private message  
Reply with quote Back to top
mhatter
PostPosted: Mar 17, 2010 - 11:59 PM
Wannabe


Joined: Feb 23, 2005
Posts: 84
Location: Salt Lake City, Utah

Do you need to call FT_SetBaudRate or FT_W32_SetCommState before trying to do any transfers?

_________________
I have too many hobbies.
TruGolf.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larcomj
PostPosted: Mar 18, 2010 - 12:45 AM
Newbie


Joined: Jan 26, 2008
Posts: 5
Location: simi valley

in the ftdi documentation i didnt see any default settings so i assumed that it had to be done. also i should mention that im using a 12mhz crystal to clock the avr. the more details the better right.
 
 View user's profile Send private message  
Reply with quote Back to top
larcomj
PostPosted: Mar 18, 2010 - 12:59 AM
Newbie


Joined: Jan 26, 2008
Posts: 5
Location: simi valley

ok so i just ran gtkterm in linux and got gibberish on the lcd also, then i conected txd and rxd on the ft232 and received good data on gtkterm so i know that the 232 is working properly and my fault is on the atmega side. now to find what i did wrong.
 
 View user's profile Send private message  
Reply with quote Back to top
larcomj
PostPosted: Mar 18, 2010 - 07:41 AM
Newbie


Joined: Jan 26, 2008
Posts: 5
Location: simi valley

ok so after pulling out my hair i solved it. i narrowed it down to the uart and found that i was using to low of a baud rate. i upped it from 9600 to 38400 and i can send data from hyperterm to the avr and display it on the lcd.
 
 View user's profile Send private message  
Reply with quote Back to top
mhatter
PostPosted: Mar 18, 2010 - 04:37 PM
Wannabe


Joined: Feb 23, 2005
Posts: 84
Location: Salt Lake City, Utah

larcomj wrote:
in the ftdi documentation i didnt see any default settings so i assumed that it had to be done.


I asked because in your sample code (d2xx_example.cpp) neither of those functions are being called. How do you tell the FT232 what baud rate to use with the uC?

On what end did you change the baud rate (uC, hyperterm) to fix the problem?

_________________
I have too many hobbies.
TruGolf.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larcomj
PostPosted: Mar 19, 2010 - 08:59 AM
Newbie


Joined: Jan 26, 2008
Posts: 5
Location: simi valley

i used
FT_SetBaudRate(devHandle,9600); and
FT_SetDataCharacteristics(devHandle,FT_BITS_8,FT_STOP_BITS_1,FT_PARITY_NONE);
to initialise the ft232. and i changed the baud rate in the firmware for the atmega and the windows app. i also changed it in the hyperterminal to match what the atmega was running to test.everything works ass advertised now. i never would have assumed that the baud rate was to low.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits