----- Original Message ----- From: "Robert Bergfors" <[EMAIL PROTECTED]> Sent: Monday, July 23, 2007 4:14 PM Subject: [Sdcc-user] Passing data with function calls
> 1. Whenever power is applied, the device seems to start up in a random > state and doesn't seem to start running the program. Programming the > device seems so make the device do *something*, but that seems quite > random as well, at different times, flashing the device with the exacttly > same hef file seems to do different things each time. > I program the device while it is in the circuit, the ICSP lines are > dedicated to programming, and a standard ASCII LCD is attatched in 4-bit > mode. Take a closer look at your LCDputc() routine. You appear to raise LCD Enable -before- you put the data on the lines. You want to put the data on the lines, raise LCD Enable, wait 450ns, then drop LCD Enable. Then move on to the next nybble. If you raise LCD Enable before putting the data on the lines the result will be more or less random. Also, I'm not sure what delay1ktcy() exactly results in, but you need a substantial wait after sending the byte. I don't recall exactly what it needs to be but it seems like it is on the order of 2ms ... in any case way more than the 450ns needed to strobe the data into the LCD. --McD ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
