Page 1 of 1

UART pic 18f45k22

Posted: 23 Jan 2015 14:56
by guevas
Hello guys !, I need help.

I have knowledge in microcontrollers, but have difficulty writing the code. Descul-pe I do not speak English'm using Goolgle translator.

Well I need to send the status of 21 keys, through the serial port to 9600 :roll: bps.
these keys is to load the bytes, 0x00H to 0x15H (dec, 0 to 21).

before I need to create a code to write, in a memory E2PROM 25AA320, this type of memory uses the ISP protocol, I will need also control seven segment display with the MAX 7219 chip, this chip also uses the ISP protocol.
Good and great job.
  I will need also control a clock RTC DS 1307, and an LCD disply.

I need by INT1, iserir pulses, these pulses will be saved in e2pron, must be shown on the seven-segment display, as I push a button, I decrement pulses, which are stored in the E2PROM.

when I push, the keys must be sent through the serial port the value of each button.

Well if anyone can help me, I agadeço now because I need a lot.

Re: UART pic 18f45k22

Posted: 26 Jan 2015 17:05
by marina.petrovic
Hi,

You can start from some basic codes which can be found in our compiler and on LibStock Website.
You should adjust this examples for hardware which you use and test module functionality separately and
then combine them in your project.

For example, for:
- EEPROM:...\mikroBasic PRO for PIC\Examples\Internal MCU modules\P18F45K22\EEPROM in MCU
http://www.libstock.com/projects/view/3 ... ck-example
- MAX7219: http://www.libstock.com/projects/view/8 ... ed-library
- RTC: ...\mikroBasic PRO for PIC\Examples\Extra Boards\RTC (Soft I2C)
http://www.libstock.com/projects/view/2 ... ck-example

For any additional information you should consult datasheet of the MCU and modules which you use.

Best regards,
Marina

Re: UART pic 18f45k22

Posted: 01 Feb 2015 08:45
by guevas
thank you very much!
for your help, I will try to use these files, I'm using the compiler, C Micro pro

Re: UART pic 18f45k22

Posted: 01 Feb 2015 08:50
by guevas
which of these frequencies is used to generate baud rate? HS-PLL 320,000 MHz, 8.0000 MHz Crystal.

Re: UART pic 18f45k22

Posted: 04 Feb 2015 17:19
by marina.petrovic
Hi,

Baud rate is strictly related with the clock in your project.
You can use 8MHz clock without PLL (crystal) or higher clock value with PLL enabled - 32 MHz.
If you use PLL, please, make sure that you set oscillator settings properly in Project -> Edit Project.

Best regards,
Marina

Re: UART pic 18f45k22

Posted: 13 Aug 2015 19:48
by guevas
Thank you! Hello, I still have doubts, please see the electrical scheme is correct. I need to interface to work with memory, SPI. and led drive also uses SPI protocol. I want to know is, when I send data to EEPROM, if there will be no conflict with the LED drives?

Re: UART pic 18f45k22

Posted: 14 Aug 2015 15:07
by aleksa.jovanovic
Hi,

The chip select (or load on the MAX7219) determines what device will be active.
With SPI you can have as many devices you want on the same lines, but every device has to have each own chip select pin.
It should't be a problem.

Best regards,
Aleksa