Shop OBEX P1 Docs P2 Docs Learn Events
Issues with serin using compiler — Parallax Forums

Issues with serin using compiler

thomasschubertthomasschubert Posts: 15
edited 2012-10-13 18:56 in General Discussion
Hi

Im having all sorts of issues with the serin routine. When I run my code using 4mhz internal with the sxkey usb I can read serial input streams at 9600. when I program the device for internal 4mhz oscilator the serial routine dosent work, its like the timing is off.

Ideally I would like to use the internal 4mhz oscilator. when I try it with 50MHZ using the sxkey, I have no problems, seems to scale well, then when I program external osc and put a 50MHZ resonator on there nothing happends, again looks like a timming issue.

I also have strange things like IO pins not turning on or off intermitantly.!

One more thing to mention on the uart, transmitting characters is fine at internal 4mhz or external 50mhz, only the receive uart routine.

In my code Im using variables from 0D - 1F, my uart buffer starts from 30H to E0H, am I using memory that I shouldent

thanks all

Comments

  • wasswass Posts: 151
    edited 2012-10-13 18:56
    The internal 4Mhz oscillator is not at all accurate, even if you go through the trimming process you'll likely be off by 5% or more. You need to use an external resonator or xtal for reliable serial communications. You're just lucky that you can send from the SX to your host machine with he internal osc, it won't normally work.

    There's no UART in the SX, of course, just a virtual one created by the SX/B compiler, or perhaps some other compiler. Are you using SX/B?


    I'm not sure about your i/p pin problems, can you post your code?

    -Katie
Sign In or Register to comment.