Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: UNI/O EEPROM Driver Post ReplyPost New Topic
<< Prev Page of 5
Author
Message << Prev Topic | Next Topic >>
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 4871
Posted: 09 September 2017 at 11:35am | IP Logged Quote Grogster

I have my 11AA160's, but I can't get them to read.
Using Jim's code:


Test4:
  OPTION EXPLICIT
  OPTION DEFAULT NONE
  DIM C$,NAME$,NAME1$ AS STRING
  DIM STATUS AS INTEGER,LAB AS INTEGER
  LAB=14 'I/0 PIN
  'UNIO ROUTINE IN LIBRARY
MAIN:
  
  GEN_STR(50,NAME$)
  PRINT NAME$
  WR_UNIO(1,50,NAME$)
  GEN_STR(50,NAME$)
  PRINT NAME$
  WR_UNIO(52,50,NAME$)
  PAUSE 10
  GEN_STR(50,NAME$)
  PRINT NAME$
  WR_UNIO(103,50,NAME$)
  PAUSE 10
  PRINT "READ"
  RD_UNIO(1,50,NAME1$)
  PRINT status,NAME1$
  RD_UNIO(52,50,NAME1$)
  PRINT status,NAME1$
  RD_UNIO(103,50,NAME1$)
  PRINT status,NAME1$
END
  DO
  LOOP
  
  '---GENERATING A STRING
SUB GEN_STR (LENH AS INTEGER,NAMES$ AS STRING)
  LOCAL INTEGER I
  NAMES$=""
  FOR I=1 TO LENH
    NAMES$=NAMES$+CHR$(I+32)
  NEXT I
END SUB
  '
'LAB: THE PIN, GLOBAL VARIABLE, STATUS GLOBAL
  '---READING A STRING FROM UNIO: BADDR-BEGINADDR, LENH-GIVEN LENGHT, NAMES$-THE STRING
SUB RD_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES$ AS STRING)
  LOCAL n AS INTEGER
  FOR n = 1 TO 10
    STATUS = UNIO(LAB,01,BADDR,LENH+1,NAMES$)
    IF status =1 THEN EXIT FOR
  NEXT n
END SUB
  '
  '---WRITING A STRING TO UNIO: BADDR-BEGIN ADDR, LENH-GIVEN LENGHT, NAMES$-THE STRING
SUB WR_UNIO(BADDR AS INTEGER,LENH AS INTEGER, NAMES$ AS STRING)
  LOCAL n AS INTEGER
  FOR n = 1 TO 10
    STATUS = UNIO(LAB,02,BADDR,LENH+1,NAMES$)
    IF status =1 THEN EXIT FOR
  NEXT n
END SUB


The results I get are all success codes(1), but no data:




MMBASIC 5.0405 on 170 chip.

According to Jim's example code, I should be getting the ASCII string back along with the "1" for success, but I am not.

100k pull-up to 3v3 on I/O pin, 100n across device.

__________________
Smoke makes things work. When the smoke gets out, it stops!


Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
TassyJim
Guru
Guru


Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2221
Posted: 09 September 2017 at 11:45am | IP Logged Quote TassyJim

Are you using the latest CFUNCTION?
From page 3.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 4871
Posted: 09 September 2017 at 11:52am | IP Logged Quote Grogster

That's a bloody good point - standby.....

Ahhhhhhhhhh!!!!!!!!!!!!





The experimentation can now continue - Thanks, Jim.

Edited by Grogster on 09 September 2017 at 11:58am


__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 5
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0791 seconds.
Privacy Policy     Process times : 0, 0.02, 0, 0.06